Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 3079 [details]
1) export DYLD_IMAGE_SUFFIX=_debug
2) Run a mono application (like MonoDevelop)
3) See stacktrace file attached
This seems to happen if the app loads the non-debug version of libc.dylib:
void main ()
pthread_key_create (&t, NULL);
pthread_setspecific (t, 1);
dlopen ("libc.dylib", RTLD_GLOBAL|RTLD_LAZY);
printf ("%p\n", pthread_getspecific (t));
This program should print '0x1', but when run with DYLD_IMAGE_SUFFIX=_debug, it prints '0x0'. The debug
A workaround is making a copy of just the libraries you need with a unique suffix, and setting DYLD_IMAGE_SUFFIX to this suffix.
Exporting "_debug" is the macos recommended way of loading the debug libraries. This does seem like something which isn't our fault based on your diagnosis there, but how is this supposed to work? Am i simply missing the debug variants of some libraries?
It seems the problem is that the debug version of libc is already loaded, and when the non-debug version is loaded, it nulls out the values of thread-local variables, leading to the crash. So I don't think this is a mono bug.
This is an OSX limitation and not runtime related.