New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion at class-accessors.c:31, condition `mono_class_is_ginst (klass)' not met #7095

Closed
slide opened this Issue Feb 17, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@slide
Contributor

slide commented Feb 17, 2018

Steps to Reproduce

  1. Unzip the attachment
  2. Run mono ipy.exe doit.py
  3. See assertion error

mono_assertion.zip

Current Behavior

The code is a reproduction of a test case in IronPython. When the iter method is called with a System.Array[int], an assertion is not met.

Expected Behavior

On MS.NET and previous versions of Mono, this behavior was not seen. The assertion did not occur and the code functioned as expected.

On which platforms did you notice this

[ ] macOS
[x] Linux
[ ] Windows

Version Used:

Mono JIT compiler version 5.8.0.108 (tarball Fri Jan 19 18:15:21 UTC 2018)
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 (concurrent by default)

Stacktrace

* Assertion at class-accessors.c:31, condition `mono_class_is_ginst (klass)' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.RuntimeTypeHandle.type_is_assignable_from (System.Type,System.Type) [0x0000b] in <2e7c1c96edae44d496118948ca617c11>:0
  at System.RuntimeTypeHandle.CanCastTo (System.RuntimeType,System.RuntimeType) [0x00000] in <2e7c1c96edae44d496118948ca617c11>:0
  at System.RuntimeType.IsAssignableFrom (System.Type) [0x00020] in <2e7c1c96edae44d496118948ca617c11>:0
  at IronPython.Runtime.Types.PythonTypeInfo.IterResolver (IronPython.Runtime.Types.PythonTypeInfo/MemberBinder,System.Type) [0x000df] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Types.PythonTypeInfo/OneOffResolver.ResolveMember (IronPython.Runtime.Types.PythonTypeInfo/MemberBinder,Microsoft.Scripting.Actions.MemberRequestKind,System.Type,string) [0x0000f] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Types.PythonTypeInfo.GetMemberGroup (IronPython.Runtime.Types.PythonTypeInfo/MemberBinder,Microsoft.Scripting.Actions.MemberRequestKind,System.Type,string) [0x0000a] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Types.PythonTypeInfo.GetMemberAll (IronPython.Runtime.Binding.PythonBinder,Microsoft.Scripting.Actions.MemberRequestKind,System.Type,string) [0x00006] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Binding.PythonBinder.GetMember (Microsoft.Scripting.Actions.MemberRequestKind,System.Type,string) [0x00015] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Binding.PythonGetMemberBinder.MakeGetMemberTarget<TSelfType_REF> (string,object,IronPython.Runtime.CodeContext) [0x00026] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Binding.PythonGetMemberBinder.BindDelegate<T_REF> (System.Runtime.CompilerServices.CallSite`1<T_REF>,object[]) [0x0029a] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at System.Runtime.CompilerServices.CallSiteBinder.BindCore<T_REF> (System.Runtime.CompilerServices.CallSite`1<T_REF>,object[]) [0x00000] in <b0fca80f08474611b248e2d30bb75230>:0
  at System.Dynamic.UpdateDelegates.UpdateAndExecute2<T0_REF, T1_REF, TRet_REF> (System.Runtime.CompilerServices.CallSite,T0_REF,T1_REF) [0x000fc] in <b0fca80f08474611b248e2d30bb75230>:0
  at IronPython.Runtime.Types.PythonType.TryGetBoundAttr (IronPython.Runtime.CodeContext,object,string,object&) [0x00032] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Operations.PythonOps.TryGetBoundAttr (IronPython.Runtime.CodeContext,object,string,object&) [0x00006] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Runtime.Operations.PythonOps.GetEnumeratorObject (IronPython.Runtime.CodeContext,object) [0x00000] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Modules.Builtin.iter (IronPython.Runtime.CodeContext,object) [0x00000] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at Microsoft.Scripting.Interpreter.FuncCallInstruction`3<T0_REF, T1_REF, TRet_REF>.Run (Microsoft.Scripting.Interpreter.InterpretedFrame) [0x00000] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame) [0x00016] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Interpreter.LightLambda.Run4<T0_REF, T1_REF, T2_REF, T3_REF, TRet_REF> (T0_REF,T1_REF,T2_REF,T3_REF) [0x0006d] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at System.Dynamic.UpdateDelegates.UpdateAndExecute3<T0_REF, T1_REF, T2_REF, TRet_REF> (System.Runtime.CompilerServices.CallSite,T0_REF,T1_REF,T2_REF) [0x0011a] in <b0fca80f08474611b248e2d30bb75230>:0
  at (wrapper delegate-invoke) <Module>.invoke_callvirt_object_Func`5<CallSite, CodeContext, object, object, object>_CallSite_CodeContext_object_object (System.Func`5<System.Runtime.CompilerServices.CallSite, IronPython.Runtime.CodeContext, object, object, object>,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object) [0x00048] in <2e7c1c96edae44d496118948ca617c11>:0
  at Microsoft.Scripting.Interpreter.FuncCallInstruction`6<T0_REF, T1_REF, T2_REF, T3_REF, T4_REF, TRet_REF>.Run (Microsoft.Scripting.Interpreter.InterpretedFrame) [0x00000] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame) [0x00016] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Interpreter.LightLambda.Run4<T0_REF, T1_REF, T2_REF, T3_REF, TRet_REF> (T0_REF,T1_REF,T2_REF,T3_REF) [0x0006d] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at IronPython.Compiler.Ast.CallExpression/Invoke1Instruction.Run (Microsoft.Scripting.Interpreter.InterpretedFrame) [0x00026] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame) [0x00016] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Interpreter.LightLambda.Run1<T0_REF, TRet_REF> (T0_REF) [0x0003e] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at IronPython.Compiler.RuntimeScriptCode.InvokeTarget (Microsoft.Scripting.Runtime.Scope) [0x0006a] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Compiler.RuntimeScriptCode.Run (Microsoft.Scripting.Runtime.Scope) [0x00000] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Hosting.PythonCommandLine.RunFileWorker (string) [0x000e5] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at IronPython.Hosting.PythonCommandLine.RunFile (string) [0x0000f] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at Microsoft.Scripting.Hosting.Shell.CommandLine.Run () [0x0003a] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at IronPython.Hosting.PythonCommandLine.Run () [0x000d8] in <83a1cf22159a4046b85a40a602cd8f81>:0
  at Microsoft.Scripting.Hosting.Shell.CommandLine.Run (Microsoft.Scripting.Hosting.ScriptEngine,Microsoft.Scripting.Hosting.Shell.IConsole,Microsoft.Scripting.Hosting.Shell.ConsoleOptions) [0x0003c] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine () [0x00053] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal () [0x00051] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at PythonConsoleHost.ExecuteInternal () [0x00025] in <5b243a89d89c4e9bbe51fb0f289f69a4>:0
  at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute () [0x00032] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run (string[]) [0x0015b] in <ecaef5a769d94bf4aaeff9acba121150>:0
  at PythonConsoleHost.Main (string[]) [0x00020] in <5b243a89d89c4e9bbe51fb0f289f69a4>:0
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) [0x00054] in <5b243a89d89c4e9bbe51fb0f289f69a4>:0
/proc/self/maps:
00400000-007d4000 r-xp 00000000 fd:00 7078252                            /usr/bin/mono-sgen
009d3000-009d4000 r--p 003d3000 fd:00 7078252                            /usr/bin/mono-sgen
009d4000-009d7000 rw-p 003d4000 fd:00 7078252                            /usr/bin/mono-sgen
009d7000-00a2d000 rw-p 00000000 00:00 0 
02492000-030da000 rw-p 00000000 00:00 0                                  [heap]
406f6000-40706000 rwxp 00000000 00:00 0 
41c4f000-41d6f000 rwxp 00000000 00:00 0 
7fdd60000000-7fdd60021000 rw-p 00000000 00:00 0 
7fdd60021000-7fdd64000000 ---p 00000000 00:00 0 
7fdd669c4000-7fdd66a44000 rw-p 00000000 00:00 0 
7fdd66a48000-7fdd66c00000 r--p 00000000 fd:00 2498064                    /home/USER/Projects/debug/IronPython.dll
7fdd66c00000-7fdd66d00000 rw-p 00000000 00:00 0 
7fdd66d3e000-7fdd66d4e000 rwxp 00000000 00:00 0 
7fdd66d4e000-7fdd6704f000 r--p 00000000 fd:00 7078582                    /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
7fdd6704f000-7fdd672ee000 r--p 00000000 fd:00 7078761                    /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
7fdd672ee000-7fdd673e6000 r--p 00000000 fd:00 8683440                    /usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
7fdd673e6000-7fdd674eb000 r--p 00000000 fd:00 2498068                    /home/USER/Projects/debug/Microsoft.Dynamic.dll
7fdd674eb000-7fdd67a2a000 r-xp 00000000 fd:00 7093298                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7fdd67a2a000-7fdd67c29000 ---p 0053f000 fd:00 7093298                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7fdd67c29000-7fdd67c2a000 r--p 0053e000 fd:00 7093298                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7fdd67c2a000-7fdd67c2b000 rw-p 0053f000 fd:00 7093298                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7fdd67c2b000-7fdd67c48000 rw-p 00000000 00:00 0 
7fdd67c48000-7fdd67fff000 r--p 00000000 fd:00 7078552                    /usr/lib/mono/4.5/mscorlib.dll
7fdd67fff000-7fdd68fff000 rw-p 00000000 00:00 0 
7fdd68fff000-7fdd69000000 ---p 00000000 00:00 0 
7fdd69000000-7fdd69c00000 rw-p 00000000 00:00 0 
7fdd69c01000-7fdd69cae000 r--p 00000000 fd:00 2498065                    /home/USER/Projects/debug/IronPython.Modules.dll
7fdd69cae000-7fdd69cca000 r--p 00000000 fd:00 13370443                   /usr/lib/mono/gac/System.Numerics/4.0.0.0__b77a5c561934e089/System.Numerics.dll
7fdd69cca000-7fdd69ccb000 ---p 00000000 00:00 0 
7fdd69ccb000-7fdd69cd3000 ---p 00000000 00:00 0 
7fdd69cd3000-7fdd69ecb000 rw-p 00000000 00:00 0 
7fdd69ecb000-7fdd6a1a7000 r--p 00000000 fd:00 7081075                    /usr/lib/locale/locale-archive
7fdd6a1a7000-7fdd6a37d000 r-xp 00000000 fd:00 12845138                   /lib/x86_64-linux-gnu/libc-2.26.so
7fdd6a37d000-7fdd6a57d000 ---p 001d6000 fd:00 12845138                   /lib/x86_64-linux-gnu/libc-2.26.so
7fdd6a57d000-7fdd6a581000 r--p 001d6000 fd:00 12845138                   /lib/x86_64-linux-gnu/libc-2.26.so
7fdd6a581000-7fdd6a583000 rw-p 001da000 fd:00 12845138                   /lib/x86_64-linux-gnu/libc-2.26.so
7fdd6a583000-7fdd6a587000 rw-p 00000000 00:00 0 
7fdd6a587000-7fdd6a59d000 r-xp 00000000 fd:00 12849638                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdd6a59d000-7fdd6a79c000 ---p 00016000 fd:00 12849638                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdd6a79c000-7fdd6a79d000 r--p 00015000 fd:00 12849638                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdd6a79d000-7fdd6a79e000 rw-p 00016000 fd:00 12849638                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdd6a79e000-7fdd6a7b8000 r-xp 00000000 fd:00 12845153                   /lib/x86_64-linux-gnu/libpthread-2.26.so
7fdd6a7b8000-7fdd6a9b7000 ---p 0001a000 fd:00 12845153                   /lib/x86_64-linux-gnu/libpthread-2.26.so
7fdd6a9b7000-7fdd6a9b8000 r--p 00019000 fd:00 12845153                   /lib/x86_64-linux-gnu/libpthread-2.26.so
7fdd6a9b8000-7fdd6a9b9000 rw-p 0001a000 fd:00 12845153                   /lib/x86_64-linux-gnu/libpthread-2.26.so
7fdd6a9b9000-7fdd6a9bd000 rw-p 00000000 00:00 0 
7fdd6a9bd000-7fdd6a9c0000 r-xp 00000000 fd:00 12845141                   /lib/x86_64-linux-gnu/libdl-2.26.so
7fdd6a9c0000-7fdd6abbf000 ---p 00003000 fd:00 12845141                   /lib/x86_64-linux-gnu/libdl-2.26.so
7fdd6abbf000-7fdd6abc0000 r--p 00002000 fd:00 12845141                   /lib/x86_64-linux-gnu/libdl-2.26.so
7fdd6abc0000-7fdd6abc1000 rw-p 00003000 fd:00 12845141                   /lib/x86_64-linux-gnu/libdl-2.26.so
7fdd6abc1000-7fdd6abc8000 r-xp 00000000 fd:00 12849536                   /lib/x86_64-linux-gnu/librt-2.26.so
7fdd6abc8000-7fdd6adc7000 ---p 00007000 fd:00 12849536                   /lib/x86_64-linux-gnu/librt-2.26.so
7fdd6adc7000-7fdd6adc8000 r--p 00006000 fd:00 12849536                   /lib/x86_64-linux-gnu/librt-2.26.so
7fdd6adc8000-7fdd6adc9000 rw-p 00007000 fd:00 12849536                   /lib/x86_64-linux-gnu/librt-2.26.so
7fdd6adc9000-7fdd6af1e000 r-xp 00000000 fd:00 12845142                   /lib/x86_64-linux-gnu/libm-2.26.so
7fdd6af1e000-7fdd6b11d000 ---p 00155000 fd:00 12845142                   /lib/x86_64-linux-gnu/libm-2.26.so
7fdd6b11d000-7fdd6b11e000 r--p 00154000 fd:00 12845142                   /lib/x86_64-linux-gnu/libm-2.26.so
7fdd6b11e000-7fdd6b11f000 rw-p 00155000 fd:00 12845142                   /lib/x86_64-linux-gnu/libm-2.26.so
7fdd6b11f000-7fdd6b146000 r-xp 00000000 fd:00 12845062                   /lib/x86_64-linux-gnu/ld-2.26.so
7fdd6b146000-7fdd6b192000 r--p 00000000 fd:00 7079139                    /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
7fdd6b192000-7fdd6b1b0000 r--p 00000000 fd:00 7078650                    /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
7fdd6b1b0000-7fdd6b1d3000 r--p 00000000 fd:00 2498069                    /home/USER/Projects/debug/Microsoft.Scripting.dll
7fdd6b1d3000-7fdd6b284000 rw-p 00000000 00:00 0 
7fdd6b285000-7fdd6b2b7000 rw-p 00000000 00:00 0 
7fdd6b2b7000-7fdd6b316000 ---p 00000000 00:00 0 
7fdd6b316000-7fdd6b31d000 rw-p 00000000 00:00 0 
7fdd6b325000-7fdd6b333000 rw-p 00000000 00:00 0 
7fdd6b333000-7fdd6b338000 r--p 00000000 fd:00 2498067                    /home/USER/Projects/debug/ipy.exe
7fdd6b338000-7fdd6b345000 rw-p 00000000 00:00 0 
7fdd6b345000-7fdd6b346000 rw-s 00000000 00:18 7                          /dev/shm/mono.16795
7fdd6b346000-7fdd6b347000 r--p 00027000 fd:00 12845062                   /lib/x86_64-linux-gnu/ld-2.26.so
7fdd6b347000-7fdd6b348000 rw-p 00028000 fd:00 12845062                   /lib/x86_64-linux-gnu/ld-2.26.so
7fdd6b348000-7fdd6b349000 rw-p 00000000 00:00 0 
7ffdbbd39000-7ffdbbd41000 ---p 00000000 00:00 0 
7ffdbc517000-7ffdbc538000 rw-p 00000000 00:00 0                          [stack]
7ffdbc53a000-7ffdbc53d000 r--p 00000000 00:00 0                          [vvar]
7ffdbc53d000-7ffdbc53f000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Native stacktrace:

	mono() [0x4b3419]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0x13150) [0x7fdd6a7b1150]
	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb) [0x7fdd6a1de0bb]
	/lib/x86_64-linux-gnu/libc.so.6(abort+0x16d) [0x7fdd6a1dff5d]
	mono() [0x6903d9]
	mono(monoeg_g_logv+0x4d) [0x6a543d]
	mono(monoeg_assertion_message+0xa3) [0x6a55d3]
	mono() [0x56ab1f]
	mono() [0x56ab41]
	mono(mono_class_is_assignable_from+0x393) [0x567ab3]
	[0x41c51652]

Debug info from gdb:

[New LWP 16797]
[New LWP 16798]
Mono support loaded.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fdd6a7b0a4a in __waitpid (pid=16799, stat_loc=0x7ffdbc53433c, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
29	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame 
* 1    Thread 0x7fdd6b316780 (LWP 16795) "mono" 0x00007fdd6a7b0a4a in __waitpid (pid=16799, stat_loc=0x7ffdbc53433c, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
  2    Thread 0x7fdd697ff700 (LWP 16797) "SGen worker" 0x00007fdd6a7ac072 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xa2ae68) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  3    Thread 0x7fdd69eca700 (LWP 16798) "Finalizer" 0x00007fdd6a7aef96 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0xa1bfc0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

Thread 3 (Thread 0x7fdd69eca700 (LWP 16798)):
#0  0x00007fdd6a7aef96 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0xa1bfc0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0xa1bfc0, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007fdd6a7af054 in __new_sem_wait_slow (sem=sem@entry=0xa1bfc0, abstime=0x0) at sem_waitcommon.c:181
#3  0x00007fdd6a7af144 in __new_sem_wait (sem=0xa1bfc0) at sem_wait.c:42
#4  0x000000000062ad37 in ?? ()
#5  0x00000000005ef12c in ?? ()
#6  0x00007fdd6a7a57fc in start_thread (arg=0x7fdd69eca700) at pthread_create.c:465
#7  0x00007fdd6a2bbb5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fdd697ff700 (LWP 16797)):
#0  0x00007fdd6a7ac072 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xa2ae68) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0xa2ae80, cond=0xa2ae40) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0xa2ae40, mutex=0xa2ae80) at pthread_cond_wait.c:655
#3  0x0000000000685f9f in ?? ()
#4  0x00007fdd6a7a57fc in start_thread (arg=0x7fdd697ff700) at pthread_create.c:465
#5  0x00007fdd6a2bbb5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fdd6b316780 (LWP 16795)):
#0  0x00007fdd6a7b0a4a in __waitpid (pid=16799, stat_loc=0x7ffdbc53433c, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00000000004b34f6 in ?? ()
#2  <signal handler called>
#3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#4  0x00007fdd6a1dff5d in __GI_abort () at abort.c:90
#5  0x00000000006903d9 in ?? ()
#6  0x00000000006a543d in monoeg_g_logv ()
#7  0x00000000006a55d3 in monoeg_assertion_message ()
#8  0x000000000056ab1f in ?? ()
#9  0x000000000056ab41 in ?? ()
#10 0x0000000000567ab3 in mono_class_is_assignable_from ()
#11 0x0000000041c51652 in ?? ()
#12 0x0000000000000004 in ?? ()
#13 0x00007fdd6b280f40 in ?? ()
#14 0x00007fdd6b280f40 in ?? ()
#15 0x00007fdd6b2190c0 in ?? ()
#16 0x00007fdd6b280f40 in ?? ()
#17 0x00000000024cd890 in ?? ()
#18 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.
=================================================================


@slide

This comment has been minimized.

Contributor

slide commented Feb 17, 2018

Similarly, the following code causes the same assertion failure

import clr
import System
help(System.Array[int])
@marek-safar

This comment has been minimized.

Member

marek-safar commented Feb 19, 2018

@lambdageek does it look familiar?

@lambdageek

This comment has been minimized.

Member

lambdageek commented Feb 21, 2018

Standalone repro - calling IsAssignableFrom on an "array special" generic type definition asserts.

using System;
using System.Reflection;
using System.Collections.Generic;

public class Repro {
	public static void Main () {
		var t = typeof (IEnumerable<>);
		var a = new int[] {1, 2, 3};
		Console.WriteLine (t.IsAssignableFrom (a.GetType ()));
	}
}

Actual result:

* Assertion at class-accessors.c:38, condition `mono_class_is_ginst (klass)' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.RuntimeTypeHandle.type_is_assignable_from (System.Type,System.Type) [0x0000b] in <43638e5eaf024a37bfbcb08e1c4046d0>:0
  at System.RuntimeTypeHandle.CanCastTo (System.RuntimeType,System.RuntimeType) [0x00000] in <43638e5eaf024a37bfbcb08e1c4046d0>:0
  at System.RuntimeType.IsAssignableFrom (System.Type) [0x00020] in <43638e5eaf024a37bfbcb08e1c4046d0>:0
  at Repro.Main () [0x00024] in <8dcf8cb29af54b1c95cc3f4f069a17ea>:0
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) [0x0004c] in <43638e5eaf024a37bfbcb08e1c4046d0>:0

Native stacktrace:

        0   mono                                0x00000001017e0781 mono_handle_native_crash + 257
        1   libsystem_platform.dylib            0x00007fff7a687f5a _sigtramp + 26
        2   ???                                 0x000000010ac05608 0x0 + 4475344392
        3   libsystem_c.dylib                   0x00007fff7a4b2312 abort + 127
        4   mono                                0x00000001019f4b9f mono_log_write_logfile + 351
        5   mono                                0x0000000101a0db93 monoeg_g_logv + 83
        6   mono                                0x0000000101a0ddaf monoeg_assertion_message + 143
        7   mono                                0x00000001018b8f1c mono_class_get_generic_class + 60
        8   mono                                0x00000001018ab26a mono_class_is_assignable_from + 522
        9   ???                                 0x0000000101d6f4c4 0x0 + 4325831876
        10  mono                                0x0000000101737099 mono_jit_runtime_invoke + 1401
        11  mono                                0x0000000101930814 do_runtime_invoke + 100
        12  mono                                0x00000001019345be do_exec_main_checked + 174
        13  mono                                0x00000001017a2d89 mono_jit_exec + 297
        14  mono                                0x00000001017a5bb1 mono_main + 10705
        15  mono                                0x0000000101726d38 main + 264
        16  libdyld.dylib                       0x00007fff7a406115 start + 1
        17  ???     

Expected result (according to .NET Framework):

False

The non-"array special" codepath in mono_class_is_assignable_from works as expected.

lambdageek added a commit to lambdageek/mono that referenced this issue Feb 26, 2018

lambdageek added a commit to lambdageek/mono that referenced this issue Feb 26, 2018

[runtime] Don't assert in mono_class_is_assignable_from on iface gtd
Don't assert when comparing if an "array special interface" is assignable from
an array.

The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.

There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
   var i = typeof (IList<>);
   var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
   var a = iparam.MakeArrayType (); // T[]

   Console.WriteLine (i.IsAssignableFrom (a));
```

But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.

So we can return FALSE here.

Fixes mono#7095

lambdageek added a commit to lambdageek/mono that referenced this issue Feb 26, 2018

lambdageek added a commit to lambdageek/mono that referenced this issue Feb 26, 2018

[runtime] Don't assert in mono_class_is_assignable_from on iface gtd
Don't assert when comparing if an "array special interface" is assignable from
an array.

The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.

There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
   var i = typeof (IList<>);
   var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
   var a = iparam.MakeArrayType (); // T[]

   Console.WriteLine (i.IsAssignableFrom (a));
```

But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.

So we can return FALSE here.

Fixes mono#7095

lambdageek added a commit to lambdageek/mono that referenced this issue Feb 26, 2018

lambdageek added a commit to lambdageek/mono that referenced this issue Feb 26, 2018

[runtime] Don't assert in mono_class_is_assignable_from on iface gtd
Don't assert when comparing if an "array special interface" is assignable from
an array.

The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.

There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
   var i = typeof (IList<>);
   var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
   var a = iparam.MakeArrayType (); // T[]

   Console.WriteLine (i.IsAssignableFrom (a));
```

But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.

So we can return FALSE here.

Fixes mono#7095

alexischr added a commit that referenced this issue Feb 27, 2018

Merge pull request #7286 from lambdageek/fix-gh-7095
[runtime] Don't assert in mono_class_is_assignable_from on iface gtd

@marek-safar marek-safar added this to the 2017-12 milestone Feb 27, 2018

marek-safar added a commit that referenced this issue Mar 1, 2018

[runtime] Don't assert in mono_class_is_assignable_from on iface gtd
Don't assert when comparing if an "array special interface" is assignable from
an array.

The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.

There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
   var i = typeof (IList<>);
   var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
   var a = iparam.MakeArrayType (); // T[]

   Console.WriteLine (i.IsAssignableFrom (a));
```

But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.

So we can return FALSE here.

Fixes #7095

luhenry added a commit that referenced this issue Mar 1, 2018

[2018-02][runtime] Don't assert in mono_class_is_assignable_from on i…
…face gtd (#7290)

* [test] System.Type.IsAssignableFrom of gtd array special interfaces.

Regression test for #7095

* [runtime] Don't assert in mono_class_is_assignable_from on iface gtd

Don't assert when comparing if an "array special interface" is assignable from
an array.

The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.

There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
   var i = typeof (IList<>);
   var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
   var a = iparam.MakeArrayType (); // T[]

   Console.WriteLine (i.IsAssignableFrom (a));
```

But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.

So we can return FALSE here.

Fixes #7095

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Mar 3, 2018

jonpryor added a commit to jonpryor/xamarin-android that referenced this issue Mar 3, 2018

Bump to mono/2017-12/607cbde4
Context: mono/mono#7085
Context: mono/mono#7086
Context: mono/mono#7095
Context: mono/mono#7262

Various SDKs fixes.

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Mar 3, 2018

Bump to mono/2017-12/607cbde4 (#1359)
Context: mono/mono#7085
Context: mono/mono#7086
Context: mono/mono#7095
Context: mono/mono#7262

Various SDKs fixes.

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Apr 25, 2018

Bump to mono/2018-02/0c5a524e (#1289)
Bumps to Java.Interop/master/0afb2b0f
Bumps to llvm/master/a9cfb50e.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=11771
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=15051
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=19436
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=45901
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=56071
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59184
fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60065
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60225
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60298
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60359
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60568
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60756
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60848
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60862
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60900
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60904
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60986
Fixes: https://github.com/mono/mono/issues/59400
Fixes: mono/mono#6169
Fixes: mono/mono#6187
Fixes: mono/mono#6192
Fixes: mono/mono#6255
Fixes: mono/mono#6264
Fixes: mono/mono#6266
Fixes: mono/mono#6281
Fixes: mono/mono#6283
Fixes: mono/mono#6320
Fixes: mono/mono#6339
Fixes: mono/mono#6343
Fixes: mono/mono#6349
Fixes: mono/mono#6379
Fixes: mono/mono#6383
Fixes: mono/mono#6401.
Fixes: mono/mono#6411
Fixes: mono/mono#6414
Fixes: mono/mono#6490
Fixes: mono/mono#6721
Fixes: mono/mono#6767
Fixes: mono/mono#6777
Fixes: mono/mono#6848
Fixes: mono/mono#6940
Fixes: mono/mono#6948
Fixes: mono/mono#6998
Fixes: mono/mono#7016
Fixes: mono/mono#7085
Fixes: mono/mono#7086
Fixes: mono/mono#7095
Fixes: mono/mono#7137
Fixes: mono/mono#7184
Fixes: mono/mono#7240
Fixes: mono/mono#7262
Fixes: mono/mono#7289
Fixes: mono/mono#7338
Fixes: mono/mono#7356
Fixes: mono/mono#7364
Fixes: mono/mono#7378
Fixes: mono/mono#7389
Fixes: mono/mono#7460
Fixes: mono/mono#7535
Fixes: mono/mono#7536
Fixes: mono/mono#7610
Fixes: mono/mono#7624
Fixes: mono/mono#7637
Fixes: mono/mono#7655
Fixes: mono/mono#7657
Fixes: mono/mono#7685
Fixes: mono/mono#7786
Fixes: mono/mono#7792
Fixes: mono/mono#7822
Fixes: mono/mono#7860
Fixes: mono/mono#8089
Fixes: mono/mono#8267
Fixes: mono/mono#8409
Fixes: xamarin/maccore#628
Fixes: xamarin/maccore#629
Fixes: xamarin/maccore#673
Fixes: xamarin/maccore#673
Fixes: #1561

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Aug 8, 2018

Bump to mono/mono:2018-04@f3a2216b (#1503)
Fixes: #1130
Fixes: #1561 (comment)
Fixes: #1845
Fixes: #1951

Context: https://bugzilla.xamarin.com/show_bug.cgi?id=10087
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=11771
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=12850
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18941
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=19436
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=25444
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=33208
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59184
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59400
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59779
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60065
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60843
Context: mono/mono#6174
Context: mono/mono#6178
Context: mono/mono#6180
Context: mono/mono#6181
Context: mono/mono#6186
Context: mono/mono#6187
Context: mono/mono#6211
Context: mono/mono#6266
Context: mono/mono#6579
Context: mono/mono#6666
Context: mono/mono#6752
Context: mono/mono#6801
Context: mono/mono#6812
Context: mono/mono#6848
Context: mono/mono#6940
Context: mono/mono#6948
Context: mono/mono#6998
Context: mono/mono#6999
Context: mono/mono#7016
Context: mono/mono#7085
Context: mono/mono#7086
Context: mono/mono#7095
Context: mono/mono#7134
Context: mono/mono#7137
Context: mono/mono#7145
Context: mono/mono#7184
Context: mono/mono#7240
Context: mono/mono#7262
Context: mono/mono#7289
Context: mono/mono#7338
Context: mono/mono#7356
Context: mono/mono#7364
Context: mono/mono#7378
Context: mono/mono#7389
Context: mono/mono#7449
Context: mono/mono#7460
Context: mono/mono#7535
Context: mono/mono#7536
Context: mono/mono#7537
Context: mono/mono#7565
Context: mono/mono#7588
Context: mono/mono#7596
Context: mono/mono#7610
Context: mono/mono#7613
Context: mono/mono#7620
Context: mono/mono#7624
Context: mono/mono#7637
Context: mono/mono#7655
Context: mono/mono#7657
Context: mono/mono#7661
Context: mono/mono#7685
Context: mono/mono#7696
Context: mono/mono#7729
Context: mono/mono#7786
Context: mono/mono#7792
Context: mono/mono#7805
Context: mono/mono#7822
Context: mono/mono#7828
Context: mono/mono#7860
Context: mono/mono#7864
Context: mono/mono#7903
Context: mono/mono#7920
Context: mono/mono#8089
Context: mono/mono#8143
Context: mono/mono#8267
Context: mono/mono#8311
Context: mono/mono#8340
Context: mono/mono#8409
Context: mono/mono#8417
Context: mono/mono#8430
Context: mono/mono#8698
Context: mono/mono#8701
Context: mono/mono#8712
Context: mono/mono#8721
Context: mono/mono#8726
Context: mono/mono#8866
Context: mono/mono#9023
Context: mono/mono#9031
Context: mono/mono#9033
Context: mono/mono#9044
Context: mono/mono#9179
Context: mono/mono#9318
Context: mono/mono#9318
Context: xamarin/maccore#628
Context: xamarin/maccore#629
Context: xamarin/maccore#673

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Aug 13, 2018

Bump to mono/mono:2018-04@f3a2216b (#1503)
Fixes: #1130
Fixes: #1561 (comment)
Fixes: #1845
Fixes: #1951

Context: https://bugzilla.xamarin.com/show_bug.cgi?id=10087
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=11771
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=12850
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18941
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=19436
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=25444
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=33208
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59184
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59400
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59779
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60065
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60843
Context: mono/mono#6174
Context: mono/mono#6178
Context: mono/mono#6180
Context: mono/mono#6181
Context: mono/mono#6186
Context: mono/mono#6187
Context: mono/mono#6211
Context: mono/mono#6266
Context: mono/mono#6579
Context: mono/mono#6666
Context: mono/mono#6752
Context: mono/mono#6801
Context: mono/mono#6812
Context: mono/mono#6848
Context: mono/mono#6940
Context: mono/mono#6948
Context: mono/mono#6998
Context: mono/mono#6999
Context: mono/mono#7016
Context: mono/mono#7085
Context: mono/mono#7086
Context: mono/mono#7095
Context: mono/mono#7134
Context: mono/mono#7137
Context: mono/mono#7145
Context: mono/mono#7184
Context: mono/mono#7240
Context: mono/mono#7262
Context: mono/mono#7289
Context: mono/mono#7338
Context: mono/mono#7356
Context: mono/mono#7364
Context: mono/mono#7378
Context: mono/mono#7389
Context: mono/mono#7449
Context: mono/mono#7460
Context: mono/mono#7535
Context: mono/mono#7536
Context: mono/mono#7537
Context: mono/mono#7565
Context: mono/mono#7588
Context: mono/mono#7596
Context: mono/mono#7610
Context: mono/mono#7613
Context: mono/mono#7620
Context: mono/mono#7624
Context: mono/mono#7637
Context: mono/mono#7655
Context: mono/mono#7657
Context: mono/mono#7661
Context: mono/mono#7685
Context: mono/mono#7696
Context: mono/mono#7729
Context: mono/mono#7786
Context: mono/mono#7792
Context: mono/mono#7805
Context: mono/mono#7822
Context: mono/mono#7828
Context: mono/mono#7860
Context: mono/mono#7864
Context: mono/mono#7903
Context: mono/mono#7920
Context: mono/mono#8089
Context: mono/mono#8143
Context: mono/mono#8267
Context: mono/mono#8311
Context: mono/mono#8340
Context: mono/mono#8409
Context: mono/mono#8417
Context: mono/mono#8430
Context: mono/mono#8698
Context: mono/mono#8701
Context: mono/mono#8712
Context: mono/mono#8721
Context: mono/mono#8726
Context: mono/mono#8866
Context: mono/mono#9023
Context: mono/mono#9031
Context: mono/mono#9033
Context: mono/mono#9044
Context: mono/mono#9179
Context: mono/mono#9318
Context: mono/mono#9318
Context: xamarin/maccore#628
Context: xamarin/maccore#629
Context: xamarin/maccore#673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment