Bug 30594 - * Assertion at sgen-alloc.c:558, condition `tlab_next_addr_offset != -1' not met
Summary: * Assertion at sgen-alloc.c:558, condition `tlab_next_addr_offset != -1' not met
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: GC (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-29 13:06 UTC by pr0vieh
Modified: 2016-01-03 01:10 UTC (History)
6 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description pr0vieh 2015-05-29 13:06:05 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


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 1 pr0vieh 2015-06-15 18:39:00 UTC
Any News about this problem ?

do you need more information about this ?
Comment 2 pr0vieh 2015-07-29 18:58:48 UTC
/usr/local/bin/mkbundle -o /tlstest/tlstest.exe --static --deps /tlstest.exe --machine-config /usr/local/etc/mono/4.5/machine.config
OS is: Linux
...
Sources: 1 Auto-dependencies: True
   embedding: /tlstest.exe
...
Compiling:
as -o temp.o temp.s 
cc -o /MJ12bundle/tlstest.exe -Wall `pkg-config --cflags mono-2` temp.c  `pkg-config --libs-only-L mono-2` -Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic `pkg-config --libs-only-l mono-2 | sed -e "s/\-lmono-2.0 //"` temp.o
Done
root@ubuntu:/tlstest# ./tlstest.exe

tlstest - Copyright (c) 2004 Novell
....
it works but it use the BoehmGC

/MJ12bundle# export MONO_BUNDLED_OPTIONS="-V"
/MJ12bundle# ./tlstest.exe
Mono JIT compiler version 4.3.0 (master/0e5ea3f)
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)

===================================

Now my Modded mkbundle with the SGEN libs

/usr/local/bin/mkbundle2 -o /MJ12bundle/tlstest.exe --static --deps /tlstest.exe --machine-config /usr/local/etc/mono/4.5/machine.config
OS is: Linux
...
Sources: 1 Auto-dependencies: True
   embedding: /tlstest.exe
...
Compiling:
as -o temp.o temp.s 
cc -o /MJ12bundle/tlstest.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

I get this Assertion

root@ubuntu:/MJ12bundle# ./tlstest.exe
* Assertion at sgen-alloc.c:558, condition `tlab_next_addr_offset != -1' not met

but it has the SGEN-GC

/MJ12bundle# export MONO_BUNDLED_OPTIONS="-V"
/MJ12bundle# ./tlstest.exe
Mono JIT compiler version 4.3.0 (master/0e5ea3f)
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

i forget something to mod ? or is it possible to fix this issue ?
it is reproducible with every exe
Comment 3 Martin H. 2015-11-30 14:39:51 UTC
Did you resolve the issue?

We are running the latest CentOS version 
--> CentOS Linux release 7.1.1503 (Core) 

and latest mono version
--> Mono JIT compiler version 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Nov 12 04:43:41 EST 2015)

Linking with SEGEN
-lmonosgen-2.0 -lm -lrt -ldl -lpthread

And get the following assertion

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


Native stacktrace:

	/usr/lib64/libmonosgen-2.0.so.1(+0xd254c) [0x7fd62a49554c]
	/usr/lib64/libpthread.so.0(+0xf130) [0x7fd6247dc130]
	/usr/lib64/libc.so.6(gsignal+0x37) [0x7fd623c225d7]
	/usr/lib64/libc.so.6(abort+0x148) [0x7fd623c23cc8]
	/usr/lib64/libmonosgen-2.0.so.1(+0x25fc19) [0x7fd62a622c19]
	/usr/lib64/libmonosgen-2.0.so.1(+0x25fe8c) [0x7fd62a622e8c]
	/usr/lib64/libmonosgen-2.0.so.1(+0x260023) [0x7fd62a623023]
	/usr/lib64/libmonosgen-2.0.so.1(+0x20cf13) [0x7fd62a5cff13]
	/usr/lib64/libmonosgen-2.0.so.1(+0x21839f) [0x7fd62a5db39f]
	/usr/lib64/libmonosgen-2.0.so.1(+0x20c4be) [0x7fd62a5cf4be]
	/usr/lib64/libmonosgen-2.0.so.1(+0x1d328c) [0x7fd62a59628c]
	/usr/lib64/libmonosgen-2.0.so.1(+0x44a33) [0x7fd62a407a33]
	/home/martin/test(main+0x1e2) [0x404512]
	/usr/lib64/libc.so.6(__libc_start_main+0xf5) [0x7fd623c0eaf5]
	/home/martin/test() [0x403a39]
Comment 4 pr0vieh 2015-11-30 17:37:34 UTC
No :(

I'm waiting for review by a developer
Comment 5 Timotheus Pokorra 2015-12-22 21:00:58 UTC
we have this same error message with building Mono 4.2.1 on architecture armv7hl. Mono 4.2.1 builds fine with i686 and x86_64.
For full logs see http://koji.fedoraproject.org/koji/taskinfo?taskID=12289721
Comment 6 pr0vieh 2015-12-22 21:17:22 UTC
the bug is six months old
and still no info about it :(
Comment 7 pr0vieh 2015-12-28 15:24:18 UTC
since monolib is linked to monolibsgen
https://github.com/mono/mono/commit/2324a7ad93353a95d3a4ef7dd5a66ff1c322a466

now this always happens when use mkbundle

Hopefully now someone have a look at this issue
Comment 8 pr0vieh 2015-12-31 03:15:59 UTC
a long git bisect session locate this commit as first bad commit
https://github.com/schani/mono/commit/c000cc895a004ecf640a9c8724d6026bd6b92c60

i hope this helps to locate this bug
Comment 9 Zoltan Varga 2016-01-02 04:04:21 UTC
Should be fixed by mono master 6aa7d30d96f1a14845f617ca30508161fa57eaf8.
Comment 10 Timotheus Pokorra 2016-01-02 11:24:08 UTC
Thanks! that works for me, we now have Mono 4.2.1 in Fedora Rawhide
Comment 11 Thomas 2016-01-03 01:10:06 UTC
I confirm compiling from latest master also solve the problem on latest archlinux

Note You need to log in before you can comment on or make changes to this bug.