Bug 42271 - COOP: gc unsafe mode when printing native backtrace causes crash if GC is triggered
Summary: COOP: gc unsafe mode when printing native backtrace causes crash if GC is tri...
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Aleksey Kliger
URL:
Depends on:
Blocks: 41745
  Show dependency tree
 
Reported: 2016-06-30 09:56 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2016-10-11 15:23 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Rolf Bjarne Kvinge [MSFT] 2016-06-30 09:56:36 UTC
STATE CUE CARD: (? means a positive number, usually 1 or 2, * means any number)
	0x0	- starting (GOOD, unless the thread is running managed code)
	0x1	- running (BAD, unless it's the gc thread)
	0x2	- detached (GOOD, unless the thread is running managed code)
	0x?03	- async suspended (GOOD)
	0x?04	- self suspended (GOOD)
	0x?05	- async suspend requested (BAD)
	0x?06	- self suspend requested (BAD)
	0x*07	- blocking (GOOD)
	0x?08	- blocking with pending suspend (GOOD)
--thread 0x18679a00 id 0x1f084000 [0x710b] (tid_710b) state 107  
--thread 0x182c9800 id 0x1f124000 [0x1303] (tid_1303) state 107  
--thread 0x183b8800 id 0x1f1ac000 [0x200b] (tid_200b) state 107  
--thread 0x18143c00 id 0x1f344000 [0x3603] (tid_3603) state 107  
--thread 0x181db400 id 0x1f3f4000 [0x370b] (tid_370b) state 7  
--thread 0x181e2600 id 0x1f4fc000 [0x3313] (Threadpool worker) state 105  
--thread 0x1810f000 id 0x1f604000 [0x3d0f] (Threadpool worker) state 105  
--thread 0x1913c400 id 0x1f70c000 [0x30cb] (Threadpool worker) state 7  
--thread 0x18331600 id 0x1f814000 [0x3f0f] (Timer-Scheduler) state 107  
--thread 0x180e1a00 id 0x30be4000 [0xf07] (tid_f07) state 1  GC INITIATOR

WAITING for 2 threads, got 0 suspended
(lldb) bt
* thread #11: tid = 0x36744, 0x1fe95992 dyld`ImageLoaderMachO::findClosestSymbol(mach_header const*, void const*, void const**) + 338, name = 'Threadpool worker'
  * frame #0: 0x1fe95992 dyld`ImageLoaderMachO::findClosestSymbol(mach_header const*, void const*, void const**) + 338
    frame #1: 0x1fe8d124 dyld`dladdr + 116
    frame #2: 0x2071aa66 libdyld.dylib`dladdr + 58
    frame #3: 0x20759052 libsystem_c.dylib`backtrace_symbols + 62
    frame #4: 0x000ce600 SystemTests`mono_exception_get_native_backtrace(exc=<unavailable>) + 66 at exception.c:974 [opt]
    frame #5: 0x000f6d96 SystemTests`mono_print_unhandled_exception(exc=0x049ab528) + 38 at object.c:7829 [opt]
    frame #6: 0x000f6d02 SystemTests`mono_unhandled_exception(exc=<unavailable>) + 224 at object.c:4661 [opt]
    frame #7: 0x00117098 SystemTests`mono_thread_internal_unhandled_exception(exc=0x049ab528) + 98 at threads.c:5063 [opt]
    frame #8: 0x00111fba SystemTests`worker_thread(data=<unavailable>) + 1400 at threadpool-ms.c:663 [opt]
    frame #9: 0x001173b2 SystemTests`start_wrapper [inlined] start_wrapper_internal + 374 at threads.c:741 [opt]
    frame #10: 0x0011723c SystemTests`start_wrapper(data=<unavailable>) + 18 at threads.c:789 [opt]
    frame #11: 0x00151d4e SystemTests`inner_start_thread(arg=<unavailable>) + 314 at mono-threads-posix.c:95 [opt]
    frame #12: 0x208b3798 libsystem_pthread.dylib`_pthread_body + 136
    frame #13: 0x208b370e libsystem_pthread.dylib`_pthread_start + 114
    frame #14: 0x208b16a8 libsystem_pthread.dylib`thread_start + 12
(lldb) p (void *) mono_thread_info_current ()->thread_state
(void *) $0 = 0x00000105
Comment 1 Aleksey Kliger 2016-10-11 15:23:23 UTC
Fixed on mono master with commit a4c8184708bcc4fbd1285a20f6e24785f93c4c52
Fixed on mono-4.8.0-branch with commit 9bd0647bba7109f2ba6403eb82840f8f51878d61

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.


Create a new report for Bug 42271 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments


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.

Related Links: