Bug 46560 - * Assertion at class.c:9954, condition `klass != NULL' not met
Summary: * Assertion at class.c:9954, condition `klass != NULL' not met
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-08 08:48 UTC by Marek Safar
Modified: 2016-11-11 21:09 UTC (History)
3 users (show)

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

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:
Status:
RESOLVED FIXED

Description Marek Safar 2016-11-08 08:48:13 UTC
Roslyn crashes on ARM64. This is probably not ARM specific just exposed there

Full log https://jenkins.mono-project.com/job/test-mono-pull-request-arm64/1930/consoleFull#592380892ae1da302-70c8-400e-9aed-bc1cd416a1c7

Relevant info

* Assertion at class.c:9954, condition `klass != NULL' not met
04:42:37 
04:42:37 Stacktrace:
04:42:37 
04:42:37   at <unknown> <0xffffffff>
04:42:37   at Microsoft.CodeAnalysis.CSharp.PreciseAbstractFlowPass`1<Microsoft.CodeAnalysis.CSharp.ControlFlowPass/LocalState>.Scan (bool&) <0x00053>
04:42:37   at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Scan (bool&) <0x0005b>
04:42:37   at Microsoft.CodeAnalysis.CSharp.PreciseAbstractFlowPass`1<Microsoft.CodeAnalysis.CSharp.ControlFlowPass/LocalState>.Analyze (bool&) <0x00103>
04:42:37   at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Analyze (bool&,Microsoft.CodeAnalysis.DiagnosticBag) <0x0002f>
04:42:37   at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Analyze (Microsoft.CodeAnalysis.CSharp.CSharpCompilation,Microsoft.CodeAnalysis.CSharp.Symbol,Microsoft.CodeAnalysis.CSharp.BoundBlock,Microsoft.CodeAnalysis.DiagnosticBag) <0x0008b>
04:42:37   at Microsoft.CodeAnalysis.CSharp.FlowAnalysisPass.Analyze (Microsoft.CodeAnalysis.CSharp.CSharpCompilation,Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,Microsoft.CodeAnalysis.CSharp.BoundBlock,Microsoft.CodeAnalysis.DiagnosticBag) <0x00033>
04:42:37   at Microsoft.CodeAnalysis.CSharp.FlowAnalysisPass.Rewrite (Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,Microsoft.CodeAnalysis.CSharp.BoundBlock,Microsoft.CodeAnalysis.DiagnosticBag,bool,bool) <0x000f3>
04:42:37   at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod (Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,int,Microsoft.CodeAnalysis.CSharp.Binder/ProcessedFieldInitializers&,Microsoft.CodeAnalysis.CSharp.SynthesizedSubmissionFields,Microsoft.CodeAnalysis.CSharp.TypeCompilationState) <0x00767>
04:42:37   at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType (Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol) <0x005b7>
04:42:37   at Microsoft.CodeAnalysis.CSharp.MethodCompiler/<>c__DisplayClass20_0.<CompileNamedTypeAsTask>b__0 () <0x0001b>
04:42:37   at Roslyn.Utilities.UICultureUtilities/<>c__DisplayClass5_0.<WithCurrentUICulture>b__0 () <0x000b3>
04:42:37   at System.Threading.Tasks.Task.InnerInvoke () <0x0005f>
04:42:37   at System.Threading.Tasks.Task.Execute () <0x0003f>
04:42:37   at System.Threading.Tasks.Task.ExecutionContextCallback (object) <0x00057>
04:42:37   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x0016f>
04:42:37   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x0002b>
04:42:37   at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task&) <0x0012b>
04:42:37   at System.Threading.Tasks.Task.ExecuteEntry (bool) <0x000cb>
04:42:37   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x00017>
04:42:37   at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x001db>
04:42:37   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x0000b>
04:42:37   at (wrapper runtime-invoke) <Module>.runtime_invoke_bool (object,intptr,intptr,intptr) <0x00057>
04:42:37 
04:42:37 
Native stacktrace:
04:42:37 
04:42:37 	/media/ssd/jenkins/workspace/test-mono-pull-request-arm64/mono/mini/mono() [0x49de50]
04:42:37 
04:42:37 =================================================================
04:42:37 Got a SIGABRT while executing native code. This usually indicates
04:42:37 a fatal error in the mono runtime or one of the native libraries 
04:42:37 used by your application.
04:42:37 =================================================================
Comment 1 Marek Safar 2016-11-08 15:17:50 UTC
Every wrench build seems to hit that at some point

Next one

https://jenkins.mono-project.com/job/test-mono-pull-request-arm64/1936/consoleFull#-1279890771de733c27-8bf9-43f1-b986-604599a42e3b
Comment 2 Zoltan Varga 2016-11-08 22:17:04 UTC
Fixed a bunch of issues in https://github.com/mono/mono/pull/3919, but its still fails randomly.
Comment 3 Zoltan Varga 2016-11-09 07:12:20 UTC
That pull request is now in master.
Comment 4 Marek Safar 2016-11-10 10:40:27 UTC
Tracked down the remaining failure

Here is the treads dump

(gdb) T a a bt

Thread 9 (Thread 0x7faefff1b0 (LWP 6948)):
#0  0x0000007fb7eed218 in __lll_lock_wait ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000007fb7ee80a4 in pthread_mutex_lock ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#2  0x000000000054346c in mono_os_mutex_lock (mutex=0x746220)
    at ../../mono/utils/mono-os-mutex.h:94
#3  mono_image_set_lock (set=0x746150) at metadata.c:2427
#4  mono_metadata_get_generic_inst (type_argc=128, type_argc@entry=1,
    type_argv=type_argv@entry=0x7f90222dd0) at metadata.c:2916
#5  0x0000000000543794 in mono_metadata_parse_generic_inst (m=m@entry=0x742f50,
    container=container@entry=0x795c48, count=1, ptr=0x7f9020d6a8 "",
    rptr=rptr@entry=0x7faeffc318, error=error@entry=0x7f9020d6a8) at metadata.c:3070
#6  0x0000000000543e04 in do_mono_metadata_parse_generic_class (
    type=<optimized out>, error=0x7f9020d6a8, rptr=0x7faeffc368, ptr=0x0,
    container=0x795c48, m=0x742f50) at metadata.c:3100
#7  do_mono_metadata_parse_type (error=0x7f9020d6a8, rptr=0x7faeffc358,
    ptr=0x18a <error: Cannot access memory at address 0x18a>, transient=0,
    container=0x795c48, m=0x742f50, type=0x7faeffc320) at metadata.c:3429
#8  mono_metadata_parse_type_internal (m=m@entry=0x742f50,
    container=container@entry=0x795c48, opt_attrs=<optimized out>,
    transient=transient@entry=0, ptr=0x742f50 "\001", rptr=rptr@entry=0x7faeffc3b8,
    error=error@entry=0x7f9020d6a8) at metadata.c:1688
#9  0x00000000005442cc in mono_metadata_parse_type_checked (error=0x7f9020d6a8,
    rptr=0x7faeffc3b8, ptr=<optimized out>, transient=0, opt_attrs=<optimized out>,
    container=0x795c48, m=0x742f50) at metadata.c:1742
#10 mono_metadata_parse_method_signature_full (m=m@entry=0x742f50,
    container=container@entry=0x795c48, def=def@entry=394,
    ptr=0x7fb5fcde2b "\025\022\207\230\001\036", rptr=rptr@entry=0x0,
    error=error@entry=0x7f9020d6a8) at metadata.c:2081
#11 0x0000000000526528 in mono_method_signature_checked (m=0x795c20,
    error=0x7f9020d6a8) at loader.c:2405
#12 0x0000000000526bf4 in find_method_in_class (klass=klass@entry=0x74a360,
    name=name@entry=0x7fb4c051e8 "Sort", qname=qname@entry=0x0,
    fqname=fqname@entry=0x0, sig=sig@entry=0x7fa019d620,
---Type <return> to continue, or q <return> to quit---
    from_class=from_class@entry=0x74a360, error=error@entry=0x7f9020d6a8)
    at loader.c:419
#13 0x0000000000526fa0 in find_method (in_class=in_class@entry=0x74a360,
    ic=ic@entry=0x0, name=name@entry=0x7fb4c051e8 "Sort",
    sig=sig@entry=0x7fa019d620, from_class=from_class@entry=0x74a360,
    error=error@entry=0x7f9020d6a8) at loader.c:465
#14 0x00000000005274fc in method_from_memberref (image=image@entry=0x7afd00,
    idx=127, idx@entry=4538, typespec_context=typespec_context@entry=0x0,
    used_context=used_context@entry=0x0, error=0x7f9020d6a8) at loader.c:849
#15 0x00000000005279b8 in method_from_methodspec (error=0x7f9020d6a8, idx=662,
    context=0x0, image=0x7afd00) at loader.c:937
#16 mono_get_method_from_token (image=image@entry=0x7afd00,
    token=token@entry=721420950, klass=klass@entry=0x0, context=context@entry=0x0,
    used_context=used_context@entry=0x7faeffc71c, error=error@entry=0x7f9020d6a8)
    at loader.c:1613
#17 0x0000000000527bd8 in mono_get_method_checked (image=0x7afd00,
    token=<optimized out>, klass=klass@entry=0x0, context=0x0, error=0x7f9020d6a8)
    at loader.c:1754
#18 0x0000000000415eac in mini_get_method_allow_open (m=<optimized out>, token=0,
    context=<optimized out>, error=<optimized out>, klass=0x0)
    at method-to-ir.c:7437
#19 0x0000000000415ee8 in mini_get_method (cfg=cfg@entry=0x7f9020d1f0,
    m=m@entry=0x7fa019f1c0, token=token@entry=5090172, context=context@entry=0x0,
    klass=0x0) at method-to-ir.c:7447
#20 0x00000000004543f4 in mono_method_to_ir (cfg=cfg@entry=0x7f9020d1f0,
    method=method@entry=0x7fa019f1c0, start_bblock=0x7f9021cbb8,
    start_bblock@entry=0x0, end_bblock=0x7f9021ccf0, end_bblock@entry=0x0,
    return_var=return_var@entry=0x0, inline_args=inline_args@entry=0x0,
    inline_offset=inline_offset@entry=0, is_virtual_call=is_virtual_call@entry=0)
    at method-to-ir.c:9254
#21 0x00000000004daba4 in mini_method_compile (method=method@entry=0x7fa019f1c0,
    opts=opts@entry=370223615, domain=domain@entry=0x73e680,
    flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0,
    aot_method_index=aot_method_index@entry=-1) at mini.c:3562
#22 0x00000000004dc76c in mono_jit_compile_method_inner (
    method=method@entry=0x7fa019f1c0, target_domain=target_domain@entry=0x73e680,
---Type <return> to continue, or q <return> to quit---
    opt=opt@entry=370223615, error=error@entry=0x7faeffcd88) at mini.c:4254
#23 0x0000000000426b18 in mono_jit_compile_method_with_opt (
    method=method@entry=0x7fa019f1c0, opt=370223615, error=0x7faeffcd88,
    error@entry=0x0) at mini-runtime.c:1989
#24 0x0000000000427300 in mono_jit_compile_method (
    method=method@entry=0x7fa019f1c0, error=0x0, error@entry=0x7faeffcd88)
    at mini-runtime.c:2033
#25 0x000000000049f42c in common_call_trampoline (regs=regs@entry=0x7faeffce00,
    code=0x7fad325ac8 "\240\003\003\221\035\234\377\227\340\003\025\252\263SA\251\265[B\251\267cC\251\271kD\251\277\003",
    code@entry=0x7faeffcf70 "\340\354\234\267\177", m=0x7fa019f1c0,
    m@entry=0x7fad325f0c, vt=vt@entry=0x0, vtable_slot=<optimized out>,
    vtable_slot@entry=0x0, error=0x7faeffcd88, error@entry=0x7faeffcda8)
    at mini-trampolines.c:698
#26 0x000000000049fa28 in mono_magic_trampoline (regs=0x7faeffce00,
    code=0x7faeffcf70 "\340\354\234\267\177", arg=0x7fad325f0c,
    tramp=<optimized out>) at mini-trampolines.c:828
#27 0x0000007fb7d852f4 in ?? ()
#28 0x0000007fb79c46a8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 8 (Thread 0x7faf39b1b0 (LWP 6947)):
#0  0x00000000004fadd8 in setup_interface_offsets (klass=klass@entry=0x7fa01b46c8,
    cur_slot=cur_slot@entry=0, overwrite=127, overwrite@entry=1) at class.c:3561
#1  0x00000000004f9d78 in mono_class_init (klass=klass@entry=0x7fa01b46c8)
    at class.c:5318
#2  0x00000000004fade8 in setup_interface_offsets (klass=klass@entry=0x7fa01b45a0,
    cur_slot=cur_slot@entry=0, overwrite=127, overwrite@entry=1) at class.c:3563
#3  0x00000000004f9d78 in mono_class_init (klass=klass@entry=0x7fa01b45a0)
    at class.c:5318
#4  0x00000000004fade8 in setup_interface_offsets (klass=klass@entry=0x7fa01b4438,
    cur_slot=cur_slot@entry=0, overwrite=127, overwrite@entry=1) at class.c:3563
#5  0x00000000004f9d78 in mono_class_init (klass=klass@entry=0x7fa01b4438)
    at class.c:5318
#6  0x00000000004fa414 in collect_implemented_interfaces_aux (
    klass=klass@entry=0x7fa014c780, res=0x7faf3989a8, res@entry=0x7faf3989b8,
---Type <return> to continue, or q <return> to quit---
    error=error@entry=0x7faf398a88) at class.c:2904
#7  0x00000000004fa484 in mono_class_get_implemented_interfaces (
    klass=klass@entry=0x7fa014c780, error=0x7faf398a88, error@entry=0x7faf398b48)
    at class.c:2920
#8  0x00000000004fae0c in setup_interface_offsets (klass=klass@entry=0x7fa014c780,
    cur_slot=cur_slot@entry=4, overwrite=0, overwrite@entry=1) at class.c:3568
#9  0x00000000004f9d78 in mono_class_init (klass=0x7fa014c780) at class.c:5318
#10 0x00000000004f9f04 in mono_class_init (klass=klass@entry=0x7fa00c10c0)
    at class.c:5160
#11 0x0000000000527320 in method_from_memberref (image=image@entry=0x7afd00,
    idx=127, idx@entry=4572, typespec_context=typespec_context@entry=0x0,
    used_context=used_context@entry=0x7faf398dbc, error=error@entry=0x7f9c1d86d8)
    at loader.c:825
#12 0x000000000052760c in mono_get_method_from_token (image=image@entry=0x7afd00,
    token=token@entry=167776732, klass=klass@entry=0x0, context=context@entry=0x0,
    used_context=0x7faf398dbc, used_context@entry=0x7faf398dfc,
    error=error@entry=0x7f9c1d86d8) at loader.c:1619
#13 0x0000000000527bd8 in mono_get_method_checked (image=0x7afd00,
    token=<optimized out>, klass=klass@entry=0x0, context=0x0, error=0x7f9c1d86d8)
    at loader.c:1754
#14 0x0000000000415eac in mini_get_method_allow_open (m=<optimized out>, token=0,
    context=<optimized out>, error=<optimized out>, klass=0x0)
    at method-to-ir.c:7437
#15 0x0000000000415ee8 in mini_get_method (cfg=cfg@entry=0x7f9c1d8220,
    m=m@entry=0x7f981cafe8, token=token@entry=5090172, context=context@entry=0x0,
    klass=0x0) at method-to-ir.c:7447
#16 0x00000000004543f4 in mono_method_to_ir (cfg=cfg@entry=0x7f9c1d8220,
    method=method@entry=0x7f981cafe8, start_bblock=0x7f9c1e3338,
    start_bblock@entry=0x0, end_bblock=0x7f9c1e3470, end_bblock@entry=0x0,
    return_var=return_var@entry=0x0, inline_args=inline_args@entry=0x0,
    inline_offset=inline_offset@entry=0, is_virtual_call=is_virtual_call@entry=0)
    at method-to-ir.c:9254
#17 0x00000000004daba4 in mini_method_compile (method=method@entry=0x7f981cafe8,
    opts=opts@entry=370223615, domain=domain@entry=0x73e680,
    flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0,
    aot_method_index=aot_method_index@entry=-1) at mini.c:3562
---Type <return> to continue, or q <return> to quit---
#18 0x00000000004dc76c in mono_jit_compile_method_inner (
    method=method@entry=0x7f981cafe8, target_domain=target_domain@entry=0x73e680,
    opt=opt@entry=370223615, error=error@entry=0x7faf399468) at mini.c:4254
#19 0x0000000000426b18 in mono_jit_compile_method_with_opt (
    method=method@entry=0x7f981cafe8, opt=370223615, error=0x7faf399468,
    error@entry=0x0) at mini-runtime.c:1989
#20 0x0000000000427300 in mono_jit_compile_method (
    method=method@entry=0x7f981cafe8, error=0x0, error@entry=0x7faf399468)
    at mini-runtime.c:2033
#21 0x000000000049f42c in common_call_trampoline (regs=regs@entry=0x7faf3994e0,
    code=0x7fad363cbc "\277\003", code@entry=0x7faf399a40 "\360\215\224\267\177",
    m=0x7f981cafe8, m@entry=0x7faf399400, vt=vt@entry=0x0,
    vtable_slot=<optimized out>, vtable_slot@entry=0x0, error=0x7faf399468,
    error@entry=0x7faf399488) at mini-trampolines.c:698
#22 0x000000000049fa28 in mono_magic_trampoline (regs=0x7faf3994e0,
    code=0x7faf399a40 "\360\215\224\267\177", arg=0x7faf399400,
    tramp=<optimized out>) at mini-trampolines.c:828
#23 0x0000007fb7d852f4 in ?? ()
#24 0x0000007fb79ba998 in ?? ()
#25 0x0000007fa417b380 in ?? ()

Thread 7 (Thread 0x7faf59b1b0 (LWP 6946)):
#0  mono_arch_flush_icache (code=<optimized out>, size=<optimized out>)
    at mini-arm64.c:1817
#1  0x00000000004da054 in mono_codegen (cfg=cfg@entry=0x7f981c19d0) at mini.c:2486
#2  0x00000000004dad00 in mini_method_compile (method=method@entry=0x180c490,
    opts=opts@entry=370223615, domain=domain@entry=0x73e680,
    flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0,
    aot_method_index=aot_method_index@entry=-1) at mini.c:3955
#3  0x00000000004dc76c in mono_jit_compile_method_inner (
    method=method@entry=0x180c490, target_domain=target_domain@entry=0x73e680,
    opt=opt@entry=370223615, error=error@entry=0x7faf598a58) at mini.c:4254
#4  0x0000000000426b18 in mono_jit_compile_method_with_opt (
    method=method@entry=0x180c490, opt=370223615, error=0x7faf598a58,
    error@entry=0x0) at mini-runtime.c:1989
#5  0x0000000000427300 in mono_jit_compile_method (method=method@entry=0x180c490,
---Type <return> to continue, or q <return> to quit---
    error=0x0, error@entry=0x7faf598a58) at mini-runtime.c:2033
#6  0x000000000049f42c in common_call_trampoline (regs=regs@entry=0x7faf598ad0,
    code=0x7fad2fcf2c "\276'@\371\300\003",
    code@entry=0x1 <error: Cannot access memory at address 0x1>, m=0x180c490,
    m@entry=0x1, vt=vt@entry=0x0, vtable_slot=<optimized out>,
    vtable_slot@entry=0x0, error=0x7faf598a58, error@entry=0x7faf598a78)
    at mini-trampolines.c:698
#7  0x000000000049fa28 in mono_magic_trampoline (regs=0x7faf598ad0,
    code=0x1 <error: Cannot access memory at address 0x1>, arg=0x1,
    tramp=<optimized out>) at mini-trampolines.c:828
#8  0x0000007fb7d852f4 in ?? ()
#9  0x00000000017f5278 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 6 (Thread 0x7faf79b1b0 (LWP 6945)):
#0  0x0000007fb7ee913c in __pthread_mutex_unlock_usercnt ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x000000000054348c in mono_os_mutex_unlock (mutex=0x746220)
    at ../../mono/utils/mono-os-mutex.h:116
#2  mono_image_set_unlock (set=0x746150) at metadata.c:2433
#3  mono_metadata_get_generic_inst (type_argc=2,
    type_argv=type_argv@entry=0x7fa4189f90) at metadata.c:2933
#4  0x00000000005436c0 in mono_metadata_inflate_generic_inst (ginst=0x763b00,
    context=context@entry=0x7fa01b47c8, error=error@entry=0x7faf798828)
    at metadata.c:3037
#5  0x00000000004fcf10 in inflate_generic_type (image=image@entry=0x0,
    type=type@entry=0x7656a0, context=0x7fa01b47c8, context@entry=0x0,
    error=error@entry=0x7faf798828) at class.c:778
#6  0x00000000004fd0c4 in mono_class_inflate_generic_type_with_mempool (image=0x0,
    type=0x7656a0, context=0x0, error=0x7faf798828) at class.c:855
#7  0x000000000054365c in mono_metadata_inflate_generic_inst (ginst=0x763c70,
    context=context@entry=0x7fa01b47c8, error=error@entry=0x7faf798828)
    at metadata.c:3031
#8  0x00000000004fcf10 in inflate_generic_type (image=image@entry=0x0,
    type=type@entry=0x763d70, context=0x7fa01b47c8,
    context@entry=0x4fa3ac <collect_implemented_interfaces_aux+40>,
---Type <return> to continue, or q <return> to quit---
    error=error@entry=0x7faf798828) at class.c:778
#9  0x00000000004fd0c4 in mono_class_inflate_generic_type_with_mempool (image=0x0,
    type=0x763d70, context=0x4fa3ac <collect_implemented_interfaces_aux+40>,
    error=0x7faf798828) at class.c:855
#10 0x00000000004fd6a0 in mono_class_inflate_generic_type_checked (
    error=0x7faf798828, context=<optimized out>, type=0x763d70) at class.c:910
#11 mono_class_inflate_generic_class_checked (gklass=gklass@entry=0x763cb0,
    context=<optimized out>, error=error@entry=0x7faf798828) at class.c:948
#12 0x00000000004f79fc in mono_class_setup_interfaces (
    klass=klass@entry=0x7fa01b47f0, error=error@entry=0x7faf798828) at class.c:10681
#13 0x00000000004fa3ac in collect_implemented_interfaces_aux (
    klass=klass@entry=0x7fa01b47f0, res=0x7faf798748, res@entry=0x7faf798758,
    error=error@entry=0x7faf798828) at class.c:2895
#14 0x00000000004fa484 in mono_class_get_implemented_interfaces (
    klass=klass@entry=0x7fa01b47f0, error=0x7faf798828, error@entry=0x7faf7988e8)
    at class.c:2920
#15 0x00000000004fae0c in setup_interface_offsets (klass=klass@entry=0x7fa01b47f0,
    cur_slot=cur_slot@entry=0, overwrite=127, overwrite@entry=1) at class.c:3568
#16 0x00000000004f9d78 in mono_class_init (klass=klass@entry=0x7fa01b47f0)
    at class.c:5318
#17 0x00000000004fa414 in collect_implemented_interfaces_aux (
    klass=klass@entry=0x7fa014c780, res=0x7faf7989a8, res@entry=0x7faf7989b8,
    error=error@entry=0x7faf798a88) at class.c:2904
#18 0x00000000004fa484 in mono_class_get_implemented_interfaces (
    klass=klass@entry=0x7fa014c780, error=0x7faf798a88, error@entry=0x7faf798b48)
    at class.c:2920
#19 0x00000000004fae0c in setup_interface_offsets (klass=klass@entry=0x7fa014c780,
    cur_slot=cur_slot@entry=4, overwrite=0, overwrite@entry=1) at class.c:3568
#20 0x00000000004f9d78 in mono_class_init (klass=0x7fa014c780) at class.c:5318
#21 0x00000000004f9f04 in mono_class_init (klass=klass@entry=0x7fa00c10c0)
    at class.c:5160
#22 0x0000000000527320 in method_from_memberref (image=image@entry=0x7afd00,
    idx=127, idx@entry=4572, typespec_context=typespec_context@entry=0x0,
    used_context=used_context@entry=0x7faf798dbc, error=error@entry=0x7fa41558f8)
    at loader.c:825
#23 0x000000000052760c in mono_get_method_from_token (image=image@entry=0x7afd00,
---Type <return> to continue, or q <return> to quit---
    token=token@entry=167776732, klass=klass@entry=0x0, context=context@entry=0x0,
    used_context=0x7faf798dbc, used_context@entry=0x7faf798dfc,
    error=error@entry=0x7fa41558f8) at loader.c:1619
#24 0x0000000000527bd8 in mono_get_method_checked (image=0x7afd00,
    token=<optimized out>, klass=klass@entry=0x0, context=0x0, error=0x7fa41558f8)
    at loader.c:1754
#25 0x0000000000415eac in mini_get_method_allow_open (m=<optimized out>, token=0,
    context=<optimized out>, error=<optimized out>, klass=0x0)
    at method-to-ir.c:7437
#26 0x0000000000415ee8 in mini_get_method (cfg=cfg@entry=0x7fa4155440,
    m=m@entry=0x7f981cafe8, token=token@entry=5090172, context=context@entry=0x0,
    klass=0x0) at method-to-ir.c:7447
#27 0x00000000004543f4 in mono_method_to_ir (cfg=cfg@entry=0x7fa4155440,
    method=method@entry=0x7f981cafe8, start_bblock=0x7fa417e6f8,
    start_bblock@entry=0x0, end_bblock=0x7fa417e830, end_bblock@entry=0x0,
    return_var=return_var@entry=0x0, inline_args=inline_args@entry=0x0,
    inline_offset=inline_offset@entry=0, is_virtual_call=is_virtual_call@entry=0)
    at method-to-ir.c:9254
#28 0x00000000004daba4 in mini_method_compile (method=method@entry=0x7f981cafe8,
    opts=opts@entry=370223615, domain=domain@entry=0x73e680,
    flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0,
    aot_method_index=aot_method_index@entry=-1) at mini.c:3562
#29 0x00000000004dc76c in mono_jit_compile_method_inner (
    method=method@entry=0x7f981cafe8, target_domain=target_domain@entry=0x73e680,
    opt=opt@entry=370223615, error=error@entry=0x7faf799468) at mini.c:4254
#30 0x0000000000426b18 in mono_jit_compile_method_with_opt (
    method=method@entry=0x7f981cafe8, opt=370223615, error=0x7faf799468,
    error@entry=0x0) at mini-runtime.c:1989
#31 0x0000000000427300 in mono_jit_compile_method (
    method=method@entry=0x7f981cafe8, error=0x0, error@entry=0x7faf799468)
    at mini-runtime.c:2033
#32 0x000000000049f42c in common_call_trampoline (regs=regs@entry=0x7faf7994e0,
    code=0x7fad363cbc "\277\003", code@entry=0x7faf799a40 "\340\260\202\267\177",
    m=0x7f981cafe8, m@entry=0x7faf799400, vt=vt@entry=0x0,
    vtable_slot=<optimized out>, vtable_slot@entry=0x0, error=0x7faf799468,
    error@entry=0x7faf799488) at mini-trampolines.c:698
---Type <return> to continue, or q <return> to quit---
#33 0x000000000049fa28 in mono_magic_trampoline (regs=0x7faf7994e0,
    code=0x7faf799a40 "\340\260\202\267\177", arg=0x7faf799400,
    tramp=<optimized out>) at mini-trampolines.c:828
#34 0x0000007fb7d852f4 in ?? ()
#35 0x0000007fb79b5f68 in ?? ()
#36 0x0000007fa417b380 in ?? ()

Thread 5 (Thread 0x7faf99b1b0 (LWP 6944)):
#0  0x0000007fb7eed254 in __lll_lock_wait ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000007fb7ee80a4 in pthread_mutex_lock ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#2  0x000000000054346c in mono_os_mutex_lock (mutex=0x746220)
    at ../../mono/utils/mono-os-mutex.h:94
#3  mono_image_set_lock (set=0x746150) at metadata.c:2427
#4  mono_metadata_get_generic_inst (type_argc=0,
    type_argv=type_argv@entry=0x7fa01acc40) at metadata.c:2916
#5  0x00000000005436c0 in mono_metadata_inflate_generic_inst (ginst=0x74b8f0,
    context=context@entry=0x7fa014c758, error=error@entry=0x7faf998a88)
    at metadata.c:3037
#6  0x00000000004fcf10 in inflate_generic_type (image=image@entry=0x0,
    type=type@entry=0x763838, context=0x7fa014c758,
    context@entry=0x4fa3ac <collect_implemented_interfaces_aux+40>,
    error=error@entry=0x7faf998a88) at class.c:778
#7  0x00000000004fd0c4 in mono_class_inflate_generic_type_with_mempool (image=0x0,
    type=0x763838, context=0x4fa3ac <collect_implemented_interfaces_aux+40>,
    error=0x7faf998a88) at class.c:855
#8  0x00000000004fd6a0 in mono_class_inflate_generic_type_checked (
    error=0x7faf998a88, context=<optimized out>, type=0x763838) at class.c:910
#9  mono_class_inflate_generic_class_checked (gklass=gklass@entry=0x763778,
    context=<optimized out>, error=error@entry=0x7faf998a88) at class.c:948
#10 0x00000000004f79fc in mono_class_setup_interfaces (
    klass=klass@entry=0x7fa014c780, error=error@entry=0x7faf998a88) at class.c:10681
#11 0x00000000004fa3ac in collect_implemented_interfaces_aux (
    klass=klass@entry=0x7fa014c780, res=0x7faf9989a8, res@entry=0x7faf9989b8,
    error=error@entry=0x7faf998a88) at class.c:2895
---Type <return> to continue, or q <return> to quit---
#12 0x00000000004fa484 in mono_class_get_implemented_interfaces (
    klass=klass@entry=0x7fa014c780, error=0x7faf998a88, error@entry=0x7faf998b48)
    at class.c:2920
#13 0x00000000004fae0c in setup_interface_offsets (klass=klass@entry=0x7fa014c780,
    cur_slot=cur_slot@entry=4, overwrite=0, overwrite@entry=1) at class.c:3568
#14 0x00000000004f9d78 in mono_class_init (klass=0x7fa014c780) at class.c:5318
#15 0x00000000004f9f04 in mono_class_init (klass=klass@entry=0x7fa00c10c0)
    at class.c:5160
#16 0x0000000000527320 in method_from_memberref (image=image@entry=0x7afd00,
    idx=127, idx@entry=4572, typespec_context=typespec_context@entry=0x0,
    used_context=used_context@entry=0x7faf998dbc, error=error@entry=0x7fa019ad18)
    at loader.c:825
#17 0x000000000052760c in mono_get_method_from_token (image=image@entry=0x7afd00,
    token=token@entry=167776732, klass=klass@entry=0x0, context=context@entry=0x0,
    used_context=0x7faf998dbc, used_context@entry=0x7faf998dfc,
    error=error@entry=0x7fa019ad18) at loader.c:1619
#18 0x0000000000527bd8 in mono_get_method_checked (image=0x7afd00,
    token=<optimized out>, klass=klass@entry=0x0, context=0x0, error=0x7fa019ad18)
    at loader.c:1754
#19 0x0000000000415eac in mini_get_method_allow_open (m=<optimized out>, token=0,
    context=<optimized out>, error=<optimized out>, klass=0x0)
    at method-to-ir.c:7437
#20 0x0000000000415ee8 in mini_get_method (cfg=cfg@entry=0x7fa019a860,
    m=m@entry=0x7f981cafe8, token=token@entry=5090172, context=context@entry=0x0,
    klass=0x0) at method-to-ir.c:7447
#21 0x00000000004543f4 in mono_method_to_ir (cfg=cfg@entry=0x7fa019a860,
    method=method@entry=0x7f981cafe8, start_bblock=0x7fa01aa968,
    start_bblock@entry=0x0, end_bblock=0x7fa01aaaa0, end_bblock@entry=0x0,
    return_var=return_var@entry=0x0, inline_args=inline_args@entry=0x0,
    inline_offset=inline_offset@entry=0, is_virtual_call=is_virtual_call@entry=0)
    at method-to-ir.c:9254
#22 0x00000000004daba4 in mini_method_compile (method=method@entry=0x7f981cafe8,
    opts=opts@entry=370223615, domain=domain@entry=0x73e680,
    flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0,
    aot_method_index=aot_method_index@entry=-1) at mini.c:3562
#23 0x00000000004dc76c in mono_jit_compile_method_inner (
---Type <return> to continue, or q <return> to quit---
    method=method@entry=0x7f981cafe8, target_domain=target_domain@entry=0x73e680,
    opt=opt@entry=370223615, error=error@entry=0x7faf999468) at mini.c:4254
#24 0x0000000000426b18 in mono_jit_compile_method_with_opt (
    method=method@entry=0x7f981cafe8, opt=370223615, error=0x7faf999468,
    error@entry=0x0) at mini-runtime.c:1989
#25 0x0000000000427300 in mono_jit_compile_method (
    method=method@entry=0x7f981cafe8, error=0x0, error@entry=0x7faf999468)
    at mini-runtime.c:2033
#26 0x000000000049f42c in common_call_trampoline (regs=regs@entry=0x7faf9994e0,
    code=0x7fad363cbc "\277\003", code@entry=0x7faf999a40 " \027Y\256\177",
    m=0x7f981cafe8, m@entry=0x7faf999490, vt=vt@entry=0x0,
    vtable_slot=<optimized out>, vtable_slot@entry=0x0, error=0x7faf999468,
    error@entry=0x7faf999488) at mini-trampolines.c:698
#27 0x000000000049fa28 in mono_magic_trampoline (regs=0x7faf9994e0,
    code=0x7faf999a40 " \027Y\256\177", arg=0x7faf999490, tramp=<optimized out>)
    at mini-trampolines.c:828
#28 0x0000007fb7d852f4 in ?? ()
#29 0x0000007fb79aefa8 in ?? ()
#30 0x0000007fa0179c68 in ?? ()

Thread 4 (Thread 0x7fb42a41b0 (LWP 6943)):
#0  0x0000007fb7eea780 in pthread_cond_timedwait@@GLIBC_2.17 ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x000000000061e474 in mono_os_cond_timedwait (timeout_ms=500,
    mutex=0x732160 <sleep_mutex>, cond=0x732190 <sleep_cond>)
    at ../../mono/utils/mono-os-mutex.h:179
#2  mono_coop_cond_timedwait (cond=0x732190 <sleep_cond>,
    mutex=0x732160 <sleep_mutex>, timeout_ms=500)
    at ../../mono/utils/mono-coop-mutex.h:99
#3  sleep_interruptable (alerted=0x7fb42a3888, ms=500) at mono-threads.c:1305
#4  mono_thread_info_sleep (ms=ms@entry=500, alerted=0x7fb42a3888,
    alerted@entry=0x7fb42a38e8) at mono-threads.c:1337
#5  0x000000000057562c in monitor_thread () at threadpool-ms.c:939
#6  0x000000000056e770 in start_wrapper_internal (stack_ptr=0x7fb42a3928,
    start_info=0x0) at threads.c:847
#7  start_wrapper (data=<optimized out>) at threads.c:898
---Type <return> to continue, or q <return> to quit---
#8  0x000000000061dea4 in inner_start_thread (data=0xbd33c0) at mono-threads.c:1180
#9  0x0000007fb7ee5e34 in start_thread ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#10 0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 3 (Thread 0x7fb53741b0 (LWP 6942)):
#0  0x0000007fb7eec61c in do_futex_wait ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000007fb7eec6cc in sem_wait@@GLIBC_2.17 ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#2  0x0000000000593f94 in mono_os_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE,
    sem=0x7227b8 <finalizer_sem>) at ../../mono/utils/mono-os-semaphore.h:209
#3  mono_coop_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE,
    sem=0x7227b8 <finalizer_sem>) at ../../mono/utils/mono-coop-semaphore.h:40
#4  finalizer_thread (unused=<optimized out>) at gc.c:907
#5  0x000000000056e770 in start_wrapper_internal (stack_ptr=0x7fb5373928,
    start_info=0x0) at threads.c:847
#6  start_wrapper (data=<optimized out>) at threads.c:898
#7  0x000000000061dea4 in inner_start_thread (data=0x79cef0) at mono-threads.c:1180
#8  0x0000007fb7ee5e34 in start_thread ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#9  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 2 (Thread 0x7fb77ff1b0 (LWP 6941)):
#0  0x0000007fb7eea3b4 in pthread_cond_wait@@GLIBC_2.17 ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x00000000005fb8d4 in mono_os_cond_wait (mutex=0x7316f8 <lock>,
    cond=0x731758 <work_cond>) at ../../mono/utils/mono-os-mutex.h:146
#2  thread_func (thread_data=0x7fb7ff0008) at sgen-thread-pool.c:110
#3  0x0000007fb7ee5e34 in start_thread ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
#4  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7fb7ff2000 (LWP 6938)):
#0  0x0000007fb7eea3b4 in pthread_cond_wait@@GLIBC_2.17 ()
   from /lib/aarch64-linux-gnu/libpthread.so.0
---Type <return> to continue, or q <return> to quit---
#1  0x000000000058a744 in mono_os_cond_wait (mutex=0x734588, cond=0x7345b8)
    at ../../mono/utils/mono-os-mutex.h:146
#2  mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x734588,
    cond=0x7345b8) at ../../mono/utils/mono-os-mutex.h:160
#3  mono_w32handle_timedwait_signal_naked (alerted=0x7fffffd958, poll=0,
    timeout=<optimized out>, mutex=0x734588, cond=0x7345b8) at w32handle.c:999
#4  mono_w32handle_timedwait_signal_handle (handle=handle@entry=0x409,
    timeout=timeout@entry=4294967295, alerted=0x7fffffd958, poll=0)
    at w32handle.c:1114
#5  0x000000000058b22c in mono_w32handle_wait_one (handle=handle@entry=0x409,
    timeout=timeout@entry=4294967295, alertable=alertable@entry=1)
    at w32handle.c:1248
#6  0x000000000060a344 in wapi_WaitForSingleObjectEx (handle=handle@entry=0x409,
    timeout=timeout@entry=4294967295, alertable=alertable@entry=1) at wait.c:42
#7  0x000000000059a618 in ves_icall_System_Threading_Monitor_Monitor_wait (
    obj=0x7fb791cca8, ms=4294967295) at monitor.c:1348
#8  0x0000007fb54956d8 in System_Threading_Monitor_ObjWait_bool_int_object (
    exitContext=false, millisecondsTimeout=-1, obj=0xffffffffffffffff)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#9  0x0000007fb5495cbc in System_Threading_Monitor_Wait_object_int_bool (
    obj=0x7fb791cca8, millisecondsTimeout=-1, exitContext=false)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#10 0x0000007fb5495d50 in System_Threading_Monitor_Wait_object_int (
    obj=0x7fb791cca8, millisecondsTimeout=-1)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#11 0x0000007fb54a8820 in System_Threading_ManualResetEventSlim_Wait_int_System_Threading_CancellationToken (this=..., millisecondsTimeout=-1, cancellationToken=0)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#12 0x0000007fb54c061c in System_Threading_Tasks_Task_SpinThenBlockingWait_int_System_Threading_CancellationToken (this=..., millisecondsTimeout=-1, cancellationToken=0)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#13 0x0000007fb54c0540 in System_Threading_Tasks_Task_InternalWait_int_System_Threading_CancellationToken (this=..., millisecondsTimeout=-1, cancellationToken=0)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#14 0x0000007fb55f6f48 in System_Runtime_CompilerServices_TaskAwaiter_HandleNonSuccessAndDebuggerNotification_System_Threading_Tasks_Task (task=...)
---Type <return> to continue, or q <return> to quit---
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#15 0x0000007fb55f6ed8 in System_Runtime_CompilerServices_TaskAwaiter_ValidateEnd_System_Threading_Tasks_Task (task=...)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#16 0x0000007fb55f6e78 in System_Runtime_CompilerServices_TaskAwaiter_GetResult (
    this=549755804944) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#17 0x0000007fad452690 in ?? ()
#18 0x0000007fb79271a8 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)


This is with new g_assert (k->interfaces) at line https://github.com/marek-safar/mono/blob/53fd2b40298a39800b20c492f213e5f172f0d9bc/mono/metadata/class.c#L3561

Inspecting the value in gdb shows valid value so it's probably missing or wrong memory barrier somewhere.
Comment 5 Marek Safar 2016-11-10 10:42:37 UTC
Another thread dump now with the g_assert applied

(gdb) T a a bt

Thread 8 (Thread 0x7faf39b1b0 (LWP 16297)):
#0  0x0000007fb7eea780 in pthread_cond_timedwait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000000000574c14 in mono_os_cond_timedwait (timeout_ms=54316, mutex=0xb78890, cond=0xb78860) at ../../mono/utils/mono-os-mutex.h:179
#2  mono_coop_cond_timedwait (timeout_ms=54316, mutex=0xb78890, cond=0xb78860) at ../../mono/utils/mono-coop-mutex.h:99
#3  worker_park () at threadpool-ms.c:550
#4  worker_thread (data=<optimized out>) at threadpool-ms.c:642
#5  0x000000000056e7a8 in start_wrapper_internal (stack_ptr=0x7faf39a928, start_info=0x0) at threads.c:847
#6  start_wrapper (data=<optimized out>) at threads.c:898
#7  0x000000000061dedc in inner_start_thread (data=0x7fa40027d0) at mono-threads.c:1180
#8  0x0000007fb7ee5e34 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
#9  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 7 (Thread 0x7faf59b1b0 (LWP 16296)):
#0  0x0000007fb7eea780 in pthread_cond_timedwait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000000000574c14 in mono_os_cond_timedwait (timeout_ms=38354, mutex=0xb78890, cond=0xb78860) at ../../mono/utils/mono-os-mutex.h:179
#2  mono_coop_cond_timedwait (timeout_ms=38354, mutex=0xb78890, cond=0xb78860) at ../../mono/utils/mono-coop-mutex.h:99
#3  worker_park () at threadpool-ms.c:550
#4  worker_thread (data=<optimized out>) at threadpool-ms.c:642
#5  0x000000000056e7a8 in start_wrapper_internal (stack_ptr=0x7faf59a928, start_info=0x0) at threads.c:847
#6  start_wrapper (data=<optimized out>) at threads.c:898
#7  0x000000000061dedc in inner_start_thread (data=0x7fa40027d0) at mono-threads.c:1180
#8  0x0000007fb7ee5e34 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
#9  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 6 (Thread 0x7faf79b1b0 (LWP 16295)):
#0  0x0000007fb7dc49e8 in raise () from /lib/aarch64-linux-gnu/libc.so.6
#1  0x0000007fb7dc5cf0 in abort () from /lib/aarch64-linux-gnu/libc.so.6
#2  0x0000000000613000 in mono_log_write_logfile (log_domain=<optimized out>, level=<optimized out>, hdr=<optimized out>, message=<optimized out>) at mono-log-common.c:137
#3  0x0000000000626994 in monoeg_g_logv (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x62fd90 "* Assertion at %s:%d, condition `%s' not met\n",
    args=<error reading variable: Cannot access memory at address 0x3f9c>) at goutput.c:115
#4  0x0000000000626ac8 in monoeg_assertion_message (format=format@entry=0x62fd90 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:135
#5  0x00000000004fae2c in setup_interface_offsets (klass=klass@entry=0xebcad0, cur_slot=cur_slot@entry=0, overwrite=127, overwrite@entry=1) at class.c:3561
#6  0x00000000004f9d70 in mono_class_init (klass=klass@entry=0xebcad0) at class.c:5319
#7  0x00000000004fa40c in collect_implemented_interfaces_aux (klass=klass@entry=0xebc9a8, res=0x7faf798de8, res@entry=0x7faf798df8, error=error@entry=0x7faf798ec8) at class.c:2904
#8  0x00000000004fa47c in mono_class_get_implemented_interfaces (klass=klass@entry=0xebc9a8, error=0x7faf798ec8, error@entry=0x7faf798f88) at class.c:2920
#9  0x00000000004fb0d0 in setup_interface_offsets (klass=klass@entry=0xebc9a8, cur_slot=cur_slot@entry=0, overwrite=0, overwrite@entry=1) at class.c:3569
#10 0x00000000004f9d70 in mono_class_init (klass=klass@entry=0xebc9a8) at class.c:5319
#11 0x00000000004fadec in setup_interface_offsets (klass=klass@entry=0xeba458, cur_slot=cur_slot@entry=4, overwrite=0, overwrite@entry=1) at class.c:3564
#12 0x00000000004f9d70 in mono_class_init (klass=0xeba458, klass@entry=0x60c) at class.c:5319
#13 0x00000000004f9f3c in mono_class_init (klass=klass@entry=0xeb0ee8) at class.c:5153
#14 0x0000000000527358 in method_from_memberref (image=image@entry=0x7afd00, idx=127, idx@entry=1548, typespec_context=typespec_context@entry=0x0, used_context=used_context@entry=0x7faf7993ec,
    error=error@entry=0x7fa400de38) at loader.c:825
#15 0x0000000000527644 in mono_get_method_from_token (image=image@entry=0x7afd00, token=token@entry=167773708, klass=klass@entry=0x0, context=context@entry=0x0, used_context=0x7faf7993ec,
    used_context@entry=0x7faf79942c, error=error@entry=0x7fa400de38) at loader.c:1619
#16 0x0000000000527c10 in mono_get_method_checked (image=0x7afd00, token=<optimized out>, klass=klass@entry=0x0, context=0x0, error=0x7fa400de38) at loader.c:1754
#17 0x0000000000415eac in mini_get_method_allow_open (m=<optimized out>, token=127, context=<optimized out>, error=<optimized out>, klass=0x0) at method-to-ir.c:7437
#18 0x0000000000415ee8 in mini_get_method (cfg=cfg@entry=0x7fa400d980, m=m@entry=0xed2b28, token=token@entry=5090276, context=context@entry=0x0, klass=0x0) at method-to-ir.c:7447
#19 0x000000000045445c in mono_method_to_ir (cfg=cfg@entry=0x7fa400d980, method=method@entry=0xed2b28, start_bblock=0x7fa40564b0, start_bblock@entry=0x0, end_bblock=0x7fa40565e8, end_bblock@entry=0x0,
    return_var=return_var@entry=0x0, inline_args=inline_args@entry=0x0, inline_offset=inline_offset@entry=0, is_virtual_call=is_virtual_call@entry=0) at method-to-ir.c:9254
---Type <return> to continue, or q <return> to quit---
#20 0x00000000004dac0c in mini_method_compile (method=method@entry=0xed2b28, opts=opts@entry=370223615, domain=domain@entry=0x73e680, flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0,
    aot_method_index=aot_method_index@entry=-1) at mini.c:3562
#21 0x00000000004dc7d4 in mono_jit_compile_method_inner (method=method@entry=0xed2b28, target_domain=target_domain@entry=0x73e680, opt=opt@entry=370223615, error=error@entry=0x7faf799a98) at mini.c:4254
#22 0x0000000000426b80 in mono_jit_compile_method_with_opt (method=method@entry=0xed2b28, opt=370223615, error=0x7faf799a98, error@entry=0x0) at mini-runtime.c:1989
#23 0x0000000000427368 in mono_jit_compile_method (method=method@entry=0xed2b28, error=0x0, error@entry=0x7faf799a98) at mini-runtime.c:2033
#24 0x000000000049f494 in common_call_trampoline (regs=regs@entry=0x7faf799b10, code=0x7faedbedfc "\271\v@\371\277\003", code@entry=0x402db53d07bb6a7a <error: Cannot access memory at address 0x402db53d07bb6a7a>,
    m=0xed2b28, m@entry=0x4030000000000000, vt=vt@entry=0x0, vtable_slot=<optimized out>, vtable_slot@entry=0x0, error=0x7faf799a98, error@entry=0x7faf799ab8) at mini-trampolines.c:698
#25 0x000000000049fa90 in mono_magic_trampoline (regs=0x7faf799b10, code=0x402db53d07bb6a7a <error: Cannot access memory at address 0x402db53d07bb6a7a>, arg=0x4030000000000000, tramp=<optimized out>)
    at mini-trampolines.c:828
#26 0x0000007fb7d852f4 in ?? ()
#27 0x0000007fb78265d8 in ?? ()
#28 0x0000000000e0f138 in ?? ()

Thread 5 (Thread 0x7faf99b1b0 (LWP 16294)):
#0  0x0000007fb7eea780 in pthread_cond_timedwait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000000000574c14 in mono_os_cond_timedwait (timeout_ms=59313, mutex=0xb78890, cond=0xb78860) at ../../mono/utils/mono-os-mutex.h:179
#2  mono_coop_cond_timedwait (timeout_ms=59313, mutex=0xb78890, cond=0xb78860) at ../../mono/utils/mono-coop-mutex.h:99
#3  worker_park () at threadpool-ms.c:550
#4  worker_thread (data=<optimized out>) at threadpool-ms.c:642
#5  0x000000000056e7a8 in start_wrapper_internal (stack_ptr=0x7faf99a928, start_info=0x0) at threads.c:847
#6  start_wrapper (data=<optimized out>) at threads.c:898
#7  0x000000000061dedc in inner_start_thread (data=0xbd33c0) at mono-threads.c:1180
#8  0x0000007fb7ee5e34 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
#9  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 4 (Thread 0x7fb42a41b0 (LWP 16293)):
#0  0x0000007fb7eea780 in pthread_cond_timedwait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x000000000061e4ac in mono_os_cond_timedwait (timeout_ms=500, mutex=0x732160 <sleep_mutex>, cond=0x732190 <sleep_cond>) at ../../mono/utils/mono-os-mutex.h:179
#2  mono_coop_cond_timedwait (cond=0x732190 <sleep_cond>, mutex=0x732160 <sleep_mutex>, timeout_ms=500) at ../../mono/utils/mono-coop-mutex.h:99
#3  sleep_interruptable (alerted=0x7fb42a3888, ms=500) at mono-threads.c:1305
#4  mono_thread_info_sleep (ms=ms@entry=500, alerted=0x7fb42a3888, alerted@entry=0x7fb42a38e8) at mono-threads.c:1337
#5  0x0000000000575664 in monitor_thread () at threadpool-ms.c:939
#6  0x000000000056e7a8 in start_wrapper_internal (stack_ptr=0x7fb42a3928, start_info=0x0) at threads.c:847
#7  start_wrapper (data=<optimized out>) at threads.c:898
#8  0x000000000061dedc in inner_start_thread (data=0xbd33c0) at mono-threads.c:1180
#9  0x0000007fb7ee5e34 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
#10 0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 3 (Thread 0x7fb53741b0 (LWP 16292)):
#0  0x0000007fb7eec61c in do_futex_wait () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x0000007fb7eec6cc in sem_wait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#2  0x0000000000593fcc in mono_os_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x7227b8 <finalizer_sem>) at ../../mono/utils/mono-os-semaphore.h:209
#3  mono_coop_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x7227b8 <finalizer_sem>) at ../../mono/utils/mono-coop-semaphore.h:40
#4  finalizer_thread (unused=<optimized out>) at gc.c:907
#5  0x000000000056e7a8 in start_wrapper_internal (stack_ptr=0x7fb5373928, start_info=0x0) at threads.c:847
#6  start_wrapper (data=<optimized out>) at threads.c:898
#7  0x000000000061dedc in inner_start_thread (data=0x79cef0) at mono-threads.c:1180
#8  0x0000007fb7ee5e34 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
#9  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

---Type <return> to continue, or q <return> to quit---
Thread 2 (Thread 0x7fb77ff1b0 (LWP 16287)):
#0  0x0000007fb7eea3b4 in pthread_cond_wait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x00000000005fb90c in mono_os_cond_wait (mutex=0x7316f8 <lock>, cond=0x731758 <work_cond>) at ../../mono/utils/mono-os-mutex.h:146
#2  thread_func (thread_data=0x7fb7ff0008) at sgen-thread-pool.c:110
#3  0x0000007fb7ee5e34 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
#4  0x0000007fb7e5c4f0 in clone () from /lib/aarch64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7fb7ff2000 (LWP 16284)):
#0  0x0000007fb7eea3b4 in pthread_cond_wait@@GLIBC_2.17 () from /lib/aarch64-linux-gnu/libpthread.so.0
#1  0x000000000058a77c in mono_os_cond_wait (mutex=0x734240, cond=0x734270) at ../../mono/utils/mono-os-mutex.h:146
#2  mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x734240, cond=0x734270) at ../../mono/utils/mono-os-mutex.h:160
#3  mono_w32handle_timedwait_signal_naked (alerted=0x7fffffd9d8, poll=0, timeout=<optimized out>, mutex=0x734240, cond=0x734270) at w32handle.c:999
#4  mono_w32handle_timedwait_signal_handle (handle=handle@entry=0x402, timeout=timeout@entry=4294967295, alerted=0x7fffffd9d8, poll=0) at w32handle.c:1114
#5  0x000000000058b264 in mono_w32handle_wait_one (handle=handle@entry=0x402, timeout=timeout@entry=4294967295, alertable=alertable@entry=1) at w32handle.c:1248
#6  0x000000000060a37c in wapi_WaitForSingleObjectEx (handle=handle@entry=0x402, timeout=timeout@entry=4294967295, alertable=alertable@entry=1) at wait.c:42
#7  0x000000000059a650 in ves_icall_System_Threading_Monitor_Monitor_wait (obj=0x7fb7b095f8, ms=4294967295) at monitor.c:1348
#8  0x0000007fb54956d8 in System_Threading_Monitor_ObjWait_bool_int_object (exitContext=false, millisecondsTimeout=-1, obj=0xffffffffffffffff) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#9  0x0000007fb5495cbc in System_Threading_Monitor_Wait_object_int_bool (obj=0x7fb7b095f8, millisecondsTimeout=-1, exitContext=false) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#10 0x0000007fb5495d50 in System_Threading_Monitor_Wait_object_int (obj=0x7fb7b095f8, millisecondsTimeout=-1) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#11 0x0000007fb54a8820 in System_Threading_ManualResetEventSlim_Wait_int_System_Threading_CancellationToken (this=..., millisecondsTimeout=-1, cancellationToken=0) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#12 0x0000007fb54c061c in System_Threading_Tasks_Task_SpinThenBlockingWait_int_System_Threading_CancellationToken (this=..., millisecondsTimeout=-1, cancellationToken=0)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#13 0x0000007fb54bd8c8 in System_Threading_Tasks_Task_InternalRunSynchronously_System_Threading_Tasks_TaskScheduler_bool (this=..., scheduler=..., waitForCompletion=true)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#14 0x0000007fb54bd738 in System_Threading_Tasks_Task_RunSynchronously_System_Threading_Tasks_TaskScheduler (this=..., scheduler=...) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#15 0x0000007fb54cd5f4 in System_Threading_Tasks_Parallel_ForWorker_TLocal_REF_int_int_System_Threading_Tasks_ParallelOptions_System_Action_1_int_System_Action_2_int_System_Threading_Tasks_ParallelLoopState_System_Func_4_int_System_Threading_Tasks_ParallelLoopState_TLocal_REF_TLocal_REF_System_Func_1_TLocal_REF_System_Action_1_TLocal_REF (fromInclusive=0, toExclusive=8, parallelOptions=..., body=..., bodyWithState=...,
    bodyWithLocal=..., localInit=..., localFinally=...) from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#16 0x0000007fb54cc860 in System_Threading_Tasks_Parallel_For_int_int_System_Threading_Tasks_ParallelOptions_System_Action_1_int (fromInclusive=0, toExclusive=8, parallelOptions=..., body=...)
   from /marek/mono/mcs/class/lib/build/mscorlib.dll.so
#17 0x0000007faf1234f8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Comment 6 Zoltan Varga 2016-11-11 21:09:30 UTC
This should work now with mono master, had to revert some locking changes.