EXC_BAD_ACCESS - hard crash on MacOS

Hello,

I had a hard crash on an app created under Xojo yesterday after the app was running for almost an hour without no problem. As it was continuing to do exactly the same thing with no human intervention, it crashed. When I saw that, I started it again, and had it do exactly the same work again, and this time it finished the job without any problem.

I got the following crash report:

OS Version: Mac OS X 10.10.5 (14F2511)

Time Awake Since Boot: 240000 seconds
Time Since Wake: 8700 seconds

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
–>
__TEXT 0000000000001000-00000000002df000 [ 2936K] r-x/rwx SM=COW /Users/USER/Desktop/Time To Run II.app/Contents/MacOS/Time To Run II

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x99c12ee5 (anonymous namespace)::AutoreleasePoolPage::AutoreleasePoolPage((anonymous namespace)::AutoreleasePoolPage*) + 9
1 libobjc.A.dylib 0x99c27e44 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, (anonymous namespace)::AutoreleasePoolPage*) + 60
2 libobjc.A.dylib 0x99c12ed6 objc_autoreleasePoolPush + 100
3 com.apple.CoreFoundation 0x91e60c05 _CFAutoreleasePoolPush + 21
4 com.apple.UIFoundation 0x95095d80 -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixFontAttributeInRange:] + 42
5 com.apple.UIFoundation 0x95095c9a -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixAttributesInRange:] + 196
6 com.apple.UIFoundation 0x950a25f9 __NSCreateRenderingContextForAttributedString + 229
7 com.apple.UIFoundation 0x9509eb59 __NSStringDrawingEngine + 9146
8 com.apple.UIFoundation 0x950a1bcf -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:context:] + 1054
9 com.apple.UIFoundation 0x950a22a2 -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:] + 86
10 rbframework.dylib 0x00477e67 0x351000 + 1207911

etc.

From reading other posts in his forum I understand that EXC_BAD_ACCESS means that the computer tried to access a part of memory that was no longer available but I cannot understand why.

Also isn’t it strange that round number for Time Awake, although probably this has nothing to do with the problem?

Thank you,
Nicolas

It could be because low memory, or because you tried to access something that is not ther anymore.

For example a class instance that is gone, but normally you’d get a nilobject exception.

Are you using declares? Or plugins?

What Xojo version? Recent ones compatibility starts at 10.12+

In that crash log, you stopped copying right where the important stuff was. Could you show us the rest of the lines in thread 0?

1 Like

Looks like an object got released once too often.
Can you separate some code into new project to reproduce?
are plugins or declares involved?

Thank you for first answers. Here is more of the log. The app was compiles in an older version of Xoxo (2013r3) so it should be well under line with OS 10.

That soft monitors/controls a physical machine in a photographic darkroom (screen killed with ctrl-caps-eject!), serial communicating through USB with an Arduino.

There are no Xojo plug ins involved.

Thank you,
Nicolas


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x99c12ee5 (anonymous namespace)::AutoreleasePoolPage::AutoreleasePoolPage((anonymous namespace)::AutoreleasePoolPage*) + 9
1 libobjc.A.dylib 0x99c27e44 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, (anonymous namespace)::AutoreleasePoolPage*) + 60
2 libobjc.A.dylib 0x99c12ed6 objc_autoreleasePoolPush + 100
3 com.apple.CoreFoundation 0x91e60c05 _CFAutoreleasePoolPush + 21
4 com.apple.UIFoundation 0x95095d80 -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixFontAttributeInRange:] + 42
5 com.apple.UIFoundation 0x95095c9a -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixAttributesInRange:] + 196
6 com.apple.UIFoundation 0x950a25f9 __NSCreateRenderingContextForAttributedString + 229
7 com.apple.UIFoundation 0x9509eb59 __NSStringDrawingEngine + 9146
8 com.apple.UIFoundation 0x950a1bcf -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:context:] + 1054
9 com.apple.UIFoundation 0x950a22a2 -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:] + 86
10 rbframework.dylib 0x00477e67 0x351000 + 1207911
11 com.apple.AppKit 0x928d0f33 -[NSTextFieldCell drawInteriorWithFrame:inView:] + 269
12 com.apple.AppKit 0x92841a8e __40-[NSTextFieldCell drawWithFrame:inView:]_block_invoke + 383
13 com.apple.AppKit 0x926a4608 +[NSAppearance _performWithCurrentAppearance:usingBlock:] + 90
14 com.apple.AppKit 0x9284180c -[NSTextFieldCell drawWithFrame:inView:] + 246
15 com.apple.AppKit 0x927411d2 -[NSControl drawRect:] + 373
16 com.apple.AppKit 0x9272b107 -[NSView _drawRect:clip:] + 4221
17 com.apple.AppKit 0x92729942 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2071
18 com.apple.AppKit 0x92729c99 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2926
19 com.apple.AppKit 0x92729c99 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2926
20 com.apple.AppKit 0x927278fa -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 876
21 com.apple.AppKit 0x927270d4 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 311
22 com.apple.AppKit 0x92723728 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2942
23 com.apple.AppKit 0x926d66ee -[NSView displayIfNeeded] + 1629
24 com.apple.AppKit 0x927924a5 -[NSView display] + 117
25 rbframework.dylib 0x00441964 0x351000 + 985444
26 rbframework.dylib 0x00448b74 0x351000 + 1014644
27 rbframework.dylib 0x003bf377 0x351000 + 451447
28 rbframework.dylib 0x003bf289 0x351000 + 451209
29 rbframework.dylib 0x003f759c formRefresh + 60
30 L-Abominable.TimeToRunII 0x000135cd Window.Refresh%%ob + 59
31 L-Abominable.TimeToRunII 0x002439a9 FileWindow.FileWindow._SpecialRuntheprint_Action%b%o<FileWindow.FileWindow> + 9208
32 rbframework.dylib 0x0041e1f8 0x351000 + 840184
33 rbframework.dylib 0x0044ece0 0x351000 + 1039584
34 rbframework.dylib 0x0044f083 0x351000 + 1040515
35 libobjc.A.dylib 0x99c15853 -[NSObject performSelector:withObject:] + 70
36 com.apple.AppKit 0x928abc1e __36-[NSApplication sendAction:to:from:]_block_invoke + 51
37 libsystem_trace.dylib 0x96ba3c03 _os_activity_initiate + 89
38 com.apple.AppKit 0x928abb37 -[NSApplication sendAction:to:from:] + 602
39 com.apple.AppKit 0x928ab7dd -[NSMenuItem _corePerformAction] + 479
40 com.apple.AppKit 0x928ab4ce -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 162
41 com.apple.AppKit 0x928aab4a -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79
42 com.apple.AppKit 0x928aaaf2 -[NSMenu _performActionWithHighlightingForItemAtIndex:] + 48
43 com.apple.AppKit 0x928aaaaf __31-[NSMenu performKeyEquivalent:]_block_invoke + 43
44 libsystem_trace.dylib 0x96ba3c03 _os_activity_initiate + 89
45 com.apple.AppKit 0x928aa2f3 -[NSMenu performKeyEquivalent:] + 380
46 com.apple.AppKit 0x928a92eb -[NSApplication _handleKeyEquivalent:] + 918
47 com.apple.AppKit 0x927a690c -[NSApplication sendEvent:] + 4581
48 rbframework.dylib 0x00450cf4 0x351000 + 1047796
49 rbframework.dylib 0x00450d40 0x351000 + 1047872
50 L-Abominable.TimeToRunII 0x000043db Delegate.Invoke%% + 34
51 L-Abominable.TimeToRunII 0x00096864 Application._CallFunctionWithExceptionHandling%%op + 248
52 rbframework.dylib 0x003d4504 0x351000 + 537860
53 rbframework.dylib 0x00450c65 0x351000 + 1047653
54 com.apple.AppKit 0x926c6bfc -[NSApplication run] + 1003
55 rbframework.dylib 0x003d4587 0x351000 + 537991
56 rbframework.dylib 0x003a5c12 RuntimeRun + 50
57 L-Abominable.TimeToRunII 0x001763fc REALbasic._RuntimeRun + 34
58 L-Abominable.TimeToRunII 0x00003f6a _Main + 257
59 L-Abominable.TimeToRunII 0x000024f0 % main + 36
60 L-Abominable.TimeToRunII 0x002b8c4c _start + 116
61 L-Abominable.TimeToRunII 0x002b8ba2 start + 43

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x95c9c8ce kevent64 + 10
1 libdispatch.dylib 0x982e5ce3 _dispatch_mgr_invoke + 245
2 libdispatch.dylib 0x982e58c6 _dispatch_mgr_thread + 52

Hello,

Here it came up again; I’ve had the same crash today, again in the middle of nowhere after an hour or so of running the program.

Does anyone has an understanding of what is going on so that I can try to find a solution?

Thank you
Nicolas


Date/Time: 2020-11-09 14:50:06.007 +0100
OS Version: Mac OS X 10.10.5 (14F2511)
Report Version: 11
Anonymous UUID: A7770072-CF00-632F-DFD1-EFEBC6287E34

Sleep/Wake UUID: 75F1304E-7E4F-458A-BAE5-253A32BBA255

Time Awake Since Boot: 11000 seconds
Time Since Wake: 8800 seconds

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
–>
__TEXT 0000000000001000-00000000002e3000 [ 2952K] r-x/rwx SM=COW /Users/USER/Desktop/Time To Run II.app/Contents/MacOS/Time To Run II

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x99c12ee5 (anonymous namespace)::AutoreleasePoolPage::AutoreleasePoolPage((anonymous namespace)::AutoreleasePoolPage*) + 9
1 libobjc.A.dylib 0x99c27e44 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, (anonymous namespace)::AutoreleasePoolPage*) + 60
2 libobjc.A.dylib 0x99c2711e objc_object::rootAutorelease2() + 80
3 com.apple.AppKit 0x9268d2cb -[NSCell _contents] + 466
4 com.apple.AppKit 0x9268d0ab -[NSTextFieldCell setObjectValue:] + 114
5 com.apple.AppKit 0x92697368 -[NSCell setAttributedStringValue:] + 556
6 com.apple.AppKit 0x926970de -[NSControl setAttributedStringValue:] + 116
7 rbframework.dylib 0x0044c01b 0x355000 + 1011739
8 rbframework.dylib 0x0044c511 0x355000 + 1013009
9 rbframework.dylib 0x0044f397 0x355000 + 1024919
10 rbframework.dylib 0x0044ed77 0x355000 + 1023351
11 rbframework.dylib 0x00416087 staticCaptionSetter + 103
12 L-Abominable.TimeToRunII 0x00110fab Label.Text.Set%%oi4s + 64
13 L-Abominable.TimeToRunII 0x002b09b1 FrameCountWindow.FrameCountWindow.Update%%o<FrameCountWindow.FrameCountWindow>i4 + 218
14 L-Abominable.TimeToRunII 0x00244254 FileWindow.FileWindow._SpecialRuntheprint_Action%b%o<FileWindow.FileWindow> + 9084
15 rbframework.dylib 0x004221f8 0x355000 + 840184
16 rbframework.dylib 0x00452ce0 0x355000 + 1039584
17 rbframework.dylib 0x00453083 0x355000 + 1040515
18 libobjc.A.dylib 0x99c15853 -[NSObject performSelector:withObject:] + 70
19 com.apple.AppKit 0x928abc1e __36-[NSApplication sendAction:to:from:]_block_invoke + 51
20 libsystem_trace.dylib 0x96ba3c03 _os_activity_initiate + 89
21 com.apple.AppKit 0x928abb37 -[NSApplication sendAction:to:from:] + 602
22 com.apple.AppKit 0x928ab7dd -[NSMenuItem _corePerformAction] + 479
23 com.apple.AppKit 0x928ab4ce -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 162
24 com.apple.AppKit 0x928aab4a -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79
25 com.apple.AppKit 0x928aaaf2 -[NSMenu _performActionWithHighlightingForItemAtIndex:] + 48
26 com.apple.AppKit 0x928aaaaf __31-[NSMenu performKeyEquivalent:]_block_invoke + 43
27 libsystem_trace.dylib 0x96ba3c03 _os_activity_initiate + 89
28 com.apple.AppKit 0x928aa2f3 -[NSMenu performKeyEquivalent:] + 380
29 com.apple.AppKit 0x928a92eb -[NSApplication _handleKeyEquivalent:] + 918
30 com.apple.AppKit 0x927a690c -[NSApplication sendEvent:] + 4581
31 rbframework.dylib 0x00454cf4 0x355000 + 1047796
32 rbframework.dylib 0x00454d40 0x355000 + 1047872
33 L-Abominable.TimeToRunII 0x000043db Delegate.Invoke%% + 34
34 L-Abominable.TimeToRunII 0x00096864 Application._CallFunctionWithExceptionHandling%%op + 248
35 rbframework.dylib 0x003d8504 0x355000 + 537860
36 rbframework.dylib 0x00454c65 0x355000 + 1047653
37 com.apple.AppKit 0x926c6bfc -[NSApplication run] + 1003
38 rbframework.dylib 0x003d8587 0x355000 + 537991
39 rbframework.dylib 0x003a9c12 RuntimeRun + 50
40 L-Abominable.TimeToRunII 0x001763fc REALbasic._RuntimeRun + 34
41 L-Abominable.TimeToRunII 0x00003f6a _Main + 257
42 L-Abominable.TimeToRunII 0x000024f0 % main + 36
43 L-Abominable.TimeToRunII 0x002bd1a6 _start + 116
44 L-Abominable.TimeToRunII 0x002bd0fc start + 43

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x95c9c8ce kevent64 + 10
1 libdispatch.dylib 0x982e5ce3 _dispatch_mgr_invoke + 245
2 libdispatch.dylib 0x982e58c6 _dispatch_mgr_thread + 52

I ran the same one-hour-plus long procedure again, once with the screen “live” (no problem), and once with the screen killed by ctrl-caps-eject and it reproduced the crash. It’s hard for me to do this many times in a row, but could it be that something happens over time because the screen is killed? Of course the preferences for "energy saver’ for computer and screen sleep are on “never”.

Nicolas

Hello again. At the risk of monologuing, I want to add that it seems that I have found a trick to escape the bug::. Instead of turning off the screen (and keyboard) with ctrl-caps-eject, I turn them off with the F1 and F5 function keys. By doing so, it seems that there is no problem. At least I could run several times my software for long periods of time in darkness with no crash, whereas with ctrl-caps-eject i was getting the problems described above.

Does anyone have an idea of what the ctrl-caps-eject routine does besides turning off the screen and keyboard? Isn’t that a strange bug of OS X ?

Best,
Nicolas

Could you go to your system preferences for the keyboard and look up what ctrl-caps-eject is set to? I don’t have that combination set on my machine.

Thank you for your reply. It is not listed in the System preferences keyboard shortcuts, but it seems to be a standard Mac OS shortcut :, and is listed on this page for instance::


under the label:
Control–Shift–Power button* or Control–Shift–Media Eject ! Put your displays to sleep.

Well, if you can reproduce this with a simple example and file a bug report in feedback, we can take a look.

Thank you for the offer to help. I’m not sure that I understand what you would need exactly besides the crash reports that I have already sent. Please let me know and I will try to provide it.

A project which crashes like this when we press that key combination and a bug report in our feedback system. Posting here is not the same as filing a bug report.

Ok, I understand now. thank you, I will do that then.