Bug 39568 - Unmanaged crash: icall.c:5484: Could not resolve type with token 01000008 assembly:System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.IdentityModel.Tokens.IssuerTokenResolver member:<none>
Summary: Unmanaged crash: icall.c:5484: Could not resolve type with token 01000008 ass...
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-13 11:19 UTC by af4178a2
Modified: 2016-03-19 11:24 UTC (History)
3 users (show)

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


Attachments
Code to reproduce the problem (358 bytes, text/x-csharp)
2016-03-13 12:31 UTC, af4178a2
Details
Reference required by the test code (509.00 KB, application/x-msdos-program)
2016-03-13 12:31 UTC, af4178a2
Details
Reference required by the test code (133.25 KB, application/x-msdos-program)
2016-03-13 12:31 UTC, af4178a2
Details

Description af4178a2 2016-03-13 11:19:49 UTC
The crash happens since the update to the following nightly build. Suddenly i do not know what version i was running before.

=======
Version
=======

Mono JIT compiler version 4.5.0 (Nightly 4.5.0.262/2ed8402 Thu Mar 10 19:38:40 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        LLVM:          supported, not enabled.
        GC:            sgen

======
stdout
======

icall.c:5484: Could not resolve type with token 01000008 assembly:System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.IdentityModel.Tokens.IssuerTokenResolver member:<none>

Aborted

======
stderr
======

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes (System.Reflection.Assembly,bool) <IL 0x00014, 0x00060>
  at System.Reflection.Assembly.GetTypes () <0x00016>
  at Mono.CSharp.ReflectionImporter.ImportAssembly (System.Reflection.Assembly,Mono.CSharp.RootNamespace) [0x00008] in /tmp/buildd/mono-4.5.0.262/mcs/mcs/reflection.cs:96
  at Microsoft.CSharp.RuntimeBinder.DynamicContext.Create () [0x000c6] in /tmp/buildd/mono-4.5.0.262/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/DynamicContext.cs:104
  at Microsoft.CSharp.RuntimeBinder.CSharpGetMemberBinder.FallbackGetMember (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject) [0x00000] in /tmp/buildd/mono-4.5.0.262/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs:51
  at Newtonsoft.Json.Utilities.DynamicProxyMetaObject`1/<>c__DisplayClass6_0<T_REF>.<BindGetMember>b__0 (System.Dynamic.DynamicMetaObject) <IL 0x0000d, 0x0002c>
  at Newtonsoft.Json.Utilities.DynamicProxyMetaObject`1<T_REF>.CallMethodWithResult (string,System.Dynamic.DynamicMetaObjectBinder,System.Linq.Expressions.Expression[],Newtonsoft.Json.Utilities.DynamicProxyMetaObject`1/Fallback<T_REF>,Newtonsoft.Json.Utilities.DynamicProxyMetaObject`1/Fallback<T_REF>) <IL 0x00003, 0x0002f>
  at Newtonsoft.Json.Utilities.DynamicProxyMetaObject`1<T_REF>.BindGetMember (System.Dynamic.GetMemberBinder) <IL 0x0004c, 0x001c3>
  at System.Dynamic.GetMemberBinder.Bind (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject[]) [0x00024] in /tmp/buildd/mono-4.5.0.262/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs:90
  at System.Dynamic.DynamicMetaObjectBinder.Bind (object[],System.Collections.ObjectModel.ReadOnlyCollection`1<System.Linq.Expressions.ParameterExpression>,System.Linq.Expressions.LabelTarget) [0x000de] in /tmp/buildd/mono-4.5.0.262/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs:105
  at System.Runtime.CompilerServices.CallSiteBinder.BindCore<T_REF> (System.Runtime.CompilerServices.CallSite`1<T_REF>,object[]) [0x0001c] in /tmp/buildd/mono-4.5.0.262/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs:127
  at System.Dynamic.UpdateDelegates.UpdateAndExecute1<T0_REF, TRet_REF> (System.Runtime.CompilerServices.CallSite,T0_REF) [0x0010d] in /tmp/buildd/mono-4.5.0.262/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:255
  at MyApp.CLI.SignInCommand.OnExecute () [0x001cf] in /home/amino/projects/synaptic/source/MyApp.CLI/SignInCommand.cs:75
  at MyApp.CLI.Command.Execute (System.Collections.Generic.Queue`1<string>) [0x00285] in /home/amino/projects/synaptic/source/MyApp.CLI/Command.cs:194
  at MyApp.CLI.Command.Execute (System.Collections.Generic.Queue`1<string>) [0x00086] in /home/amino/projects/synaptic/source/MyApp.CLI/Command.cs:137
  at MyApp.CLI.MainCommand.Execute (string[]) [0x00057] in /home/amino/projects/synaptic/source/MyApp.CLI/MainCommand.cs:51
  at MyAppCLI.MainClass.Main (string[]) [0x0005b] in /home/amino/projects/synaptic/source/MyAppCLI/Main.cs:30
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00051, 0x000c8>

Native stacktrace:

	mono() [0x4ab2aa]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0) [0x7f19842988d0]
	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f1983cfd067]
	/lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f1983cfe448]
	mono() [0x64a949]
	mono() [0x64ab57]
	mono() [0x64ac02]
	mono() [0x63cbf6]
	mono() [0x53de6d]
	mono() [0x544b10]
	[0x410a1491]

Debug info from gdb:

Mono support loaded.
Mono support loaded.
[New LWP 3520]
[New LWP 3519]
[New LWP 3518]
[New LWP 3517]
[New LWP 3516]
[New LWP 3515]
[New LWP 3509]
[New LWP 3508]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f19842984c9 in __libc_waitpid (pid=pid@entry=3521, stat_loc=stat_loc@entry=0x7ffdecc0cdcc, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
40	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame 
  9    Thread 0x7f19837ff700 (LWP 3508) "mono" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  8    Thread 0x7f19812af700 (LWP 3509) "Finalizer" sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
  7    Thread 0x7f19804ff700 (LWP 3515) "Timer-Scheduler" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  6    Thread 0x7f198067a700 (LWP 3516) "mono" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  5    Thread 0x7f197bccf700 (LWP 3517) "Threadpool work" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  4    Thread 0x7f197bace700 (LWP 3518) "Threadpool work" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  3    Thread 0x7f19801cc700 (LWP 3519) "Threadpool work" 0x00007f1983da7d3d in poll () at ../sysdeps/unix/syscall-template.S:81
  2    Thread 0x7f197b6c1700 (LWP 3520) "Threadpool work" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
* 1    Thread 0x7f1984db5780 (LWP 3507) "mono" 0x00007f19842984c9 in __libc_waitpid (pid=pid@entry=3521, stat_loc=stat_loc@entry=0x7ffdecc0cdcc, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40

Thread 9 (Thread 0x7f19837ff700 (LWP 3508)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00000000006135c4 in mono_os_cond_wait (cond=0x976040 <work_cond>, mutex=<optimized out>) at ../../mono/utils/mono-os-mutex.h:105
#2  thread_func (thread_data=0x0) at sgen-thread-pool.c:118
#3  0x00007f19842910a4 in start_thread (arg=0x7f19837ff700) at pthread_create.c:309
#4  0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 8 (Thread 0x7f19812af700 (LWP 3509)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x00000000005b34ff in mono_os_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x966e40 <finalizer_sem>) at ../../mono/utils/mono-os-semaphore.h:163
#2  mono_coop_sem_wait (sem=<optimized out>, flags=<optimized out>) at ../../mono/utils/mono-coop-semaphore.h:40
#3  finalizer_thread (unused=unused@entry=0x0) at gc.c:726
#4  0x0000000000594174 in start_wrapper_internal (data=<optimized out>) at threads.c:731
#5  start_wrapper (data=<optimized out>) at threads.c:778
#6  0x000000000064382c in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:92
#7  0x00007f19842910a4 in start_thread (arg=0x7f19812af700) at pthread_create.c:309
#8  0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 7 (Thread 0x7f19804ff700 (LWP 3515)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x0000000000619a68 in mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x20fb110, cond=0x20fb138) at ../../mono/utils/mono-os-mutex.h:134
#2  _wapi_handle_timedwait_signal_handle (handle=handle@entry=0x10008, timeout=<optimized out>, alertable=alertable@entry=1, poll=poll@entry=0, alerted=alerted@entry=0x7f19804fe4cc) at handles.c:1554
#3  0x000000000062f74a in wapi_WaitForSingleObjectEx (handle=0x10008, timeout=timeout@entry=99999, alertable=alertable@entry=1) at wait.c:187
#4  0x0000000000593f00 in mono_wait_uninterrupted (multiple=multiple@entry=0, numhandles=numhandles@entry=1, handles=handles@entry=0x7f19804fe578, waitall=waitall@entry=0, ms=ms@entry=99999, thread=<optimized out>, alertable=1) at threads.c:1560
#5  0x00000000005953c5 in ves_icall_System_Threading_WaitHandle_WaitOne_internal (handle=0x10008, ms=99999, exitContext=<optimized out>) at threads.c:1686
#6  0x0000000041010fde in ?? ()
#7  0x0000000002403620 in ?? ()
#8  0x000000000001869f in ?? ()
#9  0x000000000001869f in ?? ()
#10 0x00007f19838d0890 in ?? ()
#11 0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f198067a700 (LWP 3516)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x0000000000642423 in mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x976ec0 <sleep_mutex>, cond=0x976f00 <sleep_cond>) at ../../mono/utils/mono-os-mutex.h:134
#2  mono_coop_cond_timedwait (timeout_ms=<optimized out>, cond=<optimized out>, mutex=<optimized out>) at ../../mono/utils/mono-coop-mutex.h:107
#3  sleep_interruptable (alerted=0x7f1980679de8, ms=500) at mono-threads.c:1162
#4  mono_thread_info_sleep (ms=ms@entry=500, alerted=alerted@entry=0x7f1980679de8) at mono-threads.c:1194
#5  0x0000000000598a38 in monitor_thread () at threadpool-ms.c:895
#6  0x0000000000594174 in start_wrapper_internal (data=<optimized out>) at threads.c:731
#7  start_wrapper (data=<optimized out>) at threads.c:778
#8  0x000000000064382c in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:92
#9  0x00007f19842910a4 in start_thread (arg=0x7f198067a700) at pthread_create.c:309
#10 0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7f197bccf700 (LWP 3517)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x0000000000598661 in mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x261e558, cond=0x261e528) at ../../mono/utils/mono-os-mutex.h:134
#2  mono_coop_cond_timedwait (timeout_ms=<optimized out>, mutex=0x261e558, cond=0x261e528) at ../../mono/utils/mono-coop-mutex.h:107
#3  worker_park () at threadpool-ms.c:527
#4  worker_thread (data=data@entry=0x0) at threadpool-ms.c:618
#5  0x0000000000594174 in start_wrapper_internal (data=<optimized out>) at threads.c:731
#6  start_wrapper (data=<optimized out>) at threads.c:778
#7  0x000000000064382c in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:92
#8  0x00007f19842910a4 in start_thread (arg=0x7f197bccf700) at pthread_create.c:309
#9  0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7f197bace700 (LWP 3518)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x0000000000598661 in mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x261e558, cond=0x261e528) at ../../mono/utils/mono-os-mutex.h:134
#2  mono_coop_cond_timedwait (timeout_ms=<optimized out>, mutex=0x261e558, cond=0x261e528) at ../../mono/utils/mono-coop-mutex.h:107
#3  worker_park () at threadpool-ms.c:527
#4  worker_thread (data=data@entry=0x0) at threadpool-ms.c:618
#5  0x0000000000594174 in start_wrapper_internal (data=<optimized out>) at threads.c:731
#6  start_wrapper (data=<optimized out>) at threads.c:778
#7  0x000000000064382c in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:92
#8  0x00007f19842910a4 in start_thread (arg=0x7f197bace700) at pthread_create.c:309
#9  0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7f19801cc700 (LWP 3519)):
#0  0x00007f1983da7d3d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000000063c3a7 in mono_poll (ufds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at mono-poll.c:26
#2  0x000000000059a422 in poll_event_wait (callback=0x59af00 <wait_callback>, user_data=0x7f19600019d0) at threadpool-ms-io-poll.c:152
#3  0x000000000059b46c in selector_thread (data=<optimized out>) at threadpool-ms-io.c:413
#4  selector_thread (data=data@entry=0x0) at threadpool-ms-io.c:302
#5  0x0000000000594174 in start_wrapper_internal (data=<optimized out>) at threads.c:731
#6  start_wrapper (data=<optimized out>) at threads.c:778
#7  0x000000000064382c in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:92
#8  0x00007f19842910a4 in start_thread (arg=0x7f19801cc700) at pthread_create.c:309
#9  0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f197b6c1700 (LWP 3520)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x0000000000598661 in mono_os_cond_timedwait (timeout_ms=<optimized out>, mutex=0x261e558, cond=0x261e528) at ../../mono/utils/mono-os-mutex.h:134
#2  mono_coop_cond_timedwait (timeout_ms=<optimized out>, mutex=0x261e558, cond=0x261e528) at ../../mono/utils/mono-coop-mutex.h:107
#3  worker_park () at threadpool-ms.c:527
#4  worker_thread (data=data@entry=0x0) at threadpool-ms.c:618
#5  0x0000000000594174 in start_wrapper_internal (data=<optimized out>) at threads.c:731
#6  start_wrapper (data=<optimized out>) at threads.c:778
#7  0x000000000064382c in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:92
#8  0x00007f19842910a4 in start_thread (arg=0x7f197b6c1700) at pthread_create.c:309
#9  0x00007f1983db087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f1984db5780 (LWP 3507)):
#0  0x00007f19842984c9 in __libc_waitpid (pid=pid@entry=3521, stat_loc=stat_loc@entry=0x7ffdecc0cdcc, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1  0x00000000004ab339 in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>, info=<optimized out>) at mini-exceptions.c:2392
#2  <signal handler called>
#3  0x00007f1983cfd067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#4  0x00007f1983cfe448 in __GI_abort () at abort.c:89
#5  0x000000000064a949 in monoeg_log_default_handler (log_domain=<optimized out>, log_level=<optimized out>, message=<optimized out>, unused_data=<optimized out>) at goutput.c:233
#6  monoeg_log_default_handler (log_domain=<optimized out>, log_level=G_LOG_LEVEL_ERROR, message=<optimized out>, unused_data=<optimized out>) at goutput.c:221
#7  0x000000000064ab57 in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7ffdecc0dd28) at goutput.c:113
#8  0x000000000064ac02 in monoeg_g_log (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x7031fd "%s:%d: %s\n") at goutput.c:123
#9  0x000000000063cbf6 in mono_error_assert_ok_pos (error=error@entry=0x7ffdecc0dee0, filename=filename@entry=0x67a814 "icall.c", lineno=lineno@entry=5484) at mono-error.c:127
#10 0x000000000053de6d in mono_module_get_types (domain=domain@entry=0x2107490, image=image@entry=0x2210f70, exceptions=exceptions@entry=0x7ffdecc0ded0, exportedOnly=exportedOnly@entry=0 '\000', error=error@entry=0x7ffdecc0dee0) at icall.c:5484
#11 0x0000000000544b10 in ves_icall_System_Reflection_Assembly_GetTypes (assembly=<optimized out>, exportedOnly=0 '\000') at icall.c:5519
#12 0x00000000410a1491 in ?? ()
#13 0x00007f198131ca90 in ?? ()
#14 0x00007f198397ec78 in ?? ()
#15 0x00007f198397f380 in ?? ()
#16 0x0000000000000026 in ?? ()
#17 0x00007f198131ca90 in ?? ()
#18 0x00000000021312c0 in ?? ()
#19 0x00007f198397f380 in ?? ()
#20 0x00007ffdecc0e050 in ?? ()
#21 0x00007ffdecc0df90 in ?? ()
#22 0x00007f198175b9b7 in System_Reflection_Assembly_GetTypes (this=...) from /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
#23 0x000000004109ff40 in ?? ()
#24 0x00007f198397e638 in ?? ()
#25 0x00007f198397ec78 in ?? ()
#26 0x0000000000000000 in ?? ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 af4178a2 2016-03-13 12:31:11 UTC
Created attachment 15389 [details]
Code to reproduce the problem
Comment 2 af4178a2 2016-03-13 12:31:40 UTC
Created attachment 15390 [details]
Reference required by the test code
Comment 3 af4178a2 2016-03-13 12:31:55 UTC
Created attachment 15391 [details]
Reference required by the test code
Comment 4 af4178a2 2016-03-13 12:34:18 UTC
I am able to reproduce the problem using the attached files.

- test.cs
- Newtonsoft.Json.dll required by the test code
- System.IdentityModel.Tokens.Jwt.dll is loaded dynamically using Assembly.LoadFile

Compile it and run it with

> mcs -r:Newtonsoft.Json.dll test.cs
> mono --debug test.exe
Comment 5 Zoltan Varga 2016-03-19 11:24:26 UTC
Fixed in mono master.

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