Another crash on High Sierra

Once again, Lightwright is crashing on High Sierra and nowhere else. Previously, it was built in 2016R3, but as a test I built it in Xojo 2018r2 and sent it to my beta testers. The first one responded today with a crash report. Here is the bulk of it, any thoughts on where I might look next to puzzle out these crashes? Does it mean I have to upgrade my images in some way? Though it sure looks like the app has barely gotten off the ground when the crash happened…

Process: Lightwright 6 [4908] Path: /Applications/Lightwright 6.app/Contents/MacOS/Lightwright 6 Identifier: com.mckernon.lightwright6 Version: 6.0.19 beta build 200 (6.0.19.2.200) Code Type: X86 (Native) Parent Process: ??? [1] Responsible: Lightwright 6 [4908] User ID: 503 Date/Time: 2018-09-10 09:20:33.203 -0700 OS Version: Mac OS X 10.13.6 (17G65) Report Version: 12 Bridge OS Version: 3.0 (14Y664) Time Awake Since Boot: 170000 seconds Time Since Wake: 8400 seconds System Integrity Protection: disabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Illegal instruction: 4 Termination Reason: Namespace SIGNAL, Code 0x4 Terminating Process: exc handler [0] Application Specific Information: Crashing on exception: NSImage: Insufficient memory to allocate pixel data buffer of 6809088 bytes Application Specific Backtrace 1: 0 CoreFoundation 0x93890532 __raiseError + 178 1 libobjc.A.dylib 0xa67b1346 objc_exception_throw + 273 2 CoreFoundation 0x93890455 +[NSException raise:format:] + 101 3 AppKit 0x913a7f5b NSNewBitmapBackingStore + 229 4 AppKit 0x915385c7 -[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] + 167 5 AppKit 0x913a7d41 __79-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke + 205 6 AppKit 0x913a77c9 -[NSBitmapImageRep _performBlockUsingBacking:] + 39 7 AppKit 0x913a7c6d -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] + 85 8 AppKit 0x913a7bf8 __57-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke + 104 9 AppKit 0x913a77c9 -[NSBitmapImageRep _performBlockUsingBacking:] + 39 10 AppKit 0x913a7b89 -[NSBitmapImageRep _performBlockUsingBackingMutableData:] + 85 11 AppKit 0x913a7b2d -[NSBitmapImageRep getBitmapDataPlanes:] + 85 12 AppKit 0x913a7abd -[NSBitmapImageRep bitmapData] + 47 13 AppKit 0x914a6e4b -[NSBitmapGraphicsContext _initWithBitmapImageRep:] + 280 14 AppKit 0x914a6d1c +[NSGraphicsContext graphicsContextWithBitmapImageRep:] + 71 15 AppKit 0x914a3530 +[_NSAutomaticFocusRing showForView:] + 2138 16 AppKit 0x914b0173 +[_NSAutomaticFocusRing updateIfNeeded] + 100 17 AppKit 0x91bfeab9 -[NSView _oldDisplayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 186 18 AppKit 0x914b007b -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 119 19 AppKit 0x914ac604 -[NSView displayIfNeeded] + 1347 20 AppKit 0x914ac048 -[NSWindow displayIfNeeded] + 403 21 AppKit 0x91c2ede7 ___NSWindowGetDisplayCycleObserver_block_invoke.5988 + 371 22 AppKit 0x914ab898 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke + 188 23 QuartzCore 0x9c16c5a1 _ZN2CA11Transaction19run_commit_handlersE18CATransactionPhase + 45 24 QuartzCore 0x9c16b0e8 _ZN2CA11Transaction6commitEv + 184 25 AppKit 0x91c51b66 __65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke + 465 26 CoreFoundation 0x9379a786 _runLoopObserverWithBlockContext + 22 27 CoreFoundation 0x9379a496 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 22 28 CoreFoundation 0x9379a3b2 __CFRunLoopDoObservers + 498 29 CoreFoundation 0x9377d7fd __CFRunLoopRun + 1661 30 CoreFoundation 0x9377ce51 CFRunLoopRunSpecific + 641 31 CoreFoundation 0x9377cbba CFRunLoopRunInMode + 122 32 HIToolbox 0x92d7a37b RunCurrentEventLoopInMode + 321 33 HIToolbox 0x92d79f5f ReceiveNextEventCommon + 454 34 HIToolbox 0x92d79d7b _BlockUntilNextEventMatchingListInModeWithFilter + 71 35 AppKit 0x9137ab2d _DPSNextEvent + 2101 36 AppKit 0x91aece90 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2859 37 AppKit 0x91aec35d -[NSApplication(NSEvent) nextEventMatchingMask:untilDate:inMode:dequeue:] + 134 38 XojoFramework 0x069e1787 _Z29CocoaFinishApplicationStartupv + 2288 39 XojoFramework 0x069e17d0 _Z29CocoaFinishApplicationStartupv + 2361 40 Lightwright 6 0x001e5e3f Delegate.Invoke%% + 34 41 Lightwright 6 0x00096eb7 Application._CallFunctionWithExceptionHandling%%o<Application>p + 248 42 XojoFramework 0x06b63471 _Z33CallFunctionWithExceptionHandlingPFvvE + 312 43 XojoFramework 0x069e1726 _Z29CocoaFinishApplicationStartupv + 2191 44 AppKit 0x9136fa7d -[NSApplication run] + 763 45 XojoFramework 0x06b6351a _Z8mainloopv + 46 46 XojoFramework 0x06b61628 RuntimeRun + 49 47 Lightwright 6 0x001b0d95 REALbasic._RuntimeRun + 34 48 Lightwright 6 0x06179c30 _Main + 295 49 Lightwright 6 0x06171931 main + 36 50 Lightwright 6 0x061c1595 start + 53[/quote]
51 ??? 0x00000002 0x0 + 2
[/code]

Is this 32bit? You got a problem with memory:

Crashing on exception: NSImage: Insufficient memory to allocate pixel data buffer of 6809088 bytes

Yes, it’s 32 bit. However, the biggest canvas (which is what we’re making a picture for) is just slightly less than the size of the screen, which should’t be too much. I have no idea where the 6809088 byte size is coming from. Other than the big-window graphics, the standard internal size for all other graphics is no more than 300x300 at 72dpi.

Also, this never happens on Sierra or older, frequently on High Sierra. Has something changed in terms of memory allocation for pictures?

It’s happening in the internal functions for managing the window layers, my theory is crappy graphics drivers, which have plagued High Sierra.

It’s possible that somewhere in your application, you’re doing something wrong, but I don’t see what it could be here.