Bug 5056 - Mono crashes with an assert on an 'arglist' CIL opcode.
Summary: Mono crashes with an assert on an 'arglist' CIL opcode.
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-14 01:51 UTC by Tuomas Tynkkynen
Modified: 2012-05-14 06:16 UTC (History)
3 users (show)

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


Attachments
The crashing code snippet (947 bytes, application/octet-stream)
2012-05-14 01:51 UTC, Tuomas Tynkkynen
Details
The full error message (5.86 KB, text/plain)
2012-05-14 01:52 UTC, Tuomas Tynkkynen
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Tuomas Tynkkynen 2012-05-14 01:51:54 UTC
Created attachment 1876 [details]
The crashing code snippet

Running the attached snippet containing a 'arglist' opcode with Mono 2.10.8.1 (from ubuntu precise distribution) causes an assertion failure.

$ cat arglist.cil
...
    .method public static hidebysig default object foo ()  cil managed {
	.maxstack 8
	IL_0000:  arglist 
	IL_0001:  ret 
    }
...
	IL_0006:  call object class Foo::foo()
	IL_000b:  call void class [mscorlib]System.Console::WriteLine(object)

$ ilasm arglist.cil
$ mono arglist.exe

* Assertion at method-to-ir.c:11641, condition `load_opcode != OP_LOADV_MEMBASE' not met

...
Debug info from gdb:

0x001da416 in __kernel_vsyscall ()
  Id   Target Id         Frame 
  5    Thread 0xb76fcb40 (LWP 25458) "mono" 0x001da416 in __kernel_vsyscall ()
  4    Thread 0xb6efbb40 (LWP 25459) "mono" 0x001da416 in __kernel_vsyscall ()
  3    Thread 0xb66fab40 (LWP 25460) "mono" 0x001da416 in __kernel_vsyscall ()
  2    Thread 0xb5c1cb40 (LWP 25461) "mono" 0x001da416 in __kernel_vsyscall ()
* 1    Thread 0xb7701700 (LWP 25457) "mono" 0x001da416 in __kernel_vsyscall ()

...

Thread 1 (Thread 0xb7701700 (LWP 25457)):
#0  0x001da416 in __kernel_vsyscall ()
#1  0x00d0e9db in read () from /lib/i386-linux-gnu/libpthread.so.0
#2  0x080e18e7 in read (__nbytes=1024, __buf=0xbfce73cc, __fd=<optimized out>) at /usr/include/i386-linux-gnu/bits/unistd.h:45
#3  mono_handle_native_sigsegv (signal=6, ctx=0xbfce787c) at mini-exceptions.c:2208
#4  <signal handler called>
#5  0x001da416 in __kernel_vsyscall ()
#6  0x00b571ef in raise () from /lib/i386-linux-gnu/libc.so.6
#7  0x00b5a835 in abort () from /lib/i386-linux-gnu/libc.so.6
#8  0x08214c47 in monoeg_g_logv (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>, args=<optimized out>) at goutput.c:129
#9  monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x823b5ec "* Assertion at %s:%d, condition `%s' not met\n", args=0xbfce7d14 "\320\304#\by-") at goutput.c:113
#10 0x08214cc3 in monoeg_assertion_message (format=0x823b5ec "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:153
#11 0x080a06c9 in mono_spill_global_vars (cfg=0x8666ff0, need_local_opts=0xbfce8014) at method-to-ir.c:11641
#12 0x08063ad8 in mini_method_compile (method=0x861973c, opts=59861503, domain=0x34e58, run_cctors=1, compile_aot=0, parts=0) at mini.c:4813
#13 0x0806414c in mono_jit_compile_method_inner (jit_ex=0xbfce81ac, opt=59861503, target_domain=0x34e58, method=0x861973c) at mini.c:5180
#14 mono_jit_compile_method_with_opt (method=0x861973c, opt=59861503, ex=0xbfce81ac) at mini.c:5404
#15 0x08064db2 in mono_jit_runtime_invoke (method=0x861973c, obj=0x0, params=0xbfce822c, exc=0x0) at mini.c:5626
#16 0x081a422f in mono_runtime_invoke (method=0x861973c, obj=0x0, params=0xbfce822c, exc=0x0) at object.c:2755
#17 0x081a7025 in mono_runtime_exec_main (method=0x861973c, args=0x3be00, exc=0x0) at object.c:3938
#18 0x080bb80b in main_thread_handler (user_data=<synthetic pointer>) at driver.c:1003
#19 mono_main (argc=2, argv=0xbfce83f4) at driver.c:1855
#20 0x0805998f in mono_main_with_options (argv=0xbfce83f4, argc=2) at main.c:66
#21 main (argc=2, argv=0xbfce83f4) at main.c:97
Comment 1 Tuomas Tynkkynen 2012-05-14 01:52:53 UTC
Created attachment 1877 [details]
The full error message
Comment 2 Zoltan Varga 2012-05-14 06:16:06 UTC
The assert has been fixed, we now throw an exception, since this is not valid IL. However, the mono JIT is not supposed to do full verification, using the mono verifier for that.