Bug 18963 - SIGABRT when creating a struct in csharp (REPL)
Summary: SIGABRT when creating a struct in csharp (REPL)
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-04-11 17:39 UTC by Craig Minihan
Modified: 2014-07-30 11:16 UTC (History)
4 users (show)

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

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

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

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


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

Related Links:
Status:
RESOLVED FIXED

Description Craig Minihan 2014-04-11 17:39:02 UTC
Creating a instance of a structure using new causes a SIGABRT.

The following results in a core dump in 'csharp':

csharp> public class X {};
csharp> var x = new X();
csharp> public struct Y {};
csharp> var y = new Y();
* Assertion at method-to-ir.c:10266, condition `addr' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at Mono.CSharp.Evaluator.Evaluate (string,object&,bool&) <0x000c1>
  at Mono.CSharpShell.Evaluate (string) <0x00053>
  at Mono.CSharpShell.ReadEvalPrintLoopWith (Mono.CSharpShell/ReadLiner) <0x000a3>
  at Mono.CSharpShell.ReadEvalPrintLoop () <0x001ff>
  at Mono.CSharpShell.Run (string[]) <0x0004b>
  at Mono.Driver.Main (string[]) <0x00580>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	/usr/local/bin/mono() [0x4a2a35]
	/lib64/libpthread.so.0() [0x37e060f500]
	/lib64/libc.so.6(gsignal+0x35) [0x37dfe328a5]
	/lib64/libc.so.6(abort+0x175) [0x37dfe34085]
	/usr/local/bin/mono() [0x62d73d]
	/usr/local/bin/mono() [0x62d7e7]
	/usr/local/bin/mono() [0x45d363]
	/usr/local/bin/mono() [0x41aeff]
	/usr/local/bin/mono() [0x41cb73]
	/usr/local/bin/mono() [0x41d67b]
	/usr/local/bin/mono() [0x4a7e04]
	[0x41cf7206]

Debug info from gdb:

Mono support loaded.
[New LWP 28207]
[Thread debugging using libthread_db enabled]
0x00000037e060f09d in waitpid () from /lib64/libpthread.so.0
  2 Thread 0x7f1f636af700 (LWP 28207)  0x00000037e060d720 in sem_wait () from /lib64/libpthread.so.0
* 1 Thread 0x7f1f6b575780 (LWP 28206)  0x00000037e060f09d in waitpid () from /lib64/libpthread.so.0

Thread 2 (Thread 0x7f1f636af700 (LWP 28207)):
#0  0x00000037e060d720 in sem_wait () from /lib64/libpthread.so.0
#1  0x0000000000624268 in mono_sem_wait (sem=0x96bae0, alertable=1) at mono-semaphore.c:119
#2  0x00000000005a1d95 in finalizer_thread (unused=<value optimized out>) at gc.c:1073
#3  0x000000000057fd87 in start_wrapper_internal (data=0x21534e0) at threads.c:643
#4  start_wrapper (data=0x21534e0) at threads.c:688
#5  0x0000000000618153 in thread_start_routine (args=0x21001a8) at wthreads.c:294
#6  0x00000000006293d0 in inner_start_thread (arg=0x2153810) at mono-threads-posix.c:49
#7  0x00000037e0607851 in start_thread () from /lib64/libpthread.so.0
#8  0x00000037dfee890d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f1f6b575780 (LWP 28206)):
#0  0x00000037e060f09d in waitpid () from /lib64/libpthread.so.0
#1  0x00000000004a2ac8 in mono_handle_native_sigsegv (signal=<value optimized out>, ctx=<value optimized out>) at mini-exceptions.c:2299
#2  <signal handler called>
#3  0x00000037dfe328a5 in raise () from /lib64/libc.so.6
#4  0x00000037dfe34085 in abort () from /lib64/libc.so.6
#5  0x000000000062d73d in monoeg_g_logv (log_domain=<value optimized out>, log_level=G_LOG_LEVEL_ERROR, format=<value optimized out>, args=<value optimized out>) at goutput.c:175
#6  0x000000000062d7e7 in monoeg_assertion_message (format=<value optimized out>) at goutput.c:195
#7  0x000000000045d363 in mono_method_to_ir (cfg=<value optimized out>, method="<InteractiveExpressionClass>:Host ()", start_bblock=0x2935140, end_bblock=0x2935268, return_var=0x0, dont_inline=0x2937500, inline_args=0x0, inline_offset=0, is_virtual_call=0) at method-to-ir.c:10266
#8  0x000000000041aeff in mini_method_compile (method="<InteractiveExpressionClass>:Host ()", opts=370239999, domain=0x210ce50, flags=<value optimized out>, parts=0) at mini.c:5193
#9  0x000000000041cb73 in mono_jit_compile_method_inner (method="<InteractiveExpressionClass>:Host ()", opt=370239999, ex=0x7fff6bdea158) at mini.c:5940
#10 mono_jit_compile_method_with_opt (method="<InteractiveExpressionClass>:Host ()", opt=370239999, ex=0x7fff6bdea158) at mini.c:6211
#11 0x000000000041d67b in mono_jit_compile_method (method="<InteractiveExpressionClass>:Host ()") at mini.c:6248
#12 0x00000000004a7e04 in mono_delegate_trampoline (regs=<value optimized out>, code=<value optimized out>, tramp_data=<value optimized out>, tramp=<value optimized out>) at mini-trampolines.c:1064
#13 0x0000000041cf7206 in ?? ()
#14 0x00007f1f65397118 in ?? ()
#15 0x00007f1f65018b70 in ?? ()
#16 0x00007f1f65012800 in ?? ()
#17 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.
=================================================================

Aborted (core dumped)
Comment 1 Craig Minihan 2014-04-11 17:44:50 UTC
If Y has members I don't see the assertion.
Comment 2 Miguel de Icaza [MSFT] 2014-07-27 22:04:22 UTC
I do not see this with Mono 3.6.1.

Please try again.
Comment 3 Craig Minihan 2014-07-30 11:16:26 UTC
Yup, looks good to me.