unexpected crash in ElCaptain 64bit

I have an app. It is compiled 64bit and works well in Yosemite. Running in El Captain I have crash without any error…sometimes ElCaptain report this error stack:

Process: fribox [608]
Path: /Users/USER/Desktop/fribox.app/Contents/MacOS/fribox
Identifier: com.europeanbrokers.fribox
Version: ??? (
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: fribox [608]
User ID: 501

Date/Time: 2016-09-06 19:11:33.225 +0200
OS Version: Mac OS X 10.11.4 (15E65)
Report Version: 11
Anonymous UUID:

Time Awake Since Boot: 2200 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Codes: KERN_INVALID_ADDRESS at 0x00003a6e6f697480

VM Regions Near 0x3a6e6f697480:
Process Corpse Info 0000000107b32000-0000000107d32000 [ 2048K] rw-/rwx SM=COW
STACK GUARD 0000700000000000-0000700000001000 [ 4K] —/rwx SM=NUL stack guard for thread 1

Application Specific Information:
objc_msgSend() selector name: addSubview:
Performing @selector(MenuActionMBS) from sender NSStatusBarButton 0x7fc49ac83f40

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff8e07b4dd objc_msgSend + 29
1 com.europeanbrokers.fribox 0x0000000101830d04 ListBoxNSScroll.Event_Open%%o + 6500
2 com.xojo.XojoFramework 0x0000000101cf378a FireWindowOpenEvents + 53
3 com.europeanbrokers.fribox 0x00000001015c064c Window.Constructor%%o + 60
4 com.europeanbrokers.fribox 0x000000010184ccc8 HUDwindow.HUDwindow.Constructor%%o<HUDwindow.HUDwindow> + 216
5 com.europeanbrokers.fribox 0x00000001018773c5 MyCocoaStatusItemMBS.run%%o + 197
6 com.europeanbrokers.fribox 0x000000010187726f MyCocoaStatusItemMBS.Event_Action%%o + 63
7 MBS_NSStatusItem_Plugin_19070.dylib 0x00000001046a0e2a CallEvent(NSStatusItem*, long long) + 346
8 MBS_NSStatusItem_Plugin_19070.dylib 0x00000001046a26b5 -[NSStatusItem(NSStatusItemExtrasMBS) MenuActionMBS] + 37
9 libsystem_trace.dylib 0x00007fff9a09207a _os_activity_initiate + 75
10 com.apple.AppKit 0x00007fff8d5c1e89 -[NSApplication sendAction:to:from:] + 460
11 com.apple.AppKit 0x00007fff8d5d3fde -[NSControl sendAction:to:] + 86
12 com.apple.AppKit 0x00007fff8da30c90 -[NSStatusBarButtonCell _sendActionFrom:] + 164
13 com.apple.AppKit 0x00007fff8d6a54a2 __48-[NSCell trackMouse:inRect:ofView:untilMouseUp:]_block_invoke + 219
14 libsystem_trace.dylib 0x00007fff9a09207a _os_activity_initiate + 75
15 com.apple.AppKit 0x00007fff8d5d1f08 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1283
16 com.apple.AppKit 0x00007fff8d61afd0 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 744
17 com.apple.AppKit 0x00007fff8da30473 -[NSStatusBarButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 327
18 com.apple.AppKit 0x00007fff8d5d0bb4 -[NSControl mouseDown:] + 669
19 com.apple.AppKit 0x00007fff8db25469 -[NSWindow _handleMouseDownEvent:isDelayedEvent:] + 6322
20 com.apple.AppKit 0x00007fff8db2644d -[NSWindow _reallySendEvent:isDelayedEvent:] + 212
21 com.apple.AppKit 0x00007fff8d56563d -[NSWindow sendEvent:] + 517
22 com.apple.AppKit 0x00007fff8da338e9 -[NSStatusBarWindow sendEvent:] + 281
23 com.apple.AppKit 0x00007fff8d4e5b3c -[NSApplication sendEvent:] + 2540
24 com.xojo.XojoFramework 0x0000000101b7ca69 0x101b3e000 + 256617
25 com.europeanbrokers.fribox 0x00000001016b9507 Delegate.Invoke%% + 7
26 com.europeanbrokers.fribox 0x00000001015fe861 Application._CallFunctionWithExceptionHandling%%op + 273
27 com.xojo.XojoFramework 0x0000000101ce01ab 0x101b3e000 + 1712555
28 com.xojo.XojoFramework 0x0000000101b7c9e3 0x101b3e000 + 256483
29 com.apple.AppKit 0x00007fff8d34cef6 -[NSApplication run] + 796
30 com.xojo.XojoFramework 0x0000000101cde57b RuntimeRun + 40
31 com.europeanbrokers.fribox 0x000000010167c878 REALbasic._RuntimeRun + 24
32 com.europeanbrokers.fribox 0x0000000101879160 _Main + 480
33 com.europeanbrokers.fribox 0x00000001018788b1 main + 65
34 com.europeanbrokers.fribox 0x00000001015b98a4 start + 52

I think the issue is in nsscrollbar. I use the nsscrolllistview example :


But I’m not shure the real issue is there. DEBUGGING in 64Bit MODE IS NOT POSSIBLE. So anyone can help me to see the light beneath this black hole ?

The debugger is urgently needed for 64bit…

Anyways. Does the crash also occur for 32bit? Does the example crash? Then you should be able to find the problem more easily.

Without the debugger you need to do some fishing. Can you take out the declares/plugin calls that you have? For instance MyCocoaStatusItemMBS. Have you tried to isolate the HUDWindow? That means a project file with just this window and it’s dependencies so see exactly where the crash happens. It’s my least favorite method of finding a bug because it usually takes a longer time. But this may be your only chance to find the bug without a debugger.

Now that we have a fast 64 bit compilation, with 30 seconds up to a minute, that becomes compatible with a Run. Of course that is only half of the thing, since Xojo has now to create the hooks for the debugged application to communicate with the IDE. I am sure they are working on it.

I can report in 32 bit compilation there is no issue. also 64 bit compilation in Osx Yosemite is ok…but not inEl Captain where also screens coordinates are completely different…
I have gone fishing :slight_smile: and I found the problems is relative to ListBoxNSScroll.Event_Open. I have trapped this lines with a try-catch block :

try dim w As integer for c as integer=0 to ColumnCount-1 w=w+me.Column(c).WidthActual next myScrollView.SetDocumentSize(max(Width,w),(me.ListCount+1)*me.RowHeight+HeaderHeight) catch return end try
Compiling 64bit and running in El Captain the sample program works, but applying the same fix on my program I still have the same crash…
the sample program that run with the patch is here:
probabably there is some Declare not yet compatible with El Captain.
For this reason I have to completely change the UI approach for my software excluding ListboxNSScroll control.
I tested is running without that control… :frowning:

The CGRect Struct declared in that example wont work for 64bit.

I’ve fixed up the example. Try downloading again. It now uses the proper CGFloat based structures. (and cgfloat for the magnify event)

Thanks Jim, but where can I download the fixed sample ? What I will found in CGRect structure (fixed version) ?

Same URL ListboxNSScroll.xojo_binary_project

The CGRect structure is located in XScrollview class. You’ll see that it now consists of a CGSize and CGPoint, each of which are a pair of CGFloats.

In my Sample I got under structure:
x as single offset=0 Size=4
y as single offset=0 Size=4
width as single offset=8 Size=4
height as single offset=12 Size=4


width as single offset=0 Size=4
height as single offset=4 Size=4

Is this correct ?

Change each instance of “single” to “CGFloat” and it should work correctly. (It will fix the 32/64bit problem with the structures at least).

Did you download it from the link I posted above? It should have a CGRect structure, a CGPoint structure and a CGSize Structure. Just changing the singles to CGFloats may or may not work.
Perhaps there’s some web-caching going on.

Thanks Jim, I have downloaded the sample from here http://www.pidog.com/share/ListboxNSScroll.xojo_binary_project just now.

Anyway I have done as you suggest…And I have no crash now…thank you…
Now I got other issues to solve in El Captain … but I think depends always from NSRect declared as Single…

All the best. Thank you.