Toxic Search Control in Xojo 2021 R1

I had a customer report this week saying that that Lightwright crashes whenever they click a button on a specific window. I tried it here, and yes, clicking any button on that one particular window caused a hard crash, instantaneous, and no way to step through it. This was built with the latest Xojo 2021 R1, and it happened both on the compiled app and also when running in the IDE. The customer was running Big Sur, I’m on Catalina.

Here’s a snippet of the crash report:

Process: Lightwright 6.debug [61572]
Path: /Users/USER/*/Lightwright 6.debug.app/Contents/MacOS/Lightwright 6.debug
Identifier: com.mckernon.lightwright6
Version: 6.0.42.413 Beta (6.0.42.2.413)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Lightwright 6.debug [61572]
User ID: 501

Date/Time: 2021-04-06 19:23:41.253 -0400
OS Version: Mac OS X 10.15.7 (19H524)
Report Version: 12
Bridge OS Version: 5.2 (18P4346)
Anonymous UUID: 321506A2-D2C5-77A7-DE47-4C0C842C577C

Sleep/Wake UUID: 5AEBF613-9E3F-4246-BC89-16A48CD13592

Time Awake Since Boot: 1100000 seconds
Time Since Wake: 2500 seconds

System Integrity Protection: enabled

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000060
Exception Note: EXC_CORPSE_NOTIFY

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

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 XojoFramework 0x000000011383af1b FindObjectCode(RuntimeObject*, int) + 78
1 libSearchControl.dylib 0x0000000115641e34 0x11563d000 + 20020
2 libdispatch.dylib 0x00007fff6a99f6c4 _dispatch_call_block_and_release + 12
3 libdispatch.dylib 0x00007fff6a9a0658 _dispatch_client_callout + 8
4 libdispatch.dylib 0x00007fff6a9abcab _dispatch_main_queue_callback_4CF + 936
5 com.apple.CoreFoundation 0x00007fff30951e81 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
6 com.apple.CoreFoundation 0x00007fff30911c87 __CFRunLoopRun + 2028
7 com.apple.CoreFoundation 0x00007fff30910e3e CFRunLoopRunSpecific + 462
8 com.apple.HIToolbox 0x00007fff2f53dabd RunCurrentEventLoopInMode + 292
9 com.apple.HIToolbox 0x00007fff2f53d7d5 ReceiveNextEventCommon + 584
10 com.apple.HIToolbox 0x00007fff2f53d579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
11 com.apple.AppKit 0x00007fff2db83039 _DPSNextEvent + 883
12 com.apple.AppKit 0x00007fff2db81880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
13 XojoFramework 0x000000011374d792 0x11365f000 + 976786
14 XojoFramework 0x000000011374d7d6 0x11365f000 + 976854
15 Lightwright 6.debug 0x0000000108c17535 Application._CallFunctionWithExceptionHandling%%op + 181
16 XojoFramework 0x00000001138d03e8 CallFunctionWithExceptionHandling(void (*)()) + 254
17 XojoFramework 0x000000011374d73f 0x11365f000 + 976703
18 com.apple.AppKit 0x00007fff2db7358e -[NSApplication run] + 658
19 XojoFramework 0x00000001138ced32 RuntimeRun + 41
20 Lightwright 6.debug 0x0000000108d15493 REALbasic._RuntimeRun + 19
21 Lightwright 6.debug 0x0000000112a3af0e _Main + 846 (/#main:7318)
22 Lightwright 6.debug 0x00000001129fc1d3 main + 19
23 libdyld.dylib 0x00007fff6a9f9cc9 start + 1

This line caught my attention: libSearchControl.dylib

The app uses Xojo’s search control in the problem window. I deleted the search control from the window and replaced it with the Einhugur search control. Bingo! No crashing. Hooray!

I’m hoping to create a reproducible small app so I can file a bug report, but in the meantime, if you run into strange crashes and are using the Xojo search control, try what I did.

2 Likes

Hi @John_McKernon

We are aware of that, and has been fixed already (related with this case: <https://xojo.com/issue/64308>).

Thank you for your feedback!

1 Like

That’s GREAT, thank you!

Oh, no! Thanks to you @John_McKernon ! (and sorry for the inconvenience).