ivmai / bdwgc

The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)
https://www.hboehm.info/gc/
Other
2.98k stars 407 forks source link

SEGV in GC_push_all_eager (OS X, 32-bit, ASan) #434

Open ivmai opened 2 years ago

ivmai commented 2 years ago

Build: https://app.travis-ci.com/github/ivmai/bdwgc/jobs/563513119 Source: master (35b40d4faf) Target: x86_64-apple-darwin17.7.0 (Mac OS X 10.13.6) Compiler: Apple LLVM version 9.1.0 (clang-902.0.39.2) Target mode: 32 bit How to build: ./configure --disable-shared --enable-cplusplus && make -j check CFLAGS_EXTRA="-fsanitize=address -m32 -fno-omit-frame-pointer" Output (gctest):

Switched to incremental mode
Emulating dirty bits with mprotect/signals
KERN_PROTECTION_FAILURE while world is stopped
ASAN:DEADLYSIGNAL
=================================================================
==8020==ERROR: AddressSanitizer: SEGV on unknown address 0x001e9000 (pc 0x000586e0 bp 0xb09587e8 sp 0xb09587d0 T6)
==8020==The signal is caused by a READ memory access.
    #0 0x586df in GC_push_all_eager mark.c:1582
    #1 0x5b057 in GC_push_all_stack_sections mark_rts.c:700
    #2 0x7493c in GC_push_all_stacks darwin_stop_world.c:411
    #3 0x54918 in GC_mark_some mark.c:310
    #4 0x38fec in GC_stopped_mark alloc.c:869
    #5 0x3[831]()3 in GC_collect_a_little_inner alloc.c:513
    #6 0x519b7 in GC_generic_malloc_many mallocx.c:343
    #7 0x52a0c in GC_malloc_many mallocx.c:495
    #8 0x2de3f in alloc8bytes gctest.c:1083
    #9 0x2e9e4 in tree_test gctest.c:1120
    #10 0x3004d in run_one_test gctest.c:1621
    #11 0x31c6a in thr_run_one_test gctest.c:2326
    #12 0x6eabb in GC_inner_start_routine pthread_start.c:57
    #13 0x60e1c in GC_call_with_stack_base misc.c:2181
    #14 0x7409d in GC_start_routine pthread_support.c:2029
    #15 0x2daf48 in __asan::AsanThread::ThreadStart(unsigned long long, __sanitizer::atomic_uintptr_t*) (libclang_rt.asan_osx_dynamic.dylib:i386+0x63f48)
    #16 0x2c7417 in asan_thread_start(void*) (libclang_rt.asan_osx_dynamic.dylib:i386+0x50417)
    #17 0xa75944d4 in _pthread_body (libsystem_pthread.dylib:i386+0x34d4)
    #18 0xa7594379 in _pthread_start (libsystem_pthread.dylib:i386+0x3379)
    #19 0xa7593a55 in thread_start (libsystem_pthread.dylib:i386+0x2a55)
==8020==Register values:
eax = 0x00000000  ebx = 0x001dfffc  ecx = 0x00000311  edx = 0x001c9070  
edi = 0x001e9000  esi = 0xbffd7ffc  ebp = 0xb09587e8  esp = 0xb09587d0  
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV mark.c:1582 in GC_push_all_eager
Thread T6 created by T0 here:
    #0 0x2c72b3 in wrap_pthread_create (libclang_rt.asan_osx_dynamic.dylib:i386+0x502b3)
    #1 0x73c9a in GC_pthread_create pthread_support.c:2103
    #2 0x31f74 in main gctest.c:2396
    #3 0xa72[836]()10 in start (libdyld.dylib:i386+0x1610)
==8020==ABORTING
ivmai commented 2 years ago

Related issue #178

ivmai commented 1 year ago

Build: https://app.travis-ci.com/github/ivmai/bdwgc/jobs/602685358 Source: master (f7a0708)