Bug 27756 - mkbundle can not use SGEN
Summary: mkbundle can not use SGEN
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Tools ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-08 12:05 UTC by pr0vieh
Modified: 2015-12-27 14:54 UTC (History)
4 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 pr0vieh 2015-03-08 12:05:02 UTC
root@ubuntu:/# mono -V
Mono JIT compiler version 4.1.0 (master/03f9477 So 8. Mär 16:46:41 CET 2015)
Copyright (C) 2002-2014 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:            sgen


when i use: 
export MONO_BUNDLED_OPTIONS="-V" to display the bundled version info i get Included Boehm

Mono JIT compiler version 4.1.0 (master/03f9477)
Copyright (C) 2002-2014 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)

is it possible to run sgen native with mkbundle e.g. to use AOT ?
Comment 1 pr0vieh 2015-05-11 17:45:32 UTC
When i modify the mkbundle to bring the monosgen-2.0 lib

Compiling:
as -o temp.o temp.s 
cc -o /myapp.exe -Wall `pkg-config --cflags mono-2` temp.c  `pkg-config --libs-only-L mono-2` -Wl,-Bstatic -lmonosgen-2.0 -Wl,-Bdynamic `pkg-config --libs-only-l mono-2 | sed -e "s/\-lmonosgen-2.0 //"` temp.o
Done

it works fine in the mono-4.0.0-branch !

but at master i get this Assertion

* Assertion at sgen-alloc.c:558, condition `tlab_next_addr_offset != -1' not met


Native stacktrace:

	./myapp.exe() [0x8272eec]
	./myapp.exe() [0x8279ed7]
	[0xb7716bc8]
	[0xb7716be0]
	/lib/i386-linux-gnu/libc.so.6(gsignal+0x47) [0xb74f4057]
	/lib/i386-linux-gnu/libc.so.6(abort+0x149) [0xb74f5699]
	./myapp.exe() [0x81c1e8a]
	./myapp.exe() [0x81c1d3b]
	./myapp.exe() [0x81c1de7]
	./myapp.exe() [0x816d502]
	./myapp.exe() [0x8178978]
	./myapp.exe() [0x8149e69]
	./myapp.exe() [0x80c3246]
	./myapp.exe() [0x8065fd7]
	./myapp.exe() [0x805e5d2]
	./myapp.exe() [0x805d1dd]
	/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xde) [0xb74e072e]
	./myapp.exe() [0x805cdf8]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
0xb7716be0 in __kernel_vsyscall ()
  Id   Target Id         Frame 
* 1    Thread 0xb74c6700 (LWP 6890) "myapp.ex" 0xb7716be0 in __kernel_vsyscall ()

Thread 1 (Thread 0xb74c6700 (LWP 6890)):
#0  0xb7716be0 in __kernel_vsyscall ()
#1  0xb7692603 in __waitpid_nocancel () at ../sysdeps/unix/syscall-template.S:81
#2  0x08272f82 in mono_handle_native_sigsegv (signal=6, ctx=0xbfae180c, info=0xbfae178c) at mini-exceptions.c:2226
#3  0x08279ed7 in sigabrt_signal_handler (_dummy=6, _info=0xbfae178c, context=0xbfae180c) at mini-posix.c:208
#4  <signal handler called>
#5  0xb7716be0 in __kernel_vsyscall ()
#6  0xb74f4057 in __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#7  0xb74f5699 in __GI_abort () at abort.c:89
#8  0x081c1e8a in monoeg_log_default_handler (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, message=0xa7a0ce8 "* Assertion at sgen-alloc.c:558, condition `tlab_next_addr_offset != -1' not met\n", unused_data=0x0) at goutput.c:233
#9  0x081c1d3b in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x82940c8 "* Assertion at %s:%d, condition `%s' not met\n", args=0xbfae1d14 "\020]1\b.\002") at goutput.c:113
#10 0x081c1de7 in monoeg_assertion_message (format=0x82940c8 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:133
#11 0x0816d502 in sgen_init_allocator () at sgen-alloc.c:558
#12 0x08178978 in sgen_gc_init () at sgen-gc.c:2993
#13 0x08149e69 in mono_gc_base_init () at sgen-mono.c:2826
#14 0x080c3246 in mono_init_internal (filename=0x0, exe_filename=0x8291508 "myapp.exe", runtime_version=0x0) at domain.c:516
#15 0x080c4415 in mono_init_from_assembly (domain_name=<optimized out>, filename=0x8291508 "myapp.exe") at domain.c:886
#16 0x08065fd7 in mini_init (filename=0x8291508 "myapp.exe", runtime_version=0x0) at mini-runtime.c:3125
#17 0x0805e5d2 in mono_main (argc=3, argv=0xa783008) at driver.c:1905
#18 0x0805d1dd in main ()
Comment 2 pr0vieh 2015-12-27 14:54:41 UTC
since https://github.com/mono/mono/commit/2324a7ad93353a95d3a4ef7dd5a66ff1c322a466
the libmono is pointed to libmonosgen this is working now

thx this can closed but now this happens
https://bugzilla.xamarin.com/show_bug.cgi?id=30594