Bug 9137

Summary: jit crash with xsp
Product: [Mono] Runtime Reporter: olivier dufour <olivier.duff>
Component: JITAssignee: Bugzilla <bugzilla>
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime, vargaz
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description olivier dufour 2012-12-27 05:08:42 UTC

I am on ubuntu 12.12 with mono package and a mono parallele environment.
I have install serviceStack.Examples.

>uname -a 
Linux dufoli-1005PE 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux

When Is use Xsp with old version it work but when I switch to mono parallele env dated of 26 December :
Mono JIT compiler version 3.0.3 (master/717a34f mercredi 26 décembre 2012, 21:18:11 (UTC+0100))
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            Included Boehm (with typed GC and Parallel Mark)

here is the crash:
xsp --port 8081
* Assertion at threads.c:767, condition `((char*)&internal->unused2 - (char*)internal) == mono_defaults.internal_thread_class->fields [mono_defaults.internal_thread_class->field.count - 1].offset' not met


Native stacktrace:

	/home/dufoli/opt/mono-2.10/bin/mono() [0x80eed33]
	/lib/i386-linux-gnu/libc.so.6(gsignal+0x4f) [0xb75ae1df]
	/lib/i386-linux-gnu/libc.so.6(abort+0x175) [0xb75b1825]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x8251011]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x82510a3]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x81bc401]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x81daa58]
	/home/dufoli/opt/mono-2.10/bin/mono(mono_runtime_init+0x17a) [0x81d1f0a]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x80641ff]
	/home/dufoli/opt/mono-2.10/bin/mono(mono_main+0x31f) [0x80c4dcf]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x805c062]
	/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xb75994d3]
	/home/dufoli/opt/mono-2.10/bin/mono() [0x805c215]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.

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)

it seems linked to commit:
Comment 1 Zoltan Varga 2013-01-02 08:48:32 UTC
This means that somehow your 3.0 mono is using a 2.10 mscorlib.dll, or vice versa.
Comment 2 Zoltan Varga 2013-01-02 08:53:27 UTC
The assertion is now fixed in master, a normal error message is now displayed for these cases.