Bug 56694 - Assertion: should not be reached at d:\j\workspace\v\repos\mono\mono\sgen\sgen-scan-object.h:91
Summary: Assertion: should not be reached at d:\j\workspace\v\repos\mono\mono\sgen\sge...
Alias: None
Product: Runtime
Classification: Mono
Component: GC ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: 15.3
Assignee: Aleksey Kliger
Depends on:
Reported: 2017-05-19 23:57 UTC by Kirill Osenkov
Modified: 2018-03-26 18:34 UTC (History)
5 users (show)

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

Logs (870 bytes, application/octet-stream)
2017-07-14 06:50 UTC, Alok Kulkarni

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.

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.

Related Links:

Description Kirill Osenkov 2017-05-19 23:57:03 UTC
git clone https://github.com/KirillOsenkov/MonoRepro

Build and run the exe (at least on Windows)

C:\MonoRepro\CrashMono\bin\Debug>mono crashmono.exe
* Assertion: should not be reached at d:\j\workspace\v\repos\mono\mono\sgen\sgen-scan-object.h:91

Unhandled exception at 0x75B7543B (ucrtbase.dll) in mono.exe: Fatal program exit requested. occurred

>	abort Line 77	C++
 	mono_log_write_logfile Line 136	C
 	structured_log_adapter Line 432	C
 	monoeg_g_logv Line 116	C
 	monoeg_assertion_message Line 135	C
 	major_scan_object_no_evacuation Line 91	C
 	drain_gray_stack_no_evacuation Line 345	C
 	[Inline Frame] sgen_drain_gray_stack Line 515	C
 	finish_gray_stack Line 1065	C
 	major_finish_collection Line 2033	C
 	major_do_collection Line 2160	C
 	sgen_perform_collection Line 2356	C
 	sgen_gc_collect Line 2866	C
 	unload_thread_main Line 2569	C
 	start_wrapper_internal Line 830	C
 	start_wrapper Line 893	C
 	BaseThreadInitThunk Line 64	C
 	__RtlUserThreadStart Line 997	C
 	_RtlUserThreadStart Line 914	C
Comment 2 Kirill Osenkov 2017-05-22 23:24:05 UTC
Confirmed repro on Mac as well
Comment 3 Aleksey Kliger 2017-05-23 21:24:24 UTC
We're leaking a MonoReflectionAssemblyHandle.  Thanks Vlad and Rodrigo for tracking it down.
Comment 5 Alok Kulkarni 2017-07-14 06:50:32 UTC
Created attachment 23549 [details]

Verified on Build Xamarin 15.3 :
Build info : https://gist.github.com/alok-kulkarni/1ce9eeb3fdd99d11fc711672e6da0adf
Screencast :  http://www.screencast.com/t/I0Mj2VnJUf

Hence marking verified fixed to this bug.
Comment 6 Grigory (Playtika) 2018-03-26 18:34:05 UTC
I can still see it in production. 

Thread 18 Crashed:
0   libsystem_kernel.dylib               0x1e001acc __pthread_kill + 8
1   libsystem_pthread.dylib              0x1e0ba087 pthread_kill + 60
2   libsystem_c.dylib                    0x1df9695b abort + 106
3   BBAppIOS                             0x01fbb69c log_callback(char const*, char const*, char const*, int, void*) (runtime.m:1206)
4   BBAppIOS                             0x01fa6259 eglib_log_adapter (mono-logger.c:368)
5   BBAppIOS                             0x01fb463d monoeg_g_logv (goutput.c:115)
6   BBAppIOS                             0x01fb4749 monoeg_assertion_message (goutput.c:135)
7   BBAppIOS                             0x01f94d95 simple_nursery_serial_scan_object (sgen-scan-object.h:91)
8   BBAppIOS                             0x01f953c1 simple_nursery_serial_drain_gray_stack (sgen-minor-scan-object.h:142)
9   BBAppIOS                             0x01f72cd3 finish_gray_stack (sgen-gc.c:537)
10  BBAppIOS                             0x01f6f7ab collect_nursery (sgen-gc.c:1804)
11  BBAppIOS                             0x01f6ef51 sgen_perform_collection_inner (sgen-gc.c:2533)
12  BBAppIOS                             0x01f6ed53 sgen_ensure_free_space (sgen-gc.c:2628)
13  BBAppIOS                             0x01f6726f sgen_alloc_obj_nolock (sgen-alloc.c:239)
14  BBAppIOS                             0x01f3db0b mono_gc_alloc_vector (sgen-mono.c:1744)
15  BBAppIOS                             0x00114418 wrapper_managed_to_native_object___icall_wrapper_mono_gc_alloc_vector_intptr_intptr_intptr + 86
16  BBAppIOS                             0x002ad48f mscorlib_wrapper_alloc_object_AllocVector_intptr_intptr + 100
17  BBAppIOS                             0x0020fc9d mscorlib_System_IO_FileStream_InitBuffer_int_bool (FileStream.cs:1107)
18  BBAppIOS                             0x0020e61f mscorlib_System_IO_FileStream__ctor_string_System_IO_FileMode_System_IO_FileAccess_System_IO_FileShare_int_bool_System_IO_FileOptions (FileStream.cs:266)
19  BBAppIOS                             0x0020211f mscorlib_System_IO_FileInfo_Open_System_IO_FileMode_System_IO_FileAccess_System_IO_FileShare (FileStream.cs:91)