[erlang-questions] Trace/BPT trap on OS X when loading linked-in driver

Max Lapshin max.lapshin@REDACTED
Tue Jun 21 19:54:36 CEST 2011


I've written linked-in driver for capturing sound with portaudio library.
When I load it, erlang exits with Trace/BPT trap message.

The following stacktrace in gdb:

#0  0x00007fff88d1f570 in __CFInitialize ()
#1  0x00007fff5fc0d5ce in
__dyld__ZN16ImageLoaderMachO11doImageInitERKN11ImageLoader11LinkContextE
()
#2  0x00007fff5fc0d607 in
__dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
()
#3  0x00007fff5fc0bcec in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj
()
...


This happens because it is loading in non-main thread and CFInitialize
_must_ be called in main thread.

http://openradar.appspot.com/7209349

Is there any way to order erlang to load driver in main thread? Or
maybe there is some way to do workaround with some DYLD environment
variables?



More information about the erlang-questions mailing list