Bug 1093 - Mono without --debug crashes on LoadAssemblyRaw call with debug info parameter
Summary: Mono without --debug crashes on LoadAssemblyRaw call with debug info parameter
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-28 05:05 UTC by Alexander Petrossian (PAF)
Modified: 2011-09-30 02:21 UTC (History)
3 users (show)

Tags: mono_debugger_lock, mono_debug_open_image, LoadAssemblyRaw
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 Alexander Petrossian (PAF) 2011-09-28 05:05:38 UTC
When mono is started without --debug
when rawSymbolStore is not null here...
AppDomain.CurrentDomain.Load(rawAssembly,rawSymbolStore)

...we get this death:
#6  0x0040a701 in abort () from /lib/libc.so.6
#7  0x0063dd02 in g_logv () from /lib/libglib-2.0.so.0
#8  0x0063dd39 in g_log () from /lib/libglib-2.0.so.0
#9  0x0063ddb6 in g_assert_warning () from /lib/libglib-2.0.so.0
#10 0x081d0b78 in mono_debugger_lock ()
#11 0x0815ddd8 in mono_debug_open_image ()
#12 0x081a00a6 in ves_icall_System_AppDomain_LoadAssemblyRaw ()


[root@rhel5-rusepa-zone log]# /opt/novell/mono/bin/mono --version
Mono JIT compiler version 2.6.7 (tarball Mon Jul 19 18:26:17 UTC 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
	TLS:           __thread
	GC:            Included Boehm (with typed GC and Parallel Mark)
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  x86
	Disabled:      none
[root@rhel5-rusepa-zone log]#
Comment 1 Alexander Petrossian (PAF) 2011-09-28 05:11:37 UTC
A workaround is welcome -- maybe there's a way from C# code to detect if mono is started with --debug key or not?

We would then use
AppDomain.CurrentDomain.Load(rawAssembly)
variant.
Comment 2 Zoltan Varga 2011-09-28 20:04:17 UTC
Fixed in HEAD/2.10 branch. As for a workaround, you might try using the StackTrace class and inspect the filename property of stack frames. Without --debug, those will be null/empty.