Bug 15090 - mono crashes when --debug=gdb is specified
Summary: mono crashes when --debug=gdb is specified
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2013-10-01 00:27 UTC by Bassam
Modified: 2013-10-12 20:02 UTC (History)
2 users (show)

Tags:
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 Bassam 2013-10-01 00:27:42 UTC
This happens on every run from mono/master. Mono was built with default settings.

> mono/mini/mono-sgen --debug=gdb mcs/class/lib/net_2_0/nunit-console.exe
Stacktrace:

  at <unknown> <0xffffffff>
  at System.Activator.CreateInstance (System.Type,bool) [0x00044] in /root/build-thirdparty/source/mono-mcs/mcs/class/corlib/System/Activator.cs:315
  at System.Activator.CreateInstance (System.Type) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/class/corlib/System/Activator.cs:222
  at System.Configuration.InternalConfigurationSystem.Init (System.Type,object[]) [0x00007] in /root/build-thirdparty/source/mono-mcs/mcs/class/System.Configuration/System.Configuration/InternalConfigurationFactory.cs:59
  at System.Configuration.InternalConfigurationFactory.Create (System.Type,object[]) [0x00006] in /root/build-thirdparty/source/mono-mcs/mcs/class/System.Configuration/System.Configuration/InternalConfigurationFactory.cs:40
  at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (System.Configuration.ConfigurationUserLevel,System.Reflection.Assembly,string) [0x00102] in /root/build-thirdparty/source/mono-mcs/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs:119
  at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00011] in /root/build-thirdparty/source/mono-mcs/mcs/class/System.Configuration/System.Configuration/ClientConfigurationSystem.cs:49
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (string) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/class/System.Configuration/System.Configuration/ClientConfigurationSystem.cs:61
  at System.Configuration.ConfigurationManager.GetSection (string) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs:162
  at System.Configuration.ConfigurationSettings.GetConfig (string) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/class/System/System.Configuration/ConfigurationSettings.cs:85
  at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x0000a] in /root/build-thirdparty/source/mono-mcs/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs:65
  at System.Diagnostics.Switch.GetConfigFileSetting () [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/class/System/System.Diagnostics/Switch.cs:145
  at System.Diagnostics.Switch.get_SwitchSetting () [0x00012] in /root/build-thirdparty/source/mono-mcs/mcs/class/System/System.Diagnostics/Switch.cs:89
  at System.Diagnostics.TraceSwitch.get_TraceInfo () [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/class/System/System.Diagnostics/TraceSwitch.cs:69
  at NUnit.Core.NTrace.Info (string) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/nunit24/NUnitCore/core/NTrace.cs:66
  at NUnit.ConsoleRunner.Runner.Main (string[]) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/nunit24/ConsoleRunner/nunit-console/Runner.cs:18
  at NUnit.ConsoleRunner.Class1.Main (string[]) [0x00000] in /root/build-thirdparty/source/mono-mcs/mcs/nunit24/ConsoleRunner/nunit-console-exe/Class1.cs:22
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>

Native stacktrace:

	mono/mini/mono-sgen() [0x4bc211]
	mono/mini/mono-sgen() [0x51b56f]
	mono/mini/mono-sgen() [0x427627]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0xf030) [0x7f8838c8f030]
	/lib/x86_64-linux-gnu/libc.so.6(+0x122435) [0x7f8838a18435]
	mono/mini/mono-sgen() [0x4d52af]
	mono/mini/mono-sgen() [0x4d80cd]
	mono/mini/mono-sgen(mono_xdebug_flush+0x33) [0x4f59f3]
	mono/mini/mono-sgen() [0x4f5cc5]
	mono/mini/mono-sgen() [0x4258de]
	mono/mini/mono-sgen() [0x428e80]
	mono/mini/mono-sgen() [0x429a2d]
	mono/mini/mono-sgen() [0x4be2de]
	[0x41ea1186]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7f8836829700 (LWP 31873)]
0x00007f8838c8ec1d in __libc_waitpid (pid=pid@entry=31874, stat_loc=<optimized out>, stat_loc@entry=0x7f883974319c, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41
41	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame 
  2    Thread 0x7f8836829700 (LWP 31873) "mono-sgen" sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
* 1    Thread 0x7f883973c7e0 (LWP 31872) "mono-sgen" 0x00007f8838c8ec1d in __libc_waitpid (pid=pid@entry=31874, stat_loc=<optimized out>, stat_loc@entry=0x7f883974319c, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41

Thread 2 (Thread 0x7f8836829700 (LWP 31873)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
#1  0x000000000067a3d6 in mono_sem_wait (sem=sem@entry=0x9c4ec0, alertable=alertable@entry=1) at mono-semaphore.c:116
#2  0x00000000005d9e15 in finalizer_thread (unused=unused@entry=0x0) at gc.c:1073
#3  0x00000000005b9af4 in start_wrapper_internal (data=0x25e5540) at threads.c:608
#4  start_wrapper (data=0x25e5540) at threads.c:653
#5  0x000000000066dd01 in thread_start_routine (args=args@entry=0x2544600) at wthreads.c:294
#6  0x000000000067f690 in inner_start_thread (arg=0x25e5cb0) at mono-threads-posix.c:49
#7  0x00007f8838c86b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#8  0x00007f88389d0a7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f883973c7e0 (LWP 31872)):
#0  0x00007f8838c8ec1d in __libc_waitpid (pid=pid@entry=31874, stat_loc=<optimized out>, stat_loc@entry=0x7f883974319c, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41
#1  0x00000000004bc318 in mono_handle_native_sigsegv (signal=signal@entry=11, ctx=ctx@entry=0x7f8839743ac0) at mini-exceptions.c:2377
#2  0x000000000051b56f in mono_arch_handle_altstack_exception (sigctx=sigctx@entry=0x7f8839743ac0, fault_addr=<optimized out>, stack_ovf=stack_ovf@entry=0) at exceptions-amd64.c:919
#3  0x0000000000427627 in mono_sigsegv_signal_handler (_dummy=11, info=0x7f8839743bf0, context=0x7f8839743ac0) at mini.c:6600
#4  <signal handler called>
#5  __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:2821
#6  0x00000000004d52af in emit_line_number_info (w=w@entry=0x25e9350, method=0x25d9490, start_symbol=0x0, code=0x403499e0 "H\203\354\030L\211\064$L\213\367H\211t$\bH\213t$\bf\220\350\024\001", code_size=45, debug_info=<error reading variable: Unhandled dwarf expression opcode 0xfa>, debug_info=<error reading variable: Unhandled dwarf expression opcode 0xfa>, end_symbol=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at dwarfwriter.c:1657
#7  0x00000000004d80cd in emit_all_line_number_info (w=0x25e9350) at dwarfwriter.c:892
#8  mono_dwarf_writer_close (w=w@entry=0x25e9350) at dwarfwriter.c:1038
#9  0x00000000004f59f3 in xdebug_end_emit (dw=0x25e9350, w=0x25e71e0, method=<optimized out>) at xdebug.c:210
#10 mono_xdebug_flush () at xdebug.c:263
#11 0x00000000004f5cc5 in mono_save_xdebug_info (cfg=cfg@entry=0x2677240) at xdebug.c:293
#12 0x00000000004258de in mini_method_compile (method=0x26aabc8, opts=opts@entry=101804543, domain=domain@entry=0x2550e50, run_cctors=run_cctors@entry=1, compile_aot=compile_aot@entry=0, parts=parts@entry=0) at mini.c:5493
#13 0x0000000000428e80 in mono_jit_compile_method_inner (jit_ex=0x7fff2f98fd60, opt=101804543, target_domain=0x2550e50, method=0x26aabc8) at mini.c:5796
#14 mono_jit_compile_method_with_opt (method=0x26aabc8, opt=101804543, ex=ex@entry=0x7fff2f98fd60) at mini.c:6067
#15 0x0000000000429a2d in mono_jit_compile_method (method=<optimized out>) at mini.c:6105
#16 0x00000000004be2de in common_call_trampoline (regs=0x7fff2f990058, code=0x4034dd70 "I\213\375A\203}", m=0x26aabc8, vt=0x0, vtable_slot=<optimized out>, need_rgctx_tramp=39716688, tramp=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at mini-trampolines.c:572
#17 0x0000000041ea1186 in ?? ()
#18 0x000000004034dd70 in ?? ()
#19 0x00007f8838401570 in ?? ()
#20 0x00007fff2f990290 in ?? ()
#21 0x00007f88384017a0 in ?? ()
#22 0x00007f88384017a0 in ?? ()
#23 0x00007f8838401488 in ?? ()
#24 0x0000000000000000 in ?? ()

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Bassam 2013-10-11 19:38:55 UTC
FWIW, this seems to work in mono-2-10. It looks like a recent regression.
Comment 2 Zoltan Varga 2013-10-11 20:49:38 UTC
Fixed in master d4741184d320ecd17c674b587c263d1eafb5a0cb.
Comment 3 Bassam 2013-10-12 15:30:44 UTC
Thanks! Verified on linux. On OSX I get the following assert:

 Assertion at image-writer.c:2154, condition `!use_bin_writer' not met

Is that a known issue? Is xdebug support on OSX?
Comment 4 Zoltan Varga 2013-10-12 20:02:07 UTC
Its not supported on OSX. OSX has a completely different executable/shared library file format, and it would be a lot of work to support it.