diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-03-16 06:54:03 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-03-16 11:07:15 +0300 |
commit | 673f0cf3f25ad914bd273d50d9973f9dc92ff801 (patch) | |
tree | 48c14975710b24adef8e8267e0fbdea957d4e8e0 /finalize.c | |
parent | 4f57974b53c3acab0cfca1ee655a75026ccd5f7e (diff) | |
download | bdwgc-673f0cf3f25ad914bd273d50d9973f9dc92ff801.tar.gz |
Fix SIGSEGV caused by dropped stack access from child process in gctest
(fix of commit c808151a0)
Issue #256 (bdwgc).
Previously, a local variable was passed in gctest to
GC_move_disappearing_link as a link to clear, this led to a memory
access violation during garbage collection in the child process
if the fork occurred between GC_move_disappearing_link(..., &new_link)
and GC_unregister_disappearing_link(&new_link).
This commit changes the mentioned local variable (new_link) use - now
it contains a pointer to a heap-allocated link rather then containing
just a link.
* tests/gctest.c (mktree): Change type of new_link from void* to
void**; initialize it to GC_NEW(void*) and ensure it is non-null;
replace new_link with *new_link; add comment new_link object is
reclaimed correctly even if the thread is dropped in the child
process between GC_move_disappearing_link(new_link) and
GC_unregister_disappearing_link.
Diffstat (limited to 'finalize.c')
0 files changed, 0 insertions, 0 deletions