Toolbar crashes?


does one of you also saw toolbars crashing?

e.g. we have an app where simply clicking a toolbar item randomly crashes.

Does someone have an idea about this and maybe a tip?

[quote=148973:@Christian Schmitz]HI,

does one of you also saw toolbars crashing?

e.g. we have an app where simply clicking a toolbar item randomly crashes.

Does someone have an idea about this and maybe a tip?[/quote]

I suppose you have tried to look at UnhandledException already ?

it’s a crash, not an exception.

looks like this:

Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000

VM Regions Near 0:
–> __PAGEZERO 0000000000000000-0000000000001000 [ 4K] —/--- SM=NUL /Users/USER//xxx.debug
__TEXT 0000000000001000-00000000012da000 [ 18.8M] r-x/rwx SM=COW /Users/USER/

Application Specific Information:
objc_msgSend() selector name: class

Thread 0 Crashed:: Dispatch queue:
0 libobjc.A.dylib 0x9aec34ab objc_msgSend + 27
1 0x972e93a9 -[__NSCFString isEqual:] + 57
2 com.xojo.XojoFramework 0x015d4c16 0x158a000 + 306198
3 com.xojo.XojoFramework 0x015d4e12 0x158a000 + 306706
4 com.xojo.XojoFramework 0x015d513b 0x158a000 + 307515
5 libobjc.A.dylib 0x9aed92af -[NSObject performSelector:withObject:] + 70
6 0x91b432db -[NSToolbarButton sendAction:to:] + 94
7 0x91b4333a -[NSToolbarButton sendAction] + 82
8 0x9166ec70 -[NSToolbarItemViewer mouseDown:] + 5207
9 0x9157fa9d -[NSWindow sendEvent:] + 11953
10 com.xojo.XojoFramework 0x015c0fdc 0x158a000 + 225244
11 0x9151b91d -[NSApplication sendEvent:] + 4034
12 com.xojo.XojoFramework 0x015b1706 0x158a000 + 161542
13 com.xojo.XojoFramework 0x015b1750 0x158a000 + 161616
14 xxxxxxxxxxxxxxxxxxxxx 0x00002fc6 Delegate.Invoke%% + 34
15 xxxxxxxxxxxxxxxxxxxxx 0x000b0db7 Application._CallFunctionWithExceptionHandling%%op + 248
16 com.xojo.XojoFramework 0x016a4911 0x158a000 + 1157393
17 com.xojo.XojoFramework 0x015b1675 0x158a000 + 161397
18 0x913601bc -[NSApplication run] + 823
19 com.xojo.XojoFramework 0x016a4997 0x158a000 + 1157527
20 com.xojo.XojoFramework 0x016a3021 RuntimeRun + 49
21 xxxxxxxxxxxxxxxxxxxxx 0x001fc848 REALbasic._RuntimeRun + 34
22 xxxxxxxxxxxxxxxxxxxxx 0x00002eb2 _Main + 257
23 xxxxxxxxxxxxxxxxxxxxx 0x00002598 % main + 36
24 xxxxxxxxxxxxxxxxxxxxx 0x011d1612 _start + 116
25 xxxxxxxxxxxxxxxxxxxxx 0x011d1568 start + 43


Exception Codes: KERN_INVALID_ADDRESS at 0x0000000070000020

VM Regions Near 0x70000020:
__LINKEDIT 00000000495c3000-0000000049622000 [ 380K] r–/rwx SM=COW /System/Library/Extensions/GeForceGLDriver.bundle/Contents/MacOS/GeForceGLDriver
__TEXT 000000008fe2a000-000000008fe5d000 [ 204K] r-x/rwx SM=COW /usr/lib/dyld

Application Specific Information:
objc_msgSend() selector name: _button

Thread 0 Crashed:: Dispatch queue:
0 libobjc.A.dylib 0x9aec34a7 objc_msgSend + 23
1 0x9166ebbc -[NSToolbarItemViewer mouseDown:] + 5027
2 0x9157fa9d -[NSWindow sendEvent:] + 11953
3 com.xojo.XojoFramework 0x015bffdc 0x1589000 + 225244
4 0x9151b91d -[NSApplication sendEvent:] + 4034
5 com.xojo.XojoFramework 0x015b0706 0x1589000 + 161542
6 com.xojo.XojoFramework 0x015b0750 0x1589000 + 161616
7 xxxxxxxxxxxxxxxxxxxxx 0x00002fc6 Delegate.Invoke%% + 34
8 xxxxxxxxxxxxxxxxxxxxx 0x000b0db7 Application._CallFunctionWithExceptionHandling%%op + 248
9 com.xojo.XojoFramework 0x016a3911 0x1589000 + 1157393
10 com.xojo.XojoFramework 0x015b0675 0x1589000 + 161397
11 0x913601bc -[NSApplication run] + 823
12 com.xojo.XojoFramework 0x016a3997 0x1589000 + 1157527
13 com.xojo.XojoFramework 0x016a2021 RuntimeRun + 49
14 xxxxxxxxxxxxxxxxxxxxx 0x001fc848 REALbasic._RuntimeRun + 34
15 xxxxxxxxxxxxxxxxxxxxx 0x00002eb2 _Main + 257
16 xxxxxxxxxxxxxxxxxxxxx 0x00002598 % main + 36
17 xxxxxxxxxxxxxxxxxxxxx 0x011d0f8e _start + 116
18 xxxxxxxxxxxxxxxxxxxxx 0x011d0ee4 start + 43

basically toolbar item seems to be gone/missing when it receives a click.

Feedback case 36834

Just because of my curiosity: Is the crash bound to a special MAC OS X version (Yosemite?) ?

no, at least 10.9 and 10.10.

I’m curious what it might have to do with the graphics driver? The GeForce driver stands out to me in this instance.

Hmm… We use the toolbar as a tab switcher in AW3, and in a bunch of our apps I use the toolbar, but then squeeze controls in. I’ve not seen this.

Are you doing anything special with the toolbar or the toolbuttons?

I build them at runtime. Later in app we want to change them depending of context.

hmm… Maybe it doesn’t like that, have you tried building them in the IDE, with all the buttons and then hiding/showing the relevant buttons when needed?

If I had to say what I think is the issue with that crash report, I’d say your got an object being released too early, or a custom Obj-C class that’s somehow not being loaded or unloaded.

I made another sample. The problem may be that we query server.
So user clicks, we send query, and when answer comes back we change toolbar.
Now it may be that if user clicks while we change toolbar, the buttons are not retained correctly, so it crashes.

I just ran into this today with 2015r1, threw some points at it, and a crash report. I’m working on a minimal project sample, as I can get it to crash without removing or adding any buttons, just by enabling / disabling them (also using a timer).

Symbols are stripped so the crash log dumper is guessing at the symbols to put in there
These are “the closest exported symbols it could find” (more or less) + offset that points to the spot the rash occurred in the exe.
But you’ll notice the offsets are something quite ridiculous like frame 12 :stuck_out_tongue:

     12 com.xojo.XojoFramework 0x016a3997 0x1589000 + 1157527

Essentially what you see in the stack trace is NOT the names of methods in the framework :stuck_out_tongue:
Joe mentioned this in another thread

and I think there was a feature request to not strip names. Maybe time to consider doing it?

Based on what Joe wrote I doubt it

But submit the crash log & we can diagnose it :slight_smile:

I just added a small sample project to the case that can reproduce the crash without any adding or removing of buttons, just enabling and disabling them.