I’m getting a frustrating crash in a 32-bit Mac console app that I cannot reproduce outside my project.
I have a Xojo.Core.Dictionary property that was created by parsing JSON text. The dictionary has two items. When I use HasKey on a key that doesn’t exist, I crash (see partial log below).
The code is very simple:
dim dict as Xojo.Core.Dictionary = Claim // <-- Definitely not nil
dim key as auto = kKeyNotBefore // is "nbf" as Text
dim hasKey as boolean = dict.HasKey( key ) // <-- BOOM!
Any ideas before I file Feedback?
Process: dragonc.debug [80036]
Path: /Users/USER/Documents/*/dragonc.debug
Identifier: dragonc.debug
Version: ???
Code Type: X86 (Native)
Parent Process: bash [80005]
Responsible: dragonc.debug [80036]
User ID: 501
Date/Time: 2017-11-16 12:04:30.981 -0500
OS Version: Mac OS X 10.12.6 (16G1036)
Report Version: 12
Anonymous UUID: BCF7AA30-5988-FF2B-1E54-791B51FF135B
Sleep/Wake UUID: 4A7B4D87-9958-48C3-A018-9023942CA9F7
Time Awake Since Boot: 250000 seconds
Time Since Wake: 94000 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 0x0000000000000034
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
VM Regions Near 0x34:
-->
__TEXT 0000000000001000-0000000001100000 [ 17.0M] r-x/rwx SM=COW /Users/USER/Documents/*/*.debug
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 rbframework.dylib 0x01310678 ClassDeclBase::FindEventHandler(RuntimeObject*, EventDecl const&) + 88
1 rbframework.dylib 0x01414f5a AutoLessThan::operator()(RBAuto const&, RBAuto const&) const + 48
2 rbframework.dylib 0x0141677b 0x12d0000 + 1337211
3 rbframework.dylib 0x014150e5 Xojo_DictionaryContainsKey + 127
4 dragonc.debug 0x0001f966 Xojo.Core.Dictionary.HasKey%b%o<Xojo.Core.Dictionary>x + 52
5 dragonc.debug 0x007eb3b9 JSONWebToken_MTC.NotBeforeDate.Get%o<Xojo.Core.Date>%o<JSONWebToken_MTC>i4 + 346
6 dragonc.debug 0x007ea706 JSONWebToken_MTC.IsCurrent.Get%b%o<JSONWebToken_MTC>i4 + 445
7 dragonc.debug 0x009f9d44 JSONWebTokenTests.CreateTest%%o<JSONWebTokenTests> + 964
8 dragonc.debug 0x001111e4 Introspection.Invoke%% + 104
9 rbframework.dylib 0x0136456f Introspection_GenericInvoker + 121
10 dragonc.debug 0x0001b96e Xojo.Introspection.MethodInfo.Invoke%x%o<Xojo.Introspection.MethodInfo>o<Object>A1x + 1091
11 dragonc.debug 0x0001b452 Xojo.Introspection.MethodInfo.Invoke%%o<Xojo.Introspection.MethodInfo>o<Object>A1x + 134
12 dragonc.debug 0x001d7351 TestGroup.RunTestsTimer_Action%%o<TestGroup>o<Xojo.Core.Timer> + 4124
13 dragonc.debug 0x0018b986 Delegate.IM_Invoke%%o<Xojo.Core.Timer> + 83
14 dragonc.debug 0x0014ac32 AddHandler.Stub.0%% + 51
15 rbframework.dylib 0x012fa365 TimerImpCF::FireTimerAction() + 69
16 rbframework.dylib 0x012fa427 TimerImpCF::TimerCallback() + 89
17 rbframework.dylib 0x012fa31a 0x12d0000 + 172826
18 com.apple.CoreFoundation 0x9426c996 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
19 com.apple.CoreFoundation 0x9426c4ad __CFRunLoopDoTimer + 1213
20 com.apple.CoreFoundation 0x9426bf4e __CFRunLoopDoTimers + 350
21 com.apple.CoreFoundation 0x94263910 __CFRunLoopRun + 2192
22 com.apple.CoreFoundation 0x94262e1a CFRunLoopRunSpecific + 506
23 com.apple.CoreFoundation 0x94262c0b CFRunLoopRunInMode + 123
24 rbframework.dylib 0x013bf12f 0x12d0000 + 979247
25 rbframework.dylib 0x013bf0eb ModalEvents(unsigned char) + 36
26 rbframework.dylib 0x013d2295 RuntimeDoEvents + 18
27 dragonc.debug 0x00057cec ConsoleApplication.DoEvents%%o<ConsoleApplication>i4 + 44
28 dragonc.debug 0x0097f387 UnitTestApp.Event_Execute%i4%o<UnitTestApp>o<OptionParserModule.OptionParser> + 4844
29 dragonc.debug 0x00332108 SubApplication.Run%i4%o<SubApplication>o<OptionParserModule.OptionParser> + 174
30 dragonc.debug 0x002dfca6 App.LaunchSubApp%i4%o<App>A1s + 1794
31 dragonc.debug 0x002dac90 App.Event_Run%i4%o<App>A1s + 8072
32 rbframework.dylib 0x012efe87 CallConsoleApplicationRunEventHelper() + 374
33 dragonc.debug 0x001320d3 Delegate.Invoke%% + 34
34 dragonc.debug 0x00057f99 ConsoleApplication._CallFunctionWithExceptionHandling%%o<ConsoleApplication>p + 248
35 rbframework.dylib 0x013bf096 CallFunctionWithExceptionHandling(void (*)()) + 322
36 rbframework.dylib 0x0135c035 RuntimeRun + 58
37 dragonc.debug 0x0010febd REALbasic._RuntimeRun + 34
38 dragonc.debug 0x01058647 _Main + 295
39 dragonc.debug 0x01058090 main + 36
40 dragonc.debug 0x01060a6d start + 53