Crash on Drag - High Sierra?

I have a user running MacOS 10.13.3, and he recently reported my app (Lightwright) crashing. The code is really trivial:


The DragObject isn’t nil, and has PrivateRowData that’s a very short string.

The app is built in Xojo 2016r3 because I haven’t been able to rewrite my code for 2017R3’s new graphics paradigms.

I have a horrible feeling it’s another High Sierra headache, but here’s the system crash log - if anyone could give this a quick look and tell me whether it’s Lightwright’s fault, or HS’s, I’d really appreciate it.


Process: Lightwright 6 [11078]
Path: /Applications/Lightwright 6
Identifier: com.mckernon.lightwright6
Version: 6.0.16 beta build 179 (
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: Lightwright 6 [11078]
User ID: 501

Date/Time: 2018-02-11 14:26:22.408 -0500
OS Version: Mac OS X 10.13.3 (17D47)
Report Version: 12
Bridge OS Version: 3.0 (14Y661)
Anonymous UUID: 12B5A55F-0E19-0C19-B9A9-0D1639F3C144

Sleep/Wake UUID: F5A31708-E8BE-44C6-87C9-2535FF0F5992

Time Awake Since Boot: 380000 seconds
Time Since Wake: 400 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue:

Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000021

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

VM Regions Near 0x21:
__TEXT 0000000000001000-0000000006034000 [ 96.2M] r-x/rwx SM=COW /Applications/Lightwright 6

Application Specific Information:
objc_msgSend() selector name: unlock

Thread 0 Crashed:: Dispatch queue:
0 libobjc.A.dylib 0xa6af1163 objc_msgSend + 19
1 0x93a5e069 __raiseError + 345
2 libobjc.A.dylib 0xa6afb346 objc_exception_throw + 273
3 0x93a5dee5 +[NSException raise:format:] + 101
4 0x9139f047 NSNewBitmapBackingStore + 229
5 0x9139ee7e __79-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke + 286
6 0x9139e8b5 -[NSBitmapImageRep _performBlockUsingBacking:] + 39
7 0x9139ed59 -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] + 85
8 0x9139ece4 __57-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke + 104
9 0x9139e8b5 -[NSBitmapImageRep _performBlockUsingBacking:] + 39
10 0x9139ec75 -[NSBitmapImageRep _performBlockUsingBackingMutableData:] + 85
11 0x9139ec19 -[NSBitmapImageRep getBitmapDataPlanes:] + 85
12 0x9139eba9 -[NSBitmapImageRep bitmapData] + 47
13 0x9149dedc -[NSBitmapGraphicsContext _initWithBitmapImageRep:] + 280
14 0x9149ddad +[NSGraphicsContext graphicsContextWithBitmapImageRep:] + 71
15 com.xojo.XojoFramework 0x0654daeb 0x653f000 + 60139
16 com.mckernon.lightwright6 0x00007b02 DragItem.Drag%%o + 42
17 com.mckernon.lightwright6 0x03baf42c Display4.DoColumnDrag%%o<DisplayWnd.DisplayWnd> + 6616
18 com.mckernon.lightwright6 0x004c50df DisplayWnd.DisplayWnd.SelCanvas_MouseDrag%%o<DisplayWnd.DisplayWnd>oi4i4 + 3893
19 com.mckernon.lightwright6 0x0080363d Delegate.IM_Invoke%%oi4i4 + 103
20 com.mckernon.lightwright6 0x008036e9 AddHandler.Stub.22%%i4i4 + 74
21 com.xojo.XojoFramework 0x066029c8 0x653f000 + 801224
22 com.xojo.XojoFramework 0x065950d1 0x653f000 + 352465
23 com.xojo.XojoFramework 0x06590283 0x653f000 + 332419
24 0x91c0f21e -[NSWindow _handleMouseDraggedEvent:] + 35
25 0x91c86c63 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 6621
26 0x91c84ed4 -[NSWindow(NSEventRouting) sendEvent:] + 475
27 com.xojo.XojoFramework 0x0659135f 0x653f000 + 336735
28 0x91ae20be -[NSApplication(NSEvent) sendEvent:] + 2590
29 com.xojo.XojoFramework 0x065810e6 0x653f000 + 270566
30 0x91366c64 -[NSApplication run] + 838
31 com.xojo.XojoFramework 0x066edbba 0x653f000 + 1764282
32 com.xojo.XojoFramework 0x066ebd94 RuntimeRun + 49
33 com.mckernon.lightwright6 0x001637b8 REALbasic._RuntimeRun + 34
34 com.mckernon.lightwright6 0x05e4b2c0 _Main + 295
35 com.mckernon.lightwright6 0x05e42fc1 main + 36
36 com.mckernon.lightwright6 0x05e91cb9 start + 53

The drag image is crashing. Is this HiDPI? Have you tried to set an extra drag image?

No HiDPI, this is using Xojo 2016r3, which pre-dates the new HiDPI support.

The code is simple:

WhichWnd.DragObject=new DragItem(WhichWnd, L,T,Wid,Ht)

And just this morning I had a report from another user with the same problem, also on High Sierra.

Even in 2016r3 I was able to add HiDPI support. Just the direct support in Xojo was missing.

Please try a newer version of Xojo or a drag image.

I added HiDPI support by tweaking the package, yes. I can’t use the current version of Xojo without a mountain of refactoring because one of the plugins I use won’t work with 2017R3 (and can’t be fixed).

I’ll try adding a drag image, but it’s going to be slightly weird, just a rectangle. Hopefully it can be transparent!

Thank you!

Are your drag image’s width and height sizes a multiple of 4? This has been the big fix for my apps when they throw an error similar to what your crash report shows.

It’s entirely possible they’re not, because they’re based on the size of the column that is being dragged. That’s pretty easy to fix.

Does this mean that all images, everywhere in the app, no matter what the source, need to be a multiple of 4? Things like pictures that users add to a database and are later drawn in canvases, etc? I thought the x4 only applied to icons.

I went the safe route and made all of mine /4, but all of my images are built in. I’m not sure how to deal with user data and that could be why we’re seeing crashes in apps like FCP X, PP, Media Composer, and similar as well as Apple Mail with images attached to emails.

Lovely…:frowning: Hopefully Apple will get around to fixing this sooner rather than later, in the meantime I’ll see what I can do to resize all incoming (and existing) user data.