Bug 47156 - * Assertion at class.c:2093
Summary: * Assertion at class.c:2093
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2016-11-17 00:15 UTC by Marek Safar
Modified: 2016-12-01 20:06 UTC (History)
2 users (show)

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


Attachments

Description Marek Safar 2016-11-17 00:15:47 UTC
Happens quite frequently on 64bit windows

Assert values 48 == 56

Full threads dump

>Debug.ListCallStack /AllThreads
Callstack for Thread 1 (Thread Id: 9372 (0x249c)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!ves_icall_System_Threading_Monitor_Monitor_wait(_MonoObject * obj=0x000001fbd981b270, unsigned int ms=4294967295)
 3      [External Code]

Callstack for Thread 2 (Thread Id: 28908 (0x70ec)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Callstack for Thread 3 (Thread Id: 8080 (0x1f90)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Callstack for Thread 4 (Thread Id: 32448 (0x7ec0)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Callstack for Thread 5 (Thread Id: 29520 (0x7350)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!thread_func(void * thread_data=0x0000000000000000)
 3      [External Code]

Callstack for Thread 6 (Thread Id: 22012 (0x55fc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_os_sem_timedwait(void * * sem=0x00007ffd0f9ccd50, unsigned int timeout_ms=4294967295, MonoSemFlags flags)
 3      mono-2.0-sgen.dll!finalizer_thread(void * unused=0x00007ffd0f7b2a50)
 4      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001fbd7b47710, unsigned __int64 * stack_ptr)
 5      mono-2.0-sgen.dll!start_wrapper(void * data)
 6      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001fbd7b43050)
 7      [External Code]

Callstack for Thread 7 (Thread Id: 40012 (0x9c4c)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!sleep_interruptable(unsigned int ms=500, int * alerted=0x0000004304bffe10)
 3      mono-2.0-sgen.dll!monitor_thread()
 4      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001fbdc44ca00, unsigned __int64 * stack_ptr)
 5      mono-2.0-sgen.dll!start_wrapper(void * data)
 6      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001fbdc0e99b0)
 7      [External Code]

Callstack for Thread 8 (Thread Id: 29112 (0x71b8)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001fbdc663468, _MonoCoopMutex * mutex=0x000001fbdc663470, unsigned int timeout_ms=54283)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001fbdc44cd70)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001fbdc44cd70, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001fbdc0e9cf0)
 8      [External Code]

Callstack for Thread 9 (Thread Id: 30164 (0x75d4)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001fbdc663468, _MonoCoopMutex * mutex=0x000001fbdc663470, unsigned int timeout_ms=44574)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001fbdc44d090)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001fbdc44d090, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001fbdc5e6760)
 8      [External Code]

Callstack for Thread 10 (Thread Id: 42488 (0xa5f8)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001fbdc663468, _MonoCoopMutex * mutex=0x000001fbdc663470, unsigned int timeout_ms=16365)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001fbdc44c640)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001fbdc44c640, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001fbdc0e92b0)
 8      [External Code]

Callstack for Thread 11 (Thread Id: 34660 (0x8764)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe44f8e10, int base_instance_size, int packing_size=0, int sre=2)
 4      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe44f8e10)
 5      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001fbe44f8e10)
 6      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x000001fbe48e2f00)
 7      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbe3e8db90, _MonoMethod * method=0x000001fbe48e2ec0, MonoBasicBlock * start_bblock=0x000001fbdc5f2120, MonoBasicBlock * end_bblock=0x000001fbdc5f2258, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 8      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 9      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe48e2ec0, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x0000004304ffe5d0)
 10     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opt=303131135, _MonoError * error=0x0000004304ffe5d0)
 11     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x0000004304ffe6a8, unsigned char * code=0x000001fbe6e9daa4, _MonoMethod * m=0x000001fbe48e2ec0, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x0000004304ffe5d0)
 12     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x0000004304ffe6a8, unsigned char * code=0x000001fbe6e9daa4, void * arg=0x000001fbe48e2ec0, unsigned char * tramp=0x000001fbd9838958)
 13     [External Code]

Callstack for Thread 12 (Thread Id: 15276 (0x3bac)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe44f8e10, int base_instance_size, int packing_size=0, int sre=-467288800)
 4      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe44f8e10)
 5      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001fbe44f8e10)
 6      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x000001fbe48e2f00)
 7      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbdc5b8940, _MonoMethod * method=0x000001fbe48e2ec0, MonoBasicBlock * start_bblock=0x000001fbe44b7340, MonoBasicBlock * end_bblock=0x000001fbe44b7478, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 8      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 9      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe48e2ec0, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043050fe6d0)
 10     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opt=303131135, _MonoError * error=0x00000043050fe6d0)
 11     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043050fe7a8, unsigned char * code=0x000001fbe6e9daa4, _MonoMethod * m=0x000001fbe48e2ec0, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043050fe6d0)
 12     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043050fe7a8, unsigned char * code=0x000001fbe6e9daa4, void * arg=0x000001fbe48e2ec0, unsigned char * tramp=0x000001fbd9833e90)
 13     [External Code]

Callstack for Thread 13 (Thread Id: 16212 (0x3f54)):
 Index  Function
--------------------------------------------------------------------------------
 1      ucrtbase.dll!00007ffd2f7fea1e()
 2      mono-2.0-sgen.dll!mono_log_write_logfile(const char * log_domain=0x0000000000000000, GLogLevelFlags level=G_LOG_LEVEL_ERROR, int hdr=0, const char * message=0x000001fbe4280630)
 3      mono-2.0-sgen.dll!monoeg_g_logv(const char * log_domain=0x0000000000000000, GLogLevelFlags log_level=G_LOG_LEVEL_ERROR, const char * format, char * args)
 4      mono-2.0-sgen.dll!monoeg_g_log(const char * log_domain, GLogLevelFlags log_level, const char * format=0x00007ffd0f8ffe48, ...)
*5      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe44f8e10, int base_instance_size, int packing_size=0, int sre=2)
 6      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe44f8e10)
 7      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001fbe44f8e10)
 8      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x000001fbe48e2f00)
 9      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbdd18ec50, _MonoMethod * method=0x000001fbe48e2ec0, MonoBasicBlock * start_bblock=0x000001fbe45c1430, MonoBasicBlock * end_bblock=0x000001fbe45c1568, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 10     mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 11     mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe48e2ec0, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043051fe0c0)
 12     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opt=303131135, _MonoError * error=0x00000043051fe0c0)
 13     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043051fe198, unsigned char * code=0x000001fbe6e9daa4, _MonoMethod * m=0x000001fbe48e2ec0, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043051fe0c0)
 14     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043051fe198, unsigned char * code=0x000001fbe6e9daa4, void * arg=0x000001fbe48e2ec0, unsigned char * tramp=0x000001fbd9834ce8)
 15     [External Code]

Callstack for Thread 14 (Thread Id: 28764 (0x705c)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe44f8e10, int base_instance_size, int packing_size=0, int sre=2)
 4      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe44f8e10)
 5      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001fbe44f8e10)
 6      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x000001fbe48e2f00)
 7      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbdcfba870, _MonoMethod * method=0x000001fbe48e2ec0, MonoBasicBlock * start_bblock=0x000001fbe4507d10, MonoBasicBlock * end_bblock=0x000001fbe4507e48, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 8      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 9      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe48e2ec0, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043052fe3c0)
 10     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opt=303131135, _MonoError * error=0x00000043052fe3c0)
 11     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043052fe498, unsigned char * code=0x000001fbe6e9daa4, _MonoMethod * m=0x000001fbe48e2ec0, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043052fe3c0)
 12     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043052fe498, unsigned char * code=0x000001fbe6e9daa4, void * arg=0x000001fbe48e2ec0, unsigned char * tramp=0x000001fbd983a6f0)
 13     [External Code]

Callstack for Thread 15 (Thread Id: 22848 (0x5940)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_create_from_typedef(_MonoImage * image=0x000001fbd7b14e90, unsigned int type_token=33554900, _MonoError * error=0x000001fbdd2595c8)
 4      mono-2.0-sgen.dll!mono_class_get_checked(_MonoImage * image=0x000001fbd7b14e90, unsigned int type_token=33554900, _MonoError * error=0x000001fbdd2595c8)
 5      mono-2.0-sgen.dll!mono_class_from_name_checked_aux(_MonoImage * image=0x000001fbd7b14e90, const char * name_space=0x000001fbdbb11429, const char * name=0x000001fbdbb0df93, _GHashTable * visited_images=0x000001fbe4623b00, _MonoError * error=0x000001fbdd2595c8)
 6      mono-2.0-sgen.dll!mono_class_from_name_checked_aux(_MonoImage * image=0x000001fbd7bd22d0, const char * name_space=0x000001fbdbb11429, const char * name=0x000001fb00000001, _GHashTable * visited_images=0x000001fbe4623b00, _MonoError * error=0x000001fbdd2595c8)
 7      mono-2.0-sgen.dll!mono_class_from_typeref_checked(_MonoImage * image=0x000001fbdb7b30f0, unsigned int type_token=16777270, _MonoError * error=0x000001fbdd2595c8)
 8      mono-2.0-sgen.dll!mono_class_get_checked(_MonoImage * image=0x000001fbdb7b30f0, unsigned int type_token=16777270, _MonoError * error=0x000001fbdd2595c8)
 9      mono-2.0-sgen.dll!do_mono_metadata_parse_type(_MonoType * type=0x00000043053faeb0, _MonoImage * m=0x000001fbdb7b30f0, _MonoGenericContainer * container=0x0000000000000000, int transient=0, const char * ptr=0x000001fbdbb891c1, const char * * rptr=0x00000043053fae88, _MonoError * error=0x000001fbdd2595c8)
 10     mono-2.0-sgen.dll!mono_metadata_parse_type_internal(_MonoImage * m=0x000001fbdb7b30f0, _MonoGenericContainer * container=0x0000000000000000, short opt_attrs=1, int transient=0, const char * ptr=0x000001fbdbb891be, const char * * rptr=0x00000043053faf88, _MonoError * error=0x000001fbdd2595c8)
 11     mono-2.0-sgen.dll!do_mono_metadata_parse_generic_class(_MonoType * type=0x00000043053fb030, _MonoImage * m=0x000001fbdb7b30f0, _MonoGenericContainer * container=0x000001fbe4138790, const char * ptr=0x000001fbdbb891be, const char * * rptr=0x00000043053fafe0, _MonoError * error=0x000001fbdd2595c8)
 12     mono-2.0-sgen.dll!do_mono_metadata_parse_type(_MonoType * type=0x00000043053fb030, _MonoImage * m=0x000001fbdb7b30f0, _MonoGenericContainer * container=0x000001fbe4138790, int transient=1, const char * ptr=0x000001fbdbb891be, const char * * rptr=0x00000043053fb008, _MonoError * error=0x000001fbdd2595c8)
 13     mono-2.0-sgen.dll!mono_metadata_parse_type_internal(_MonoImage * m=0x000001fbdb7b30f0, _MonoGenericContainer * container=0x000001fbe4138790, short opt_attrs=20262, int transient=1, const char * ptr=0x000001fbdbb891bd, const char * * rptr=0x00000043053fb140, _MonoError * error=0x000001fbdd2595c8)
 14     mono-2.0-sgen.dll!mono_metadata_parse_mh_full(_MonoImage * m=0x000001fbdb7b30f0, _MonoGenericContainer * container=0x000001fbe4138790, const char * ptr, _MonoError * error=0x000001fbdd2595c8)
 15     mono-2.0-sgen.dll!mono_method_get_header_checked(_MonoMethod * method=0x000001fbe4138740, _MonoError * error=0x000001fbdd2595c8)
 16     mono-2.0-sgen.dll!mono_method_get_header_checked(_MonoMethod * method=0x000001fbe4631f80, _MonoError * error=0x000001fbdd2595c8)
 17     mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbdd2590f0, _MonoMethod * method=0x000001fbe4631f80, MonoBasicBlock * start_bblock=0x0000000000000000, MonoBasicBlock * end_bblock=0x0000000000000000, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 18     mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe4632160, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 19     mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe4632160, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043053fca50)
 20     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe4632160, unsigned int opt=303131135, _MonoError * error=0x00000043053fca50)
 21     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043053fcb28, unsigned char * code=0x000001fbe6ea0c0a, _MonoMethod * m=0x000001fbe4632160, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043053fca50)
 22     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043053fcb28, unsigned char * code=0x000001fbe6ea0c0a, void * arg=0x000001fbe46328e0, unsigned char * tramp=0x0000000000000000)
 23     [External Code]

Callstack for Thread 16 (Thread Id: 37072 (0x90d0)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001fbdc663468, _MonoCoopMutex * mutex=0x000001fbdc663470, unsigned int timeout_ms=28078)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001fbe42e35a0)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001fbe42e35a0, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001fbdcddd860)
 8      [External Code]

Callstack for Thread 17 (Thread Id: 22936 (0x5998)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_generic_class_get_class(_MonoGenericClass * gclass=0x000001fbe438d288)
 4      mono-2.0-sgen.dll!mono_class_inflate_generic_class_checked(_MonoClass * gklass, _MonoGenericContext * context, _MonoError * error=0x000001fbe40c4bc8)
 5      mono-2.0-sgen.dll!mono_class_get_and_inflate_typespec_checked(_MonoImage * image=0x000001fbdb7b30f0, unsigned int type_token=452984832, _MonoGenericContext * context=0x000001fbe4138790, _MonoError * error=0x000001fbe40c4bc8)
 6      mono-2.0-sgen.dll!method_from_memberref(_MonoImage * image=0x000001fbdb7b30f0, unsigned int idx, _MonoGenericContext * typespec_context=0x000001fbe4138790, int * used_context=0x00000043055fb528, _MonoError * error=0x000001fbe40c4bc8)
 7      mono-2.0-sgen.dll!mono_get_method_from_token(_MonoImage * image=0x000001fbdb7b30f0, unsigned int token=167773103, _MonoClass * klass=0x0000000000000000, _MonoGenericContext * context=0x000001fbe4138790, int * used_context=0x00000043055fb528, _MonoError * error=0x000001fbe40c4bc8)
 8      mono-2.0-sgen.dll!mono_get_method_checked(_MonoImage * image=0x000001fbdb7b30f0, unsigned int token=167773103, _MonoClass * klass=0x0000000000000000, _MonoGenericContext * context=0x000001fbe4138790, _MonoError * error=0x000001fbe40c4bc8)
 9      mono-2.0-sgen.dll!mini_get_method_allow_open(_MonoMethod * m=0x000001fbe4631f80, unsigned int token=167773103, _MonoClass * klass=0x0000000000000000, _MonoGenericContext * context=0x000001fbe4138790, _MonoError * error=0x000001fbe40c4bc8)
 10     mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbe40c46f0, _MonoMethod * method=0x000001fbe4631f80, MonoBasicBlock * start_bblock=0x000001fbe486f218, MonoBasicBlock * end_bblock=0x000001fbe486f350, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 11     mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe4632160, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 12     mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe4632160, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043055fce10)
 13     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe4632160, unsigned int opt=303131135, _MonoError * error=0x00000043055fce10)
 14     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043055fcee8, unsigned char * code=0x000001fbe6ea0c0a, _MonoMethod * m=0x000001fbe4632160, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043055fce10)
 15     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043055fcee8, unsigned char * code=0x000001fbe6ea0c0a, void * arg=0x000001fbe46328e0, unsigned char * tramp=0x0000000000000000)
 16     [External Code]

Callstack for Thread 18 (Thread Id: 34368 (0x8640)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe4732b58, int base_instance_size, int packing_size=0, int sre=-464971856)
 4      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe4732b58)
 5      mono-2.0-sgen.dll!class_has_references(_MonoClass * klass=0x000001fbe4732b58)
 6      mono-2.0-sgen.dll!type_has_references(_MonoClass * klass=0x000001fbe44f8e10, _MonoType * ftype=0x000001fbe3f91e70)
 7      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe44f8e10, int base_instance_size, int packing_size=0, int sre=0)
 8      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe44f8e10)
 9      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001fbe44f8e10)
 10     mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x000001fbe48e2f00)
 11     mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbe460e0b0, _MonoMethod * method=0x000001fbe48e2ec0, MonoBasicBlock * start_bblock=0x000001fbe4739420, MonoBasicBlock * end_bblock=0x000001fbe4739558, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 12     mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 13     mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe48e2ec0, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043056fe4b0)
 14     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opt=303131135, _MonoError * error=0x00000043056fe4b0)
 15     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043056fe588, unsigned char * code=0x000001fbe6e9daa4, _MonoMethod * m=0x000001fbe48e2ec0, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043056fe4b0)
 16     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043056fe588, unsigned char * code=0x000001fbe6e9daa4, void * arg=0x000001fbe48e2ec0, unsigned char * tramp=0x000001fbd98362b0)
 17     [External Code]

Callstack for Thread 19 (Thread Id: 30196 (0x75f4)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001fbe44f8e10, int base_instance_size, int packing_size=0, int sre=2)
 4      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001fbe44f8e10)
 5      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001fbe44f8e10)
 6      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x000001fbe48e2f00)
 7      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001fbe40c3640, _MonoMethod * method=0x000001fbe48e2ec0, MonoBasicBlock * start_bblock=0x000001fbe487b900, MonoBasicBlock * end_bblock=0x000001fbe487ba38, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 8      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opts=303131135, _MonoDomain * domain=0x000001fbd7b10430, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 9      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001fbe48e2ec0, _MonoDomain * target_domain=0x000001fbd7b10430, int opt=303131135, _MonoError * error=0x00000043057fe640)
 10     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001fbe48e2ec0, unsigned int opt=303131135, _MonoError * error=0x00000043057fe640)
 11     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000043057fe718, unsigned char * code=0x000001fbe6e9daa4, _MonoMethod * m=0x000001fbe48e2ec0, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000043057fe640)
 12     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000043057fe718, unsigned char * code=0x000001fbe6e9daa4, void * arg=0x000001fbe48e2ec0, unsigned char * tramp=0x000001fbd9817388)
 13     [External Code]

Callstack for Thread 20 (Thread Id: 9988 (0x2704)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Locals

*klass
{element_class=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {...} ...} ...} ...}
    element_class: 0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=...} ...} ...}
    cast_class: 0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=...} ...} ...}
    supertypes: 0x0000000000000000 {???}
    idepth: 0
    rank: 0 '\0'
    instance_size: 48
    inited: 0
    size_inited: 1
    valuetype: 0
    enumtype: 0
    blittable: 0
    unicode: 0
    wastypebuilder: 0
    min_align: 8 '\b'
    packing_size: 0
    ghcimpl: 0
    has_finalize: 0
    marshalbyref: 0
    contextbound: 0
    delegate: 0
    gc_descr_inited: 0
    has_cctor: 0
    has_references: 1
    has_static_refs: 0
    no_special_static_fields: 0
    is_com_object: 0
    nested_classes_inited: 0
    class_kind: 1
    interfaces_inited: 1
    simd_type: 0
    has_finalize_inited: 0
    fields_inited: 0
    has_failure: 0
    parent: 0x000001fbe4131db8 {element_class=0x000001fbe4131db8 {element_class=0x000001fbe4131db8 {element_class=...} ...} ...}
    nested_in: 0x0000000000000000 <NULL>
    image: 0x000001fbdb7b30f0 {ref_count=1 raw_data_handle=0x0000000000000268 raw_data=0x000001fbdb870000 "MZ" ...}
    name: 0x000001fbdbb3e7f7 "BoundSwitchSection"
    name_space: 0x000001fbdbb423aa "Microsoft.CodeAnalysis.CSharp"
    type_token: 33554671
    vtable_size: 0
    interface_count: 0
    interface_id: 0
    max_interface_id: 0
    interface_offsets_count: 0
    interfaces_packed: 0x0000000000000000 {???}
    interface_offsets_packed: 0x0000000000000000 {???}
    interface_bitmap: 0x0000000000000000 <NULL>
    interfaces: 0x0000000000000000 {???}
    sizes: {class_size=0 element_size=0 generic_param_token=0 }
    fields: 0x000001fbe3f91e40 {type=0x000001fbe3f91e90 {data={klass=0x000001fbe4732918 {element_class=0x000001fbd7bd0818 {...} ...} ...} ...} ...}
    methods: 0x0000000000000000 {???}
    this_arg: {data={klass=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {...} ...} ...} ...} ...}
    byval_arg: {data={klass=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {element_class=0x000001fbe44f8e10 {...} ...} ...} ...} ...}
    gc_descr: 0
    runtime_info: 0x0000000000000000 <NULL>
    vtable: 0x0000000000000000 {???}
    infrequent_data: {head=0x0000000000000000 <NULL> }

TypeDef of actual type

TypeDef #238 (020000ef)
-------------------------------------------------------
	TypDefName: Microsoft.CodeAnalysis.CSharp.BoundSwitchSection  (020000EF)
	Flags     : [NotPublic] [AutoLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit]  (00100100)
	Extends   : 0200009A [TypeDef] Microsoft.CodeAnalysis.CSharp.BoundStatementList
	Field #1 (0400054e)
	-------------------------------------------------------
		Field Name: <BoundSwitchLabels>k__BackingField (0400054E)
		Flags     : [Private] [InitOnly]  (00000021)
		CallCnvntn: [FIELD]
		Field type:  GenericInst ValueClass System.Collections.Immutable.ImmutableArray`1< Class Microsoft.CodeAnalysis.CSharp.BoundSwitchLabel>
		CustomAttribute #1 (0c00025e)
		-------------------------------------------------------
			CustomAttribute Type: 0a00000c
			CustomAttributeName: System.Runtime.CompilerServices.CompilerGeneratedAttribute :: instance void .ctor()
			Length: 4
			Value : 01 00 00 00                                      >                <
			ctor args: ()
Comment 1 Marek Safar 2016-11-17 10:27:41 UTC
I hit this issue again now with different value and for different type

80 (cached) vs 88 (new value) for type Microsoft.CodeAnalysis.CSharp.BoundSwitchStatement
Comment 2 Marek Safar 2016-11-17 11:05:29 UTC
klass->fields[7].offset	72
field_offsets[6]	72

and following thread dump

>Debug.ListCallStack /AllThreads  
Callstack for Thread 1 (Thread Id: 39196 (0x991c)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!ves_icall_System_Threading_Monitor_Monitor_wait(_MonoObject * obj=0x000001a542b4c8f8, unsigned int ms=4294967295)
 3      [External Code]

Callstack for Thread 2 (Thread Id: 28156 (0x6dfc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Callstack for Thread 3 (Thread Id: 38332 (0x95bc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Callstack for Thread 4 (Thread Id: 40480 (0x9e20)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

Callstack for Thread 5 (Thread Id: 23540 (0x5bf4)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
*2      mono-2.0-sgen.dll!thread_func(void * thread_data=0x0000000000000000)
 3      [External Code]

Callstack for Thread 6 (Thread Id: 24340 (0x5f14)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_os_sem_timedwait(void * * sem=0x00007ffd0edecd50, unsigned int timeout_ms=4294967295, MonoSemFlags flags)
 3      mono-2.0-sgen.dll!finalizer_thread(void * unused=0x00007ffd0ebd2a50)
 4      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001a540af9260, unsigned __int64 * stack_ptr)
 5      mono-2.0-sgen.dll!start_wrapper(void * data)
 6      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001a540af3530)
 7      [External Code]

Callstack for Thread 7 (Thread Id: 42188 (0xa4cc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!sleep_interruptable(unsigned int ms=500, int * alerted=0x00000049928ff7d0)
 3      mono-2.0-sgen.dll!monitor_thread()
 4      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001a54533ef90, unsigned __int64 * stack_ptr)
 5      mono-2.0-sgen.dll!start_wrapper(void * data)
 6      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001a5452eb110)
 7      [External Code]

Callstack for Thread 8 (Thread Id: 21964 (0x55cc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001a546bb0bb0)
 4      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x0000000000000000)
 5      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001a547088150, _MonoMethod * method=0x000001a547986d60, MonoBasicBlock * start_bblock=0x000001a548ddcfe0, MonoBasicBlock * end_bblock=0x000001a548ddd118, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 6      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001a547986d60, unsigned int opts=303131135, _MonoDomain * domain=0x000001a540abdd90, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 7      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001a547986d60, _MonoDomain * target_domain=0x000001a540abdd90, int opt=303131135, _MonoError * error=0x00000049929fe350)
 8      mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001a547986d60, unsigned int opt=303131135, _MonoError * error=0x00000049929fe350)
 9      mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x00000049929fe428, unsigned char * code=0x000001a548b02576, _MonoMethod * m=0x000001a547986d60, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x00000049929fe350)
 10     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x00000049929fe428, unsigned char * code=0x000001a548b02576, void * arg=0x000001a547986d60, unsigned char * tramp=0x000001a547a92a48)
 11     [External Code]

Callstack for Thread 9 (Thread Id: 38620 (0x96dc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_create_from_typedef(_MonoImage * image=0x000001a544692850, unsigned int type_token=33554516, _MonoError * error=0x000001a5473e5b38)
 4      mono-2.0-sgen.dll!mono_class_get_checked(_MonoImage * image=0x000001a544692850, unsigned int type_token=33554516, _MonoError * error=0x000001a5473e5b38)
 5      mono-2.0-sgen.dll!mono_field_from_token_checked(_MonoImage * image=0x000001a544692850, unsigned int token=67109813, _MonoClass * * retklass=0x0000004992afbbe0, _MonoGenericContext * context=0x0000000000000000, _MonoError * error=0x000001a5473e5b38)
 6      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001a5473e5660, _MonoMethod * method=0x000001a547986f58, MonoBasicBlock * start_bblock=0x000001a5479e0460, MonoBasicBlock * end_bblock=0x000001a5479e0598, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 7      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001a547986f58, unsigned int opts=303131135, _MonoDomain * domain=0x000001a540abdd90, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 8      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001a547986f58, _MonoDomain * target_domain=0x000001a540abdd90, int opt=303131135, _MonoError * error=0x0000004992afd420)
 9      mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001a547986f58, unsigned int opt=303131135, _MonoError * error=0x0000004992afd420)
 10     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x0000004992afd4f8, unsigned char * code=0x000001a548b02d88, _MonoMethod * m=0x000001a547986f58, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x0000004992afd420)
 11     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x0000004992afd4f8, unsigned char * code=0x000001a548b02d88, void * arg=0x000001a547986f58, unsigned char * tramp=0x0000000000000009)
 12     [External Code]

Callstack for Thread 10 (Thread Id: 16572 (0x40bc)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001a545122be8, _MonoCoopMutex * mutex=0x000001a545122bf0, unsigned int timeout_ms=6112)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001a545340110)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001a545340110, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001a5452eb210)
 8      [External Code]

Callstack for Thread 11 (Thread Id: 24180 (0x5e74)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001a545122be8, _MonoCoopMutex * mutex=0x000001a545122bf0, unsigned int timeout_ms=57469)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001a54533f490)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001a54533f490, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001a5452eb710)
 8      [External Code]

Callstack for Thread 12 (Thread Id: 11304 (0x2c28)):
 Index  Function
--------------------------------------------------------------------------------
 1      ucrtbase.dll!00007ffd2f7fea1e()
 2      mono-2.0-sgen.dll!mono_log_write_logfile(const char * log_domain=0x0000000000000000, GLogLevelFlags level=G_LOG_LEVEL_ERROR, int hdr=0, const char * message=0x000001a547765fe0)
 3      mono-2.0-sgen.dll!monoeg_g_logv(const char * log_domain=0x0000000000000000, GLogLevelFlags log_level=G_LOG_LEVEL_ERROR, const char * format, char * args)
 4      mono-2.0-sgen.dll!monoeg_g_log(const char * log_domain, GLogLevelFlags log_level, const char * format=0x00007ffd0ed1fe48, ...)
 5      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001a546bb0bb0, int base_instance_size, int packing_size=0, int sre=2)
 6      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001a546bb0bb0)
 7      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001a546bb0bb0)
 8      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x0000000000000000)
 9      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001a5475262b0, _MonoMethod * method=0x000001a547986d60, MonoBasicBlock * start_bblock=0x000001a547a95a50, MonoBasicBlock * end_bblock=0x000001a547a95b88, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 10     mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001a547986d60, unsigned int opts=303131135, _MonoDomain * domain=0x000001a540abdd90, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 11     mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001a547986d60, _MonoDomain * target_domain=0x000001a540abdd90, int opt=303131135, _MonoError * error=0x0000004992dfe3f0)
 12     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001a547986d60, unsigned int opt=303131135, _MonoError * error=0x0000004992dfe3f0)
 13     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x0000004992dfe4c8, unsigned char * code=0x000001a548b02576, _MonoMethod * m=0x000001a547986d60, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x0000004992dfe3f0)
 14     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x0000004992dfe4c8, unsigned char * code=0x000001a548b02576, void * arg=0x000001a547986d60, unsigned char * tramp=0x000001a547a92a48)
 15     [External Code]

Callstack for Thread 13 (Thread Id: 9372 (0x249c)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001a545122be8, _MonoCoopMutex * mutex=0x000001a545122bf0, unsigned int timeout_ms=46119)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001a545f0b480)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001a545f0b480, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001a5453c7ed0)
 8      [External Code]

Callstack for Thread 14 (Thread Id: 18408 (0x47e8)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_loader_lock()
 3      mono-2.0-sgen.dll!mono_class_layout_fields(_MonoClass * klass=0x000001a546bb0bb0, int base_instance_size, int packing_size=0, int sre=2)
 4      mono-2.0-sgen.dll!mono_class_setup_fields(_MonoClass * klass=0x000001a546bb0bb0)
 5      mono-2.0-sgen.dll!mono_class_init(_MonoClass * klass=0x000001a546bb0bb0)
 6      mono-2.0-sgen.dll!mini_get_class(_MonoMethod * method, unsigned int token, _MonoGenericContext * context=0x0000000000000000)
 7      mono-2.0-sgen.dll!mono_method_to_ir(MonoCompile * cfg=0x000001a5470c0010, _MonoMethod * method=0x000001a547986d60, MonoBasicBlock * start_bblock=0x000001a54797cc90, MonoBasicBlock * end_bblock=0x000001a54797cdc8, MonoInst * return_var=0x0000000000000000, MonoInst * * inline_args=0x0000000000000000, unsigned int inline_offset=0, int is_virtual_call=0)
 8      mono-2.0-sgen.dll!mini_method_compile(_MonoMethod * method=0x000001a547986d60, unsigned int opts=303131135, _MonoDomain * domain=0x000001a540abdd90, JitFlags flags=JIT_FLAG_RUN_CCTORS, int parts=0, int aot_method_index=-1)
 9      mono-2.0-sgen.dll!mono_jit_compile_method_inner(_MonoMethod * method=0x000001a547986d60, _MonoDomain * target_domain=0x000001a540abdd90, int opt=303131135, _MonoError * error=0x0000004992ffe0e0)
 10     mono-2.0-sgen.dll!mono_jit_compile_method_with_opt(_MonoMethod * method=0x000001a547986d60, unsigned int opt=303131135, _MonoError * error=0x0000004992ffe0e0)
 11     mono-2.0-sgen.dll!common_call_trampoline(__int64 * regs=0x0000004992ffe1b8, unsigned char * code=0x000001a548b02576, _MonoMethod * m=0x000001a547986d60, MonoVTable * vt=0x0000000000000000, void * * vtable_slot=0x0000000000000000, _MonoError * error=0x0000004992ffe0e0)
 12     mono-2.0-sgen.dll!mono_magic_trampoline(__int64 * regs=0x0000004992ffe1b8, unsigned char * code=0x000001a548b02576, void * arg=0x000001a547986d60, unsigned char * tramp=0x000001a542831928)
 13     [External Code]

Callstack for Thread 15 (Thread Id: 20064 (0x4e60)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]
 2      mono-2.0-sgen.dll!mono_coop_cond_timedwait(_MonoCoopCond * cond=0x000001a545122be8, _MonoCoopMutex * mutex=0x000001a545122bf0, unsigned int timeout_ms=32656)
 3      mono-2.0-sgen.dll!worker_park()
 4      mono-2.0-sgen.dll!worker_thread(void * data=0x000001a546f61a60)
 5      mono-2.0-sgen.dll!start_wrapper_internal(StartInfo * start_info=0x000001a546f61a60, unsigned __int64 * stack_ptr)
 6      mono-2.0-sgen.dll!start_wrapper(void * data)
 7      mono-2.0-sgen.dll!inner_start_thread(void * data=0x000001a5473f8c20)
 8      [External Code]

Callstack for Thread 16 (Thread Id: 7152 (0x1bf0)):
 Index  Function
--------------------------------------------------------------------------------
 1      [External Code]

>
Comment 3 Marek Safar 2016-11-18 12:18:34 UTC
Output with added logging

32 80 0 0
1 1 0 0
8 8
  0 16
  24 72
  16 64
* Assertion at ..\mono\metadata\class.c:2107, condition `klass->instance_size == instance_size' not met

make[2]: *** [../../build/tests.make:141: xbuild_12_Microsoft.Build.Engine_test.dll] Error 255
Comment 4 Marek Safar 2016-11-18 15:34:20 UTC
Another version

@./../../build/deps/xbuild_12__Microsoft.Build.Framework.dll.response
14:11:26 56 64 0 0
14:11:26 1 1 0 0
14:11:26 8 8
14:11:26   32 32
14:11:26   0 40
14:11:26   40 48
14:11:26   48 56
14:11:26 
* Assertion at ..\mono\metadata\class.c:2107, condition `klass->instance_size == instance_size' not met
Comment 5 Marek Safar 2016-11-19 17:19:08 UTC
Another debug output

r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.dll  -target:exe -out:../../class/lib/net_4_x/mono-symbolicate.exe   @./../../build/deps/mono-symbolicate.exe.sources.response
224 192 0 0
1 1 0 0
8 8
  168 168
  16 16
  24 24
  32 32
  40 40
  172 172
  48 48
  56 56
  173 173
  64 64
  176 88
  112 112
  200 174
  136 136
  204 176
  144 144
  152 152
  208 180
  160 160
  212 184
* Assertion at ..\mono\metadata\class.c:2107, condition `klass->instance_size == instance_size' not met

make[8]: *** [../../build/executable.make:123: ../../class/lib/net_4_x/mono-symbolicate.exe] Error 255
Comment 6 Zoltan Varga 2016-11-19 20:27:17 UTC
Added some more debug code in 0ff2675b064cb89d72d2cc53f3fd461bc970b2b3 so we actually print out the name of the class as well.
Comment 7 Marek Safar 2016-11-20 16:55:38 UTC
MCS     [net_4_x] net_4_x_System.ServiceProcess_test.dll
 EnumeratorImpl
48 16 0 0
0 0 0 0
8 1
  _e 16 0
* Assertion at ..\mono\metadata\class.c:2108, condition `klass->instance_size == instance_size' not met

make[2]: *** [../../build/tests.make:141: net_4_x_System.ServiceProcess_test.dll] Error 255
Comment 8 Zoltan Varga 2016-11-20 23:05:09 UTC
Added even more logging code in 61e482b928b09944b547f41a8ca6fe712be3f71b.
Comment 9 Marek Safar 2016-11-21 13:28:40 UTC
@./../../build/deps/basic__System.Xml.dll.response
08:01:45 Microsoft.CodeAnalysis.CSharp.BoundStateMachineScope
08:01:45 48 40 0 0
08:01:45 1 1 0 0
08:01:45 8 8
08:01:45   <Fields>k__BackingField 32 0 1
08:01:45   <Statement>k__BackingField 40 32 1
08:01:45 
* Assertion at ..\mono\metadata\class.c:2114, condition `klass->instance_size == instance_size' not met
08:01:45 
08:01:49 make[9]: *** [../../build/library.make:302: ../../class/lib/basic/System.Xml.dll] Error 255
Comment 10 Zoltan Varga 2016-11-21 22:32:10 UTC
Added back some locking in 8979f2786c003506d7c2c278906bea89759b5d58, hopefully that will fix it.
Comment 11 Zoltan Varga 2016-12-01 20:06:46 UTC
This should be fixed now.

Note You need to log in before you can comment on or make changes to this bug.