I have a dylib that I created in PB. It is a simple dylib with a single exported function. The definition is:
Code: Select all
ProcedureCDLL doTTTest()
Code: Select all
PrototypeC pCall()
Procedure btnDoneClick(ev.i)
f.s = sbString::folderResources() + "TTest.dylib"
If OpenLibrary(0, f)
callTTest.pCall = GetFunction(0, "doTTTest")
callTTest() <---- CRASH HERE
CloseLibrary(0)
EndIf
EndProcedure
Code: Select all
Process: containercontrol [3860]
Path: /Users/USER/Downloads/*/containercontrol.app/Contents/MacOS/containercontrol
Identifier: com.simcarsoftware.containercontrol
Version: 0.1 (0.1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: containercontrol [3860]
User ID: 501
Date/Time: 2018-09-01 12:22:34.600 +0100
OS Version: Mac OS X 10.12.6 (16G1510)
Report Version: 12
Anonymous UUID: 555690B2-41E7-73B2-7E87-EA9AEAB6D6B1
Time Awake Since Boot: 2300000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace OBJC, Code 0x1
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fffcf6d40aa __abort_with_payload + 10
1 libsystem_kernel.dylib 0x00007fffcf6d0326 abort_with_payload_wrapper_internal + 90
2 libsystem_kernel.dylib 0x00007fffcf6d02cc abort_with_reason + 22
3 libobjc.A.dylib 0x00007fffcecc6e1b _objc_fatalv(unsigned long long, unsigned long long, char const*, __va_list_tag*) + 102
4 libobjc.A.dylib 0x00007fffcecc6cc6 _objc_fatal(char const*, ...) + 146
5 libobjc.A.dylib 0x00007fffcecd1e78 (anonymous namespace)::AutoreleasePoolPage::busted(bool) + 144
6 libobjc.A.dylib 0x00007fffcecba078 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 80
7 com.apple.CoreFoundation 0x00007fffb9994b86 _CFAutoreleasePoolPop + 22
8 com.apple.Foundation 0x00007fffbb404e90 -[NSAutoreleasePool release] + 146
9 TTest.dylib 0x0000000109bd4a3d 0x109bd1000 + 14909
10 TTest.dylib 0x0000000109bd5e79 0x109bd1000 + 20089
11 TTest.dylib 0x0000000109bd60de 0x109bd1000 + 20702
12 TTest.dylib 0x0000000109bd25d5 0x109bd1000 + 5589
I am at a loss to understand what has happened and why. I have tried compiling the dylib with thread safe on and off. I have tried with ProcedureDLL and Prototype and then with ProcedureCDLL and PrototypeC. Whatever I try I get exactly the same result.
It has to be something I have done - what?
Simon.