Re: Intermittent crash on AXUIElementCopyAttributeValue function
Re: Intermittent crash on AXUIElementCopyAttributeValue function
- Subject: Re: Intermittent crash on AXUIElementCopyAttributeValue function
- From: "Sky Yan" <email@hidden>
- Date: Fri, 23 May 2008 12:08:32 +0800
I believe that is the root. I will check my code to find where it release the element. Thank you anyway!
On Thu, May 22, 2008 at 10:14 PM, John Louch <
email@hidden> wrote:
I think you misunderstood. In the process that you are calling AXUIElementCopyAttributeValue you are over-releasing the AXUIElementRef. It does not matter if the element in the app you are connected to is still there or not.
i.e. something like this is happening.
AXUIElementRef element = copyUIElementFromSomeWhere();
CFRelease (element); // the element is now released
AXUIElementCopyAyttributeValue (element, ...); // you just passed a bogus memory location to AX
Of course this is an over simplification.
Thanks,
jl
On May 22, 2008, at 1:27 AM, Sky Yan wrote:
Thanks! So is there any methods to avoid this kind of crash? Is there any method to let me check the validation firstly?
My automation tool is running a separate process with application under testing. It might be in this situation: At the first time, the tool get the AXUIElementRef which point to a valid UI widget, when the tool call AXUIElementCopyAttributeValue, the referred UI widget has been released by application under testing. Could this situation cause crash? If so, why not return kAXErrorInvalidUIElement but crash?
On Thu, May 22, 2008 at 11:28 AM, John Louch <
email@hidden> wrote:
more than likely you are sending a bogus AXUIElementRef to AXUIElementCopyAttributeValue. you probably have release it already before calling the function.
Thanks,
jl
On May 21, 2008, at 8:22 PM, Sky Yan wrote:
Hi, All,
I am developing an automation tool which use Accessibility API to get the information of UI widget. I met a problem of an intermittent crash at AXUIElementCopyAttributeValue. It is so wired that I can not reproduce it always . I guess the crash is caused by a kind of invalid AXUIElementRef value as input. So how could I check the validation of an AXUIElementRef value? Or is it an Apple bug?
I attched part of crash log, if you want more details, please let me know.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Date/Time: 2008-05-20 14:52:16.946 +0800
OS Version: Mac OS X 10.5.2 (9C7010)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c7a896a7
Crashed Thread: 1
....
Thread 1 Crashed:
0 libobjc.A.dylib 0x95585695 _class_isInitialized + 14
1 libobjc.A.dylib 0x9557b4ea _class_lookupMethodAndLoadCache + 66
2 libobjc.A.dylib 0x9558b736 objc_msgSend + 102
3 com.apple.HIServices 0x96419398 _AXUIElementValidate + 76
4 com.apple.HIServices 0x96414c77 AXUIElementCopyAttributeValue + 153
...
Thread 1 crashed with X86 Thread State (32-bit):
eax: 0xc7a89697 ebx: 0x9557b4b3 ecx: 0x95584072 edx: 0x9557a8ff
edi: 0x1ea24e70 esi: 0x1ea0cc30 ebp: 0xb07fc438 esp: 0xb07fc438
ss: 0x0000001f efl: 0x00010246 eip: 0x95585695 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x0000001f gs: 0x00000037
cr2: 0xc7a896a7
--
Best Wishes.
-------------------------
Sky Yan _______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility-email@hidden)
Help/Unsubscribe/Update your Subscription:
--
Best Wishes.
-------------------------
Sky Yan
--
Best Wishes.
-------------------------
Sky Yan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden