Crash, but only in release version


John Brownie
 

I am getting a crash, but only in the release version. I get a very helpful "Error 1" if I try to debug the release version, and logging doesn't get me anything, as the crash prevents the log entry from appearing (I think).

Anyway, the crash is in CFURLCreateWithFileSystemPath, where it's calling length, and I get crash reports like the following:

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

VM Regions Near 0x3eaddd9f4338:
    MALLOC_LARGE_REUSABLE  0000000113885000-0000000114085000 [ 8192K] rw-/rwx SM=PRV
-->
    MALLOC_NANO            0000600000000000-0000600008000000 [128.0M] rw-/rwx SM=PRV

Application Specific Information:
objc_msgSend() selector name: length


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                   0x00007fff6e14381d objc_msgSend + 29
1   com.apple.CoreFoundation          0x00007fff3544dfb5 _CFURLCreateWithFileSystemPath + 67

The VM Regions list can vary a bit, but it's always the same stack trace and signal.

It looks a bit weird that a Core Foundation function is trying to call an Objective-C method. Ironically, this crash is triggered when I'm attempting to show the user an error message, and the upstream call is essentially a call to get a localized version of a string.

Any pointers on how to debug this? How to get the debugger to connect with the release version? Or how to work out what is different between the release and debug versions that might be forcing the error?

Thanks,
John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland

Join cocoa@apple-dev.groups.io to automatically receive all group messages.