Skip to content
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 · 18 comments
Closed

Comments

@slide
Copy link
Contributor

@slide 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
Copy link
Contributor Author

@slide slide commented Feb 17, 2018

Similarly, the following code causes the same assertion failure

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

@marek-safar marek-safar commented Feb 19, 2018

@lambdageek does it look familiar?

@lambdageek
Copy link
Member

@lambdageek 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
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
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
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 referenced this issue Feb 27, 2018
[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
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
…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
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
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
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
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
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
@Wohlstand
Copy link

@Wohlstand Wohlstand commented Mar 7, 2019

I have found it's STILL be reproducable with some other apps, even on Mono Preview 5.20:
pascalabcnet/pascalabcnet#1812 (comment)
Lemme attach executible and dependent file that reproducing this crash...

@Wohlstand
Copy link

@Wohlstand Wohlstand commented Mar 7, 2019

This STILL crash on 5.18 and even on 5.20!
pascalabcnet-dev.zip

Run:

mono pabcnetc.exe lab1-02_draw.pas

And result:

$ mono pabcnetc.exe lab1-02_draw.pas
Loading core...
Подключен парсер PascalABC.NET Language Parser v1.2
Подключен парсер Documentation Comments Tag Parser v0.9
PascalABCCompiler.Core v3.4.2.1991
Copyright (c) 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich
OK 39,277ms
Connected parsers: PascalABC.NET (*.pas); 
Connected conversions: Optimizer; 
Compiling assembly lab1-02_draw.pas...
* Assertion at class-accessors.c:41, condition `mono_class_is_ginst (klass)' not met


=================================================================
	Native Crash Reporting
=================================================================
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.
=================================================================
/proc/self/maps:
4067b000-4068b000 rwxp 00000000 00:00 0 
41f87000-42047000 rwxp 00000000 00:00 0 
55f9ee8f7000-55f9eed43000 r-xp 00000000 08:13 4850616                    /usr/bin/mono-sgen
55f9eef42000-55f9eef49000 r--p 0044b000 08:13 4850616                    /usr/bin/mono-sgen
55f9eef49000-55f9eef4e000 rw-p 00452000 08:13 4850616                    /usr/bin/mono-sgen
55f9eef4e000-55f9eef65000 rw-p 00000000 00:00 0 
55f9f0c9f000-55f9f1b16000 rw-p 00000000 00:00 0                          [heap]
7f4b870bc000-7f4b8713c000 rw-p 00000000 00:00 0 
7f4b87140000-7f4b871c0000 rw-p 00000000 00:00 0 
7f4b871c4000-7f4b87244000 rw-p 00000000 00:00 0 
7f4b87248000-7f4b872c8000 rw-p 00000000 00:00 0 
7f4b872cc000-7f4b8734c000 rw-p 00000000 00:00 0 
7f4b87350000-7f4b873d0000 rw-p 00000000 00:00 0 
7f4b873d4000-7f4b87454000 rw-p 00000000 00:00 0 
7f4b87458000-7f4b874d8000 rw-p 00000000 00:00 0 
7f4b874dc000-7f4b8755c000 rw-p 00000000 00:00 0 
7f4b87560000-7f4b875e0000 rw-p 00000000 00:00 0 
7f4b875e4000-7f4b87664000 rw-p 00000000 00:00 0 
7f4b87668000-7f4b876e8000 rw-p 00000000 00:00 0 
7f4b876ec000-7f4b8776c000 rw-p 00000000 00:00 0 
7f4b8776e000-7f4b87873000 rw-p 00000000 00:00 0 
7f4b87978000-7f4b879f8000 rw-p 00000000 00:00 0 
7f4b879fc000-7f4b87a7c000 rw-p 00000000 00:00 0 
7f4b87a7e000-7f4b87ed5000 rw-p 00000000 00:00 0 
7f4b8832c000-7f4b883ac000 rw-p 00000000 00:00 0 

=================================================================
	Basic Fault Adddress Reporting
=================================================================
Memory around native instruction pointer (0x7f4b9a956e97):0x7f4b9a956e87  d2 4c 89 ce bf 02 00 00 00 b8 0e 00 00 00 0f 05  .L..............
0x7f4b9a956e97  48 8b 8c 24 08 01 00 00 64 48 33 0c 25 28 00 00  H..$....dH3.%(..
0x7f4b9a956ea7  00 44 89 c0 75 1f 48 81 c4 18 01 00 00 c3 0f 1f  .D..u.H.........
0x7f4b9a956eb7  00 48 8b 15 a9 bf 3a 00 f7 d8 41 b8 ff ff ff ff  .H....:...A.....

=================================================================
	Native stacktrace:
=================================================================
        0x55f9eea219a8 - mono : (null)
        0x55f9ee9b7284 - mono : (null)
        0x7f4b9af33890 - /lib/x86_64-linux-gnu/libpthread.so.0 : (null)
        0x7f4b9a956e97 - /lib/x86_64-linux-gnu/libc.so.6 : gsignal
        0x7f4b9a958801 - /lib/x86_64-linux-gnu/libc.so.6 : abort
        0x55f9eec0da77 - mono : (null)
        0x55f9eebf3f93 - mono : (null)
        0x55f9eec0d9f8 - mono : (null)
        0x55f9eec0def3 - mono : monoeg_assertion_message
        0x55f9eeab63cd - mono : (null)
        0x55f9eeab0e99 - mono : (null)
        0x55f9eead0843 - mono : (null)
        0x41f894ff - Unknown

=================================================================
        Telemetry Dumper:
=================================================================
Pkilling 0x7f4b90343700 from 0x7f4b9badd780
Entering thread summarizer pause from 0x7f4b9badd780
Finished thread summarizer pause from 0x7f4b9badd780.

Waiting for dumping threads to resume

Debug info from gdb:


=================================================================
        External Debugger Dump:
=================================================================
[New LWP 20252]
[New LWP 20253]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f4b9af3323a in __waitpid (pid=20264, stat_loc=0x7ffee9f10b14, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
30      ../sysdeps/unix/sysv/linux/waitpid.c: Нет такого файла или каталога.
  Id   Target Id         Frame 
* 1    Thread 0x7f4b9badd780 (LWP 20251) "mono" 0x00007f4b9af3323a in __waitpid (pid=20264, stat_loc=0x7ffee9f10b14, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
  2    Thread 0x7f4b927ff700 (LWP 20252) "SGen worker" 0x00007f4b9af2e9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55f9eef62bc8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  3    Thread 0x7f4b90343700 (LWP 20253) "Finalizer" 0x00007f4b9af316d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x55f9eef53d80) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

Thread 3 (Thread 0x7f4b90343700 (LWP 20253)):
#0  0x00007f4b9af316d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x55f9eef53d80) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x55f9eef53d80, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007f4b9af317c8 in __new_sem_wait_slow (sem=0x55f9eef53d80, abstime=0x0) at sem_waitcommon.c:181
#3  0x000055f9eeb88758 in ?? ()
#4  0x000055f9eeb3e58b in ?? ()
#5  0x00007f4b9af286db in start_thread (arg=0x7f4b90343700) at pthread_create.c:463
#6  0x00007f4b9aa3988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f4b927ff700 (LWP 20252)):
#0  0x00007f4b9af2e9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55f9eef62bc8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x55f9eef62be0, cond=0x55f9eef62ba0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x55f9eef62ba0, mutex=0x55f9eef62be0) at pthread_cond_wait.c:655
#3  0x000055f9eebe98fa in ?? ()
#4  0x00007f4b9af286db in start_thread (arg=0x7f4b927ff700) at pthread_create.c:463
#5  0x00007f4b9aa3988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f4b9badd780 (LWP 20251)):
#0  0x00007f4b9af3323a in __waitpid (pid=20264, stat_loc=0x7ffee9f10b14, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x000055f9eea21bf8 in ?? ()
#2  0x000055f9ee9b7284 in ?? ()
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x00007f4b9a958801 in __GI_abort () at abort.c:79
#6  0x000055f9eec0da77 in monoeg_assert_abort ()
#7  0x000055f9eebf3f93 in ?? ()
#8  0x000055f9eec0d9f8 in ?? ()
#9  0x000055f9eec0def3 in monoeg_assertion_message ()
#10 0x000055f9eeab63cd in ?? ()
#11 0x000055f9eeab0e99 in ?? ()
#12 0x000055f9eead0843 in ?? ()
#13 0x0000000041f894ff in ?? ()
#14 0x0000000000000014 in ?? ()
#15 0x0000000000000003 in ?? ()
#16 0x00007f4b871010c0 in ?? ()
#17 0x0000000000000014 in ?? ()
#18 0x00007f4b871010c0 in ?? ()
#19 0x000055f9f0cdb380 in ?? ()
#20 0x00007ffee9f12530 in ?? ()
#21 0x00007ffee9f123d0 in ?? ()
#22 0x0000000000000000 in ?? ()

=================================================================
        Managed Stacktrace:
=================================================================
          at <unknown> <0xffffffff>
          at System.RuntimeType:GetConstructors_native <0x000de>
          at System.RuntimeType:GetConstructors_internal <0x00054>
          at System.RuntimeType:GetConstructorCandidates <0x0019e>
          at System.RuntimeType:GetConstructors <0x00044>
          at System.Type:GetConstructors <0x00019>
          at PascalABCCompiler.TreeRealization.compiled_type_node:init_constructors <0x00037>
          at PascalABCCompiler.TreeRealization.compiled_type_node:get_type_node <0x000d5>
          at PascalABCCompiler.TreeRealization.compiled_function_node:.ctor <0x0022d>
          at PascalABCCompiler.TreeRealization.compiled_function_node:get_compiled_method <0x00069>
          at PascalABCCompiler.NetHelper.NetHelper:FindName <0x002ad>
          at PascalABCCompiler.TreeRealization.compiled_type_node:compiled_find <0x0001d>
          at PascalABCCompiler.TreeRealization.compiled_type_node:find <0x00079>
          at PascalABCCompiler.TreeRealization.compiled_type_node:find_in_type <0x00048>
          at PascalABCCompiler.TreeRealization.generic_instance_type_node:find_in_type <0x00037>
          at PascalABCCompiler.TreeRealization.common_type_node:find_in_type <0x00996>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit_method_call <0x01628>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x00011>
          at PascalABCCompiler.SyntaxTree.method_call:visit <0x00025>
          at PascalABCCompiler.TreeConverter.returner:visit <0x00024>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:convert_strong <0x0004d>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x001d3>
          at PascalABCCompiler.SyntaxTree.procedure_call:visit <0x00025>
          at PascalABCCompiler.TreeConverter.returner:visit <0x0001f>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:convert_strong <0x000eb>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x0021c>
          at PascalABCCompiler.SyntaxTree.statement_list:visit <0x00025>
          at PascalABCCompiler.TreeConverter.returner:visit <0x0001f>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:convert_strong <0x000eb>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit_program_code <0x0002c>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x0143a>
          at PascalABCCompiler.SyntaxTree.block:visit <0x00025>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:hard_node_test_and_visit <0x00077>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x014a8>
          at PascalABCCompiler.SyntaxTree.procedure_definition:visit <0x00025>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x00364>
          at PascalABCCompiler.SyntaxTree.declarations:visit <0x00025>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:weak_node_test_and_visit <0x00039>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit <0x00273>
          at PascalABCCompiler.SyntaxTree.implementation_node:visit <0x00025>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:hard_node_test_and_visit <0x00077>
          at PascalABCCompiler.TreeConverter.syntax_tree_visitor:visit_implementation <0x002d4>
          at PascalABCCompiler.TreeConverter.SyntaxTreeToSemanticTreeConverter:CompileImplementation <0x00434>
          at PascalABCCompiler.Compiler:CompileUnit <0x030a4>
          at PascalABCCompiler.Compiler:CompileUnit <0x01cff>
          at PascalABCCompiler.Compiler:Compile <0x00416>
          at PascalABCCompiler.Compiler:Compile <0x0007a>
          at PascalABCCompiler.Compiler:Compile <0x00024>
          at PascalABCCompiler.Compiler:Compile <0x0008a>
          at PascalABCCompiler.ConsoleCompiler:CompileAssembly <0x00301>
          at PascalABCCompiler.ConsoleCompiler:Main <0x002ec>
          at <Module>:runtime_invoke_int_object <0x000f4>
=================================================================
Аварийный останов (стек памяти сброшен на диск)
@lambdageek
Copy link
Member

@lambdageek lambdageek commented Mar 29, 2019

Getting somewhere debugging the pascal compiler on mono 6.1.0.713 (master/7a74f15949)

* thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff5fb21f32 libsystem_kernel.dylib`__semwait_signal + 10
    frame #1: 0x00007fff5faad914 libsystem_c.dylib`nanosleep + 199
    frame #2: 0x00000001100cb005 mono`monoeg_g_usleep(microseconds=<unavailable>) at gdate-unix.c:54:9 [opt]
    frame #3: 0x000000010fe54dca mono`mono_handle_native_crash(signal="SIGABRT", mctx=0x00007ffedfe5a8e8, info=0x00007ffedfe5aec8) at mini-exceptions.c:3302:4 [opt]
    frame #4: 0x000000010febaef1 mono`sigabrt_signal_handler(_dummy=6, _info=0x00007ffedfe5aec8, context=0x00007ffedfe5af30) at mini-posix.c:234:3 [opt]
    frame #5: 0x00007fff5fbceb5d libsystem_platform.dylib`_sigtramp + 29
    frame #6: 0x00007fff5fb242c7 libsystem_kernel.dylib`__pthread_kill + 11
    frame #7: 0x00007fff5fbd9bf1 libsystem_pthread.dylib`pthread_kill + 284
    frame #8: 0x00007fff5fa8e6a6 libsystem_c.dylib`abort + 127
    frame #9: 0x00000001100c0737 mono`monoeg_assert_abort at goutput.c:57:3 [opt]
    frame #10: 0x00000001100a1eff mono`mono_log_write_logfile(log_domain=<unavailable>, level=<unavailable>, hdr=<unavailable>, message="* Assertion at class-accessors.c:41, condition `mono_class_is_ginst (klass)' not met\n") at mono-log-common.c:136:3 [opt]
    frame #11: 0x00000001100c0abe mono`monoeg_g_logv_nofree [inlined] monoeg_g_logstr(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, msg=<unavailable>) at goutput.c:134:2 [opt]
    frame #12: 0x00000001100c0a95 mono`monoeg_g_logv_nofree(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="* Assertion at %s:%d, condition `%s' not met\n", args=<unavailable>) at goutput.c:149 [opt]
    frame #13: 0x00000001100c0c3f mono`monoeg_assertion_message(format=<unavailable>) at goutput.c:184:22 [opt]
    frame #14: 0x000000010ff503dc mono`mono_class_get_generic_class(klass=<unavailable>) at class-accessors.c:41:2 [opt]
    frame #15: 0x000000010ff4d69f mono`mono_class_setup_methods [inlined] setup_generic_array_ifaces(klass=<unavailable>, iface=<unavailable>, pos=<unavailable>, cache=0x00007f8b107dfc60) at class-init.c:4137:28 [opt]
    frame #16: 0x000000010ff4d692 mono`mono_class_setup_methods(klass=<unavailable>) at class-init.c:5028 [opt]
  * frame #17: 0x000000010ff6990a mono`ves_icall_RuntimeType_GetConstructors_native(ref_type=<unavailable>, bflags=20, error=0x00007ffedfe5b880) at icall.c:4299:2 [opt]
    frame #18: 0x000000010ff7e99a mono`ves_icall_RuntimeType_GetConstructors_native_raw(a0=<unavailable>, a1=<unavailable>, error=0x00007ffedfe5b880) at icall-def.h:934:1 [opt]
    frame #19: 0x000000011037701e
    frame #20: 0x0000000111d991b0 mscorlib.dll.dylib`System_RuntimeType_GetConstructorCandidates_string_System_Reflection_BindingFlags_System_Reflection_CallingConventions_System_Type___bool + 464
    frame #21: 0x0000000111d99c29 mscorlib.dll.dylib`System_RuntimeType_GetConstructors_System_Reflection_BindingFlags + 89
    frame #22: 0x0000000111d656b2 mscorlib.dll.dylib`System_Type_GetConstructors + 50
    frame #23: 0x0000000114641c8b

It's working with a T[] and trying to set up its IList<T> interface - the problem is that IList<T> here is a generic definition, not a generic instance.

Should have a reduced testcase soon...

@Wohlstand
Copy link

@Wohlstand Wohlstand commented Sep 6, 2019

I see another issue has marked as fixed:
#10201 (comment)
Which assembly now has this fix to let me verify will it work correctly or not? Is that fix exists in "Preview" builds? Or I should build everything from the top myself?
At me now is:

Mono JIT compiler version 6.0.0.327 (tarball Thu Aug 29 21:15:03 UTC 2019)

Which still crash with the same crap...

@marek-safar marek-safar removed this from the 2019-06 (6.4.xx) milestone Oct 1, 2019
@lambdageek lambdageek assigned CoffeeFlux and unassigned lambdageek Oct 1, 2019
@Wohlstand
Copy link

@Wohlstand Wohlstand commented Oct 1, 2019

This still is crashy...

Mono JIT compiler version 6.7.0.771 (tarball Thu Sep 26 14:15:18 UTC 2019)

pascalabcnet.zip (this project: https://github.com/pascalabcnet/pascalabcnet)
run:

mono pabcnetc.exe lab1-03.pas

Looks like I should wait for tomorrow and pull the update and re-test...

@CoffeeFlux
Copy link
Member

@CoffeeFlux CoffeeFlux commented Nov 26, 2019

Seems this can be reproduced with even the most minimal of pascal files:

program test;
begin
end.
@CoffeeFlux
Copy link
Member

@CoffeeFlux CoffeeFlux commented Dec 2, 2019

Some notes:

The crash is occurring because in mono_class_bind_generic_parameters, mono_class_create_generic_inst is returning a GTD since the passed klass's (gclass) cached_class is set to one. Interestingly, this pointer is to the same class created early in startup with the initial use of IList`1.

lookup generic class: IList`1
set cached class: IList`1 0x7feeb701ea60 0x7feeb70181a0
...
bind generic params: got a GTD, IList`1 0x7fe94e01e460 0x7fe94e017ba0
@CoffeeFlux
Copy link
Member

@CoffeeFlux CoffeeFlux commented Dec 6, 2019

@Wohlstand do you work on this pascal compiler? Is there any chance of getting a standalone repro? I'm finding it really difficult to navigate the codebase, and I don't want to push a fix until I'm sure I understand the issue and have a test case I can create.

@CoffeeFlux
Copy link
Member

@CoffeeFlux CoffeeFlux commented Dec 6, 2019

Also, do you know if this used to work in an older version of Mono, or have any idea how long it's been broken for?

@Wohlstand
Copy link

@Wohlstand Wohlstand commented Dec 6, 2019

@Wohlstand do you work on this pascal compiler?

Not mine, I have tried to compile it and try it out, however, it crashing on a compiling and why I reporting. Repo is here already, lemme give you a link to it...

@Wohlstand
Copy link

@Wohlstand Wohlstand commented Dec 6, 2019

The repo of the Pascal compiler I tried to build and it became crashy: https://github.com/pascalabcnet/pascalabcnet
(to build it, simply run a "_RebuildReleaseAndRunTests.sh" script). To crash it, you need to use one "lab1-03.pas" file that is in my ZIP file which will crash as running tests here on my end didn't crashed it, but my manual attempt to compile a code did a crash. Other of my files also were crashed.

@CoffeeFlux
Copy link
Member

@CoffeeFlux CoffeeFlux commented Dec 9, 2019

Minimal repro:

using System;
using System.Collections.Generic;

public class Repro {
	public static void Main() {
		var methods = typeof(IList<>).GetGenericArguments()[0].MakeArrayType().GetInterfaces();
		foreach (var method in methods)
			Console.WriteLine(method);
	}
}

This will currently crash on the first statement in Mono, but I've added the second bit because it appears we have another bug with not sorting the methods? I need to verify if so and then fix that separately.

@Wohlstand
Copy link

@Wohlstand Wohlstand commented Dec 16, 2019

Gonna to try this fix out when I get home...

@vithar
Copy link

@vithar vithar commented Jun 21, 2020

I still have the same problem with pascalabcnet cloned from github master using mono 6.8.0.123 on macOS Catalina 10.15.4.

@vithar
Copy link

@vithar vithar commented Jun 21, 2020

Works fine with 6.13.0.611 (master/4ac081d6df9 Thu Jun 18 00:02:08 EDT 2020)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants
You can’t perform that action at this time.