2015R4 debug app crashes on embedwithin

I’m testing an established application with 2015r4, and the app (debug and build) crashes on a call to ContainerControl.EmbedWithin. The code debugs and builds without issues on 2015r3.1 and prior.

The code does not crash when running in a Windows 7 VM, but does on my OSX 10.9.5 dev box.

The code that causes the crash is:

CurrentContainer.EmbedWithin(DataCanvas, 0, 0, cWidth, cHeight)

cWidth and cHeight are always non-zero if that makes any difference. A snippet of the crash report is below.

Has anyone experienced similar issues with EmbedWithin on R4? I’m using a few Einhugur plugins, 2 GrafittiSuite plugins, and FG SourceList. Could these be causing the crash?

Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000048 VM Regions Near 0x48: --> __PAGEZERO 0000000000000000-0000000000001000 [ 4K] ---/--- SM=NUL Users/USER/Documents/*/Teq42.debug.app/Contents/MacOS/Teq42.debug __TEXT 0000000000001000-00000000003b0000 [ 3772K] r-x/rwx SM=COW /Users/USER/Documents/*/Teq42.debug.app/Contents/MacOS/Teq42.debug

Post the backtrace part for the thread that crashes (or link to an image of it or text file with it). It starts with: Thread 0 Crashed: …

Here’s the backtrace:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.CoreGraphics        	0x9b982312 CGAccessSessionGetChunks + 86
1   com.apple.CoreGraphics        	0x9b981a1b img_raw_read + 544
2   com.apple.CoreGraphics        	0x9b96a217 img_data_lock + 7337
3   com.apple.CoreGraphics        	0x9b96765c CGSImageDataLock + 124
4   libRIP.A.dylib                	0x0a981bcc ripc_AcquireImage + 151
5   libRIP.A.dylib                	0x0a980cb0 ripc_DrawImage + 912
6   com.apple.CoreGraphics        	0x9b96726c CGContextDrawImage + 429
7   com.xojo.XojoFramework        	0x00447556 0x437000 + 66902
8   com.xojo.XojoFramework        	0x005380c7 0x437000 + 1052871
9   com.xojo.XojoFramework        	0x0053ef4a 0x437000 + 1081162
10  com.xojo.XojoFramework        	0x005d2302 RuntimeGraphicsDrawPicture + 451
11  com.tannertechnical.teq42     	0x000873d8 Graphics.DrawPicture%%o<Graphics>o<Picture>i4i4i4i4i4i4i4i4 + 132
12  com.tannertechnical.teq42     	0x0032eb7f KTBStyleXP.ButtonNormal%%o<KTBStyleXP>o<Graphics>o<KTBButton>o<KillerToolBar> + 923
13  com.tannertechnical.teq42     	0x0031c780 KTBButton.PaintButton%%o<KTBButton>o<Graphics> + 1812
14  com.tannertechnical.teq42     	0x002edce4 KillerToolBar.DrawButtonsPaint%%o<KillerToolBar>o<KTBButton> + 240
15  com.tannertechnical.teq42     	0x00301b1d KillerToolBar.PrepareButtons%o<Picture>%o<KillerToolBar>i4i4i4i4 + 2323
16  com.tannertechnical.teq42     	0x002e605a KillerToolBar.Event_Paint%%o<KillerToolBar>o<Graphics>A1o<REALbasic.Rect> + 1612
17  com.xojo.XojoFramework        	0x004faa9f 0x437000 + 801439
18  com.xojo.XojoFramework        	0x0048cf65 0x437000 + 352101
19  com.xojo.XojoFramework        	0x0048821d 0x437000 + 332317
20  com.apple.AppKit              	0x91e74298 -[NSView _drawRect:clip:] + 3816
21  com.apple.AppKit              	0x91e72ccf -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1829
22  com.apple.AppKit              	0x91e72ffc -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2642
23  com.apple.AppKit              	0x91e72ffc -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2642
24  com.apple.AppKit              	0x91e71278 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 1264
25  com.apple.AppKit              	0x91e6dc57 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 3645
26  com.apple.AppKit              	0x91e4b72c -[NSView displayIfNeeded] + 1414
27  com.apple.AppKit              	0x91fadf92 -[NSView display] + 117
28  com.xojo.XojoFramework        	0x0048bbe0 0x437000 + 347104
29  com.xojo.XojoFramework        	0x00450017 0x437000 + 102423
30  com.xojo.XojoFramework        	0x0061ce7b 0x437000 + 1990267
31  com.xojo.XojoFramework        	0x0061cdad 0x437000 + 1990061
32  com.xojo.XojoFramework        	0x00575645 RuntimeControlRefresh + 81
33  com.tannertechnical.teq42     	0x000555c3 RectControl.Refresh%%o<RectControl>b + 59
34  com.tannertechnical.teq42     	0x00313649 KillerToolBar.Update%%o<KillerToolBar> + 37398
35  com.tannertechnical.teq42     	0x002b8152 ccAccount.ccAccount.Event_Open%%o<ccAccount.ccAccount> + 7922
36  com.tannertechnical.teq42     	0x0015084a ContainerControl_TT.Event_Open%%o<ContainerControl_TT> + 96
37  com.xojo.XojoFramework        	0x005f0169 FireWindowOpenEvents + 228
38  com.xojo.XojoFramework        	0x00502ee7 EmbedWithinInternal + 1415
39  com.xojo.XojoFramework        	0x005028e0 EmbedWithinControl + 375
40  com.tannertechnical.teq42     	0x00058832 ContainerControl.EmbedWithin%%o<ContainerControl>o<RectControl>i4i4i4i4 + 96
41  com.tannertechnical.teq42     	0x001b3079 MainWindow.MainWindow.SourceList_SelectedItem%%o<MainWindow.MainWindow>o<FGSourceList>o<FGSourceListItem> + 7934
42  com.tannertechnical.teq42     	0x001a9f1f Delegate.IM_Invoke%%o<FGSourceList>o<FGSourceListItem> + 93
43  com.tannertechnical.teq42     	0x001a9f6b AddHandler.Stub.55%%o<FGSourceListItem> + 64
44  com.tannertechnical.teq42     	0x00168148 FGSourceList.Event_CellClick%b%o<FGSourceList>i4i4i4i4 + 12940
45  com.xojo.XojoFramework        	0x0058e718 0x437000 + 1406744
46  com.xojo.XojoFramework        	0x0058f068 0x437000 + 1409128
47  com.xojo.XojoFramework        	0x0058f13a 0x437000 + 1409338
48  com.xojo.XojoFramework        	0x00555f81 0x437000 + 1175425
49  com.xojo.XojoFramework        	0x0058e351 0x437000 + 1405777
50  com.xojo.XojoFramework        	0x0048c3af 0x437000 + 349103
51  com.xojo.XojoFramework        	0x0048714c 0x437000 + 328012
52  com.apple.AppKit              	0x91f1ea9d -[NSWindow sendEvent:] + 11953
53  com.xojo.XojoFramework        	0x00488628 0x437000 + 333352
54  com.apple.AppKit              	0x91eba91d -[NSApplication sendEvent:] + 4034
55  com.xojo.XojoFramework        	0x004773a3 0x437000 + 263075
56  com.xojo.XojoFramework        	0x004773e4 0x437000 + 263140
57  com.tannertechnical.teq42     	0x000ea4b8 Delegate.Invoke%% + 34
58  com.tannertechnical.teq42     	0x0004bd7b Application._CallFunctionWithExceptionHandling%%o<Application>p + 248
59  com.xojo.XojoFramework        	0x005dbf33 0x437000 + 1724211
60  com.xojo.XojoFramework        	0x00477312 0x437000 + 262930
61  com.apple.AppKit              	0x91cff1bc -[NSApplication run] + 823
62  com.xojo.XojoFramework        	0x005dbfd9 0x437000 + 1724377
63  com.xojo.XojoFramework        	0x005da1ac RuntimeRun + 49
64  com.tannertechnical.teq42     	0x000c551f REALbasic._RuntimeRun + 34
65  com.tannertechnical.teq42     	0x0037c58e _Main + 257
66  com.tannertechnical.teq42     	0x003785f4 main + 36
67  com.tannertechnical.teq42     	0x0038114c start + 53

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib        	0x9968f992 kevent64 + 10
1   libdispatch.dylib             	0x90c44899 _dispatch_mgr_invoke + 238
2   libdispatch.dylib             	0x90c44532 _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib        	0x9968f046 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x95f97dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib       	0x95f9bcce start_wqthread + 30

Thread 3:
0   libsystem_kernel.dylib        	0x9968f046 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x95f97dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib       	0x95f9bcce start_wqthread + 30

Thread 4:
0   libsystem_kernel.dylib        	0x9968f046 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x95f97dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib       	0x95f9bcce start_wqthread + 30

Thread 5:
0   libsystem_kernel.dylib        	0x99689f7a mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x9968916c mach_msg + 68
2   com.apple.CoreFoundation      	0x932a9bf9 __CFRunLoopServiceMachPort + 169
3   com.apple.CoreFoundation      	0x932a91d1 __CFRunLoopRun + 1393
4   com.apple.CoreFoundation      	0x932a89ea CFRunLoopRunSpecific + 394
5   com.apple.CoreFoundation      	0x932a884b CFRunLoopRunInMode + 123
6   com.apple.AppKit              	0x91eb6b88 _NSEventThread + 283
7   libsystem_pthread.dylib       	0x95f965fb _pthread_body + 144
8   libsystem_pthread.dylib       	0x95f96485 _pthread_start + 130
9   libsystem_pthread.dylib       	0x95f9bcf2 thread_start + 34

Thread 6:: com.apple.appkit-heartbeat
0   libsystem_kernel.dylib        	0x9968eb76 __semwait_signal + 10
1   libsystem_c.dylib             	0x9a5bcf9f nanosleep$UNIX2003 + 219
2   libsystem_c.dylib             	0x9a5bce4a usleep$UNIX2003 + 60
3   com.apple.AppKit              	0x91f81a4c -[NSUIHeartBeat _heartBeatThread:] + 2318
4   com.apple.Foundation          	0x981cb16e -[NSThread main] + 45
5   com.apple.Foundation          	0x981cb0c6 __NSThread__main__ + 1426
6   libsystem_pthread.dylib       	0x95f965fb _pthread_body + 144
7   libsystem_pthread.dylib       	0x95f96485 _pthread_start + 130
8   libsystem_pthread.dylib       	0x95f9bcf2 thread_start + 34

Thread 7:
0   libsystem_kernel.dylib        	0x9968f046 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x95f97dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib       	0x95f9bcce start_wqthread + 30

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x9b9822ca  ebx: 0x00000000  ecx: 0x00000040  edx: 0x0248a2a0
  edi: 0x00000040  esi: 0x00000400  ebp: 0xbfffa7a8  esp: 0xbfffa750
   ss: 0x00000023  efl: 0x00010246  eip: 0x9b982312   cs: 0x0000001b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000000   gs: 0x0000000f
  cr2: 0x00000048
  
Logical CPU:     6
Error Code:      0x00000004
Trap Number:     14

2015R4 crashes on may rig too (OSX) but I am not sure if it has to do with EmbedWithin. R2015R3 worked fine
I am iterating over a directory using xojo.io.folderitem and adding those objects
to custom control which embeds little containers showing the path/file name.
Using a classic fodleritem prevents the app from crashing - hmm wired.
https://forum.xojo.com/28738-xojo-2015r4-is-crashing-when-using-xojo-io-folderitem-iterator/0#p236388

To follow up, I’ve traced the crash to the presence of a GrafittiSuite KillerToolbar control on the embedded container control. I’ve removed it and will work up an alternative.