Closed ivmai closed 6 years ago
Also one gctest run produced the following: Switched to incremental mode Emulating dirty bits with mprotect/signals List reversal produced incorrect list - collector is broken Test failed
Another gctest run showed: Switched to incremental mode Emulating dirty bits with mprotect/signals GC Warning: Failed to expand heap by 8388608 bytes GC Warning: Failed to expand heap by 8388608 bytes ... GC Warning: Failed to expand heap by 8388608 bytes Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS
Reproduced on another configuration: ./configure --enable-werror --disable-gcj-support --disable-thread-local-alloc --disable-disclaim --enable-gc-assertions && make -j check CFLAGS_EXTRA="-m64 -D MARK_BIT_PER_OBJ -O0 -g -DNTHREADS=0"
Not reproduced without MARK_BIT_PER_OBJ, or GC_enable_incremental, or without GC_THREADS, or with GC_MARKERS=1.
Also one gctest run produced the following: Switched to incremental mode Emulating dirty bits with mprotect/signals Caught signal 11: looping in handler
Caused by the following code in alloc8bytes: my_free_list = my_free_list_ptr; my_free_list_ptr = GC_NEXT(my_free_list); // my_free_list == 1
Or, once, it was caused by SIGSEGV in GC_array_mark_proc:
hdr * hhdr = HDR(addr); // addr is valid
size_t sz = hhdr -> hb_sz; // hhdr == 4
Call stack:
# 3 0x00007f4226451f63 in GC_array_mark_proc (addr=0x1d57000,
mark_stack_ptr=0x212a670, mark_stack_limit=0x216a000, env=0)
at extra/../typd_mlc.c:482
# 4 0x00007f422644c24b in GC_mark_from (mark_stack_top=0x212a670,
mark_stack=0x212a000, mark_stack_limit=0x216a000) at extra/../mark.c:784
# 5 0x00007f422644b88c in GC_mark_some (
cold_gc_frame=0x7ffc692edd70 "\300\335.i\374\177") at extra/../mark.c:409
# 6 0x00007f42264429d1 in GC_stopped_mark (
stop_func=0x7f4226441a00
Cygwin/x86: gcc -I include -I libatomic_ops/src -D GC_ASSERTIONS -D GC_THREADS -D NTHREADS=0 -D MARK_BITS_PER_OBJ -O0 -g tests/test.c extra/gc.c
Result: Assertion failure: extra/../reclaim.c:427 GC_ASSERT(sz * hhdr -> hb_n_marks <= HBLKSIZE);
Changing in GC_set_hdr_marks hhdr -> hb_n_marks = n_marks - 1; to hhdr -> hb_n_marks = n_marks;
Solved issue observed on Cygwin/x86 and seems to fix this configuration (./configure --enable-werror --disable-gcj-support --disable-thread-local-alloc --disable-parallel-mark --disable-disclaim --enable-gc-assertions && make -j check CFLAGS_EXTRA="-m64 -D MARK_BIT_PER_OBJ -O0 -g -DNTHREADS=0") but not initially reported configuration (both -m32 and -m64 cases).
Reproduced the failure (list reversal) and SIGSEGV (during hhdr dereference) with ASan/MSan/UBSan. The first two give no error message, UBSan produces useless message:
Emulating dirty bits with mprotect/signals
typd_mlc.c:482:25: runtime error: member access within misaligned address 0x0000
00000002 for type 'hdr' (aka 'struct hblkhdr'), which requires 8 byte alignment
0x000000000002: note: pointer points here
\
Seems to be related. Build: https://travis-ci.org/ivmai/bdwgc/jobs/339424046 (same config) Source: master gctest.log: GC Warning: getcontext failed: using another register retrieval method... Switched to incremental mode Emulating dirty bits with mprotect/signals GC Warning: getcontext failed: using another register retrieval method... GC Warning: getcontext failed: using another register retrieval method... ...
I can't reproduce anything listed above using the latest master except for the following case.
Source: 2add709 (latest master) Host: Ubuntu/x64 How to reproduce:
Alternative configuration: ./configure --enable-werror --disable-handle-fork && make -j check CFLAGS_EXTRA="-m32 -D MARK_BIT_PER_OBJ"
Output: Switched to incremental mode Emulating dirty bits with mprotect/signals List reversal produced incorrect list - collector is broken Test failed
SIGSEGV occurred.
Source: 2add709 (latest master) Host: Ubuntu/x64 ./configure --disable-handle-fork && make -j check CFLAGS_EXTRA="-m32 -D MARK_BIT_PER_OBJ -D NTHREADS=300 -O0"
Stack trace:
# 0 GC_write_fault_handler (sig=11, si=0xdad5d98c, raw_sc=0xdad5da0c)
at extra/../os_dep.c:3358
# 1
List reversal produced incorrect list - collector is broken
Build: https://travis-ci.org/ivmai/bdwgc/jobs/372163105 Source: latest master (b76c7a0)
Reproduced on latest master. gcc -O0 -g -I include -D MARK_BIT_PER_OBJ -D ALL_INTERIOR_POINTERS -D USE_MMAP -D GC_ASSERTIONS -D GC_DISABLE_INCREMENTAL -D NO_TYPED_TEST -m32 tests/test.c extra/gc.c exec a.out 100 times
Switched to incremental mode Emulating dirty bits with mprotect/signals Unexpected bus error or segmentation fault /bin/bash: line 5: 15442 Segmentation fault (core dumped) ${dir}$tst FAIL: gctest
Build: https://travis-ci.org/ivmai/bdwgc/jobs/256171109 Source: 348bc2b (latest master) Compiler: gcc-4.6 (also reproduced with gcc-4.8) Host: Ubuntu/x64 (32 cores) How to reproduce: