KarenA
(KarenA)
May 25, 2014, 12:52am
1
I am in the process of trying to update some old code that runs OK in carbon., but now hard crashes in cocoa 2014R1.1
I’m doing a drag and drop from a floating sub pallet (no problem from the main pallet) … I’m using a timer with a delegate to know when to close the subpallet I think this was originally written before AddHandler existed … or before I became aware of it . Heck I even had to update it to use the Canvas doubleclick event instead using declares to get the double-click time myself.
In any case even stepping through teh code in the debugger, I have not been able to narrow down what is causing the crash in cocoa.
I know this is very vague but i was wondering if anyone has run into something like this and might suggest what I might look for.
Thanks,
If I had to guess, it’s the Timer. One of the differences between Carbon and Cocoa is that Timers can fire during the execution of other code, including user interface code. (Try setting a Timer that fires and beeps every second. It will beep while you are moving a window or have the mouse down in the menubar.) The Timer firing is probably firing during the drag 'n drop and screwing something up in the framework.
If you can verify that this is the case, please file a Feedback report.
To be clear, only places where an event loop is running – not arbitrary code.
When does the timer get initiated? Is it after the drop?
KarenA
(KarenA)
May 25, 2014, 4:09am
5
Right before the drag is initiated… I just changed it to use AddHandler and still get the crash
It checks for system.MouseUp. When detected it closes the sub pallet where the drag initiated from, Turns itself off and Nils the stored reference to itself
KarenA
(KarenA)
May 25, 2014, 4:33am
6
I’ve confirmed it’s not the timer
So you’ve removed the timer from the equation.
When the object receives the drag, does it take a long time to process? If so, perhaps you could stuff the contents of the drag into a variable and then call a timer to process it. This way the system can confirm the drag has been accepted and then your app can deal with processing it.
Define crash. Is it an exception? an actual crash with a crash log?
KarenA
(KarenA)
May 25, 2014, 4:59am
9
Actual Crash log…
The Drag initiates from a listbox.
I just managed to stop the crashing…
I think it was from trying to close (and NIL) the window from which the drag initiated too soon.
Instead of closing it right away, I set window.visible to false and the crashing in cocoa stopped.
The Crash log looked like this:
Process: My Application.debug [5754]
Path: /Volumes/VOLUME/*/My Application.debug.app/Contents/MacOS/My Application.debug
Identifier: com.KATkoSoft.StyledlineDemo
Version: ??? (1.0.0.0.0)
Code Type: X86 (Native)
Parent Process: launchd [156]
Responsible: My Application.debug [5754]
User ID: 501
Date/Time: 2014-05-25 00:34:34.891 -0400
OS Version: Mac OS X 10.9.3 (13D65)
Report Version: 11
Anonymous UUID: 5C838858-319F-717D-E612-2F44259EC716
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
abort() called
terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x99983952 __pthread_kill + 10
1 libsystem_pthread.dylib 0x98382167 pthread_kill + 101
2 libsystem_c.dylib 0x9083129c abort + 155
3 libc++abi.dylib 0x91fcc6c9 abort_message + 169
4 libc++abi.dylib 0x91fed47d default_terminate_handler() + 264
5 libc++abi.dylib 0x91feac30 std::__terminate(void (*)()) + 14
6 libc++abi.dylib 0x91fea64b __cxa_throw + 116
7 libc++.1.dylib 0x923c6b66 operator new(unsigned long) + 102
8 com.xojo.XojoFramework 0x0053acbd 0x4e1000 + 367805
9 com.xojo.XojoFramework 0x0053ac2b 0x4e1000 + 367659
10 com.xojo.XojoFramework 0x00536d51 0x4e1000 + 351569
11 com.xojo.XojoFramework 0x0053955c 0x4e1000 + 361820
12 com.xojo.XojoFramework 0x0053ed3f 0x4e1000 + 384319
13 com.xojo.XojoFramework 0x005407d8 0x4e1000 + 391128
14 com.xojo.XojoFramework 0x005a807e 0x4e1000 + 815230
15 com.xojo.XojoFramework 0x005d020d 0x4e1000 + 979469
16 com.xojo.XojoFramework 0x005cfea5 0x4e1000 + 978597
17 com.xojo.XojoFramework 0x005d052e 0x4e1000 + 980270
18 com.xojo.XojoFramework 0x005d0574 0x4e1000 + 980340
19 com.xojo.XojoFramework 0x005992f0 0x4e1000 + 754416
20 com.xojo.XojoFramework 0x005cf77f 0x4e1000 + 976767
21 com.xojo.XojoFramework 0x00517fd8 0x4e1000 + 225240
22 com.xojo.XojoFramework 0x00514b37 0x4e1000 + 211767
23 com.apple.AppKit 0x9447ea9d -[NSWindow sendEvent:] + 11953
24 com.xojo.XojoFramework 0x0051617c 0x4e1000 + 217468
25 com.apple.AppKit 0x9441a91d -[NSApplication sendEvent:] + 4034
26 com.xojo.XojoFramework 0x00507fe6 0x4e1000 + 159718
27 com.xojo.XojoFramework 0x00508030 0x4e1000 + 159792
28 com.KATkoSoft.StyledlineDemo 0x00003fe9 Delegate.Invoke%% + 34
29 com.KATkoSoft.StyledlineDemo 0x0009ab07 Application._CallFunctionWithExceptionHandling%%op + 248
30 com.xojo.XojoFramework 0x005fbea1 0x4e1000 + 1158817
31 com.xojo.XojoFramework 0x00507f55 0x4e1000 + 159573
32 com.apple.AppKit 0x9425f1dc -[NSApplication run] + 823
33 com.xojo.XojoFramework 0x005fbf27 0x4e1000 + 1158951
34 com.xojo.XojoFramework 0x005fa5c1 RuntimeRun + 49
35 com.KATkoSoft.StyledlineDemo 0x00196566 REALbasic._RuntimeRun + 34
36 com.KATkoSoft.StyledlineDemo 0x00003e54 _Main + 257
37 com.KATkoSoft.StyledlineDemo 0x0000250c % main + 36
38 com.KATkoSoft.StyledlineDemo 0x0042cec7 _start + 116
39 com.KATkoSoft.StyledlineDemo 0x0042ce1d start + 43
It would be great if you could capture the crashing version of the code and file a big report. Although you’ve fixed it for yourself by sidestepping the problem, it could have wider implications and should be investigated.
KarenA
(KarenA)
May 25, 2014, 5:14am
11
Looking at the console, actually the crash log changed as I made changes… another one I goy=t was:
Process: My Application.debug [5720]
Path: /Volumes/VOLUME/*/My Application.debug.app/Contents/MacOS/My Application.debug
Identifier: com.KATkoSoft.StyledlineDemo
Version: ??? (1.0.0.0.0)
Code Type: X86 (Native)
Parent Process: launchd [156]
Responsible: My Application.debug [5720]
User ID: 501
Date/Time: 2014-05-25 00:29:49.563 -0400
OS Version: Mac OS X 10.9.3 (13D65)
Report Version: 11
Anonymous UUID: 5C838858-319F-717D-E612-2F44259EC716
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000300001dc
VM Regions Near 0x300001dc:
mapped file 000000000a5fa000-000000000aae1000 [ 5020K] rw-/rwx SM=COW /System/Library/Fonts/HelveticaNeue.dfont
–>
__TEXT 000000008fea0000-000000008fed3000 [ 204K] r-x/rwx SM=COW /usr/lib/dyld
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.xojo.XojoFramework 0x005d0207 0x4e1000 + 979463
1 com.xojo.XojoFramework 0x005cfea5 0x4e1000 + 978597
2 com.xojo.XojoFramework 0x005d052e 0x4e1000 + 980270
3 com.xojo.XojoFramework 0x005d0574 0x4e1000 + 980340
4 com.xojo.XojoFramework 0x005992f0 0x4e1000 + 754416
5 com.xojo.XojoFramework 0x005cf77f 0x4e1000 + 976767
6 com.xojo.XojoFramework 0x00517fd8 0x4e1000 + 225240
7 com.xojo.XojoFramework 0x00514b37 0x4e1000 + 211767
8 com.apple.AppKit 0x9447ea9d -[NSWindow sendEvent:] + 11953
9 com.xojo.XojoFramework 0x0051617c 0x4e1000 + 217468
10 com.apple.AppKit 0x9441a91d -[NSApplication sendEvent:] + 4034
11 com.xojo.XojoFramework 0x00507fe6 0x4e1000 + 159718
12 com.xojo.XojoFramework 0x00508030 0x4e1000 + 159792
13 com.KATkoSoft.StyledlineDemo 0x00003fe9 Delegate.Invoke%% + 34
14 com.KATkoSoft.StyledlineDemo 0x0009ab07 Application._CallFunctionWithExceptionHandling%%op + 248
15 com.xojo.XojoFramework 0x005fbea1 0x4e1000 + 1158817
16 com.xojo.XojoFramework 0x00507f55 0x4e1000 + 159573
17 com.apple.AppKit 0x9425f1dc -[NSApplication run] + 823
18 com.xojo.XojoFramework 0x005fbf27 0x4e1000 + 1158951
19 com.xojo.XojoFramework 0x005fa5c1 RuntimeRun + 49
20 com.KATkoSoft.StyledlineDemo 0x00196566 REALbasic._RuntimeRun + 34
21 com.KATkoSoft.StyledlineDemo 0x00003e54 _Main + 257
22 com.KATkoSoft.StyledlineDemo 0x0000250c % main + 36
23 com.KATkoSoft.StyledlineDemo 0x0042cf05 _start + 116
24 com.KATkoSoft.StyledlineDemo 0x0042ce5b start + 43
Please post the entire crash log somewhere, preferably in a Feedback case.