0

I'm developing a SDK for iOS and i put some assert() in the code to help me catching the bugs. It's working great when using the simulator but if I build my App (Debug-iphoneos) on a device, unplug it from my mac and leave it for testing, the crash log I get from an assertion failure is impossible to understand. real sample from a basic nil assertion failure:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread:  0

Filtered syslog:
None found

Global Trace Buffer (reverse chronological seconds):
10.153264    CFNetwork                  0x0000000021bb897d TCP Conn 0x14dbd8c0 complete. fd: 9, err: 0
10.154690    CFNetwork                  0x0000000021bb9a7f TCP Conn 0x14dbd8c0 event 1. err: 0
10.288093    CFNetwork                  0x0000000021bb9afd TCP Conn 0x14dbd8c0 started
10.293561    CFNetwork                  0x0000000021bff26f Creating default cookie storage with default identifier
10.293562    CFNetwork                  0x0000000021bff24b Faulting in CFHTTPCookieStorage singleton
10.293562    CFNetwork                  0x0000000021c418f7 Faulting in NSHTTPCookieStorage singleton
10.514965    CFNetwork                  0x0000000021bb897d TCP Conn 0x14d88140 complete. fd: 4, err: 0
10.514965    CFNetwork                  0x0000000021bb9a7f TCP Conn 0x14d88140 event 1. err: 0
10.789507    CFNetwork                  0x0000000021bb9afd TCP Conn 0x14d88140 started



Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib              0x00509e10 0x3af000 + 1420816
1   MyFramework                     0x002ddfec 0x24f000 + 585708

Any chance I can get more information from the crash log ? I tried atos -arch armv7 -o MyApp.app/MyApp 0x24f000 without any success (returning 0x24f000)

HaneTV
  • 916
  • 1
  • 7
  • 24
  • ... why don't you just keep your device plugged in and set a breakpoint at the assertion? – nhgrif Apr 13 '16 at 12:11
  • I'm not alone on the project, and there are 3 active testers – HaneTV Apr 13 '16 at 12:13
  • I'd recommend a couple things then... an assertion should be used for something you expect to never be true, so I'd start with some analysis on how your assumption was wrong. Next, add some logging (and a proper logging library like CocoaLumberjack is helpful). Next, add some proper crash tracking tools like Crashlytics. And finally, worse case scenario, for debugging purposes, change your assertions to fatalErrors which should be better for putting stack traces in crash logs. – nhgrif Apr 13 '16 at 12:19

1 Answers1

0

Solved with this post Atos does not symbolicate system frameworks/libraries properly

here I had to extract my framework from the .app and do

xcrun atos -arch armv7 -o  MyFramework.framework/MyFramework -l 0x24f000 0x002ddfec

(notice the reverse order of memory adresses)

Community
  • 1
  • 1
HaneTV
  • 916
  • 1
  • 7
  • 24