Ivan Maidanski
Ivan Maidanski
Hmm. Looking into the test code, I don't understand why "there should be a pointer to it on the stack": ``` void *allocated[10]; for(int i = 0 ; i <...
> -fsanitize=gc-8.2.8/.libs/libgc.a Should be `-fsanitize=address gc-8.2.8/.libs/libgc.a`, right?
I've reproduced it. gcc-13 on Ubuntu
Also, reproduced when whole code is sanitized: `g++ -I include -fsanitize=address bdw_gc_test.cpp extra/gc.c && ./a.out`
The issue is caused by the way how sanitizer works - `allocated[]` is not located on the stack (unlike variable `i`): (gdb) p GC_stackbottom $8 = (ptr_t) 0x7fffffffe240 (gdb) p...
Sanitizer (unlike older version) puts arrays in a stealth area instead of normal stack to guard against (detect) buffer overruns. But libgc does not know about it.
> Maybe it's possible to use the two function __asan_get_current_fake_stack and __asan_addr_is_in_fake_stack to check if an address is in the current stack? Probably. The support should include both single-threaded case...
`__asan_iterate_over_fake_stack` is not exposed yet, the discussion is here: https://issues.chromium.org/issues/40349891
/cc @hboehm
> Could a solution be to abuse the __asan_locate_address function? According to the documentation it returns the string "stack" if the input address is placed on a stack. This might...