summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-03-16 06:54:03 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-03-16 11:51:03 +0300
commit93bab693ac4543aaa04f8b0cc07d496394e26b51 (patch)
tree7df1c11affc52465851afef095cd53df175258eb /win32_threads.c
parent1ba1c46e77cad1146163a41def03b6448623f11e (diff)
downloadbdwgc-93bab693ac4543aaa04f8b0cc07d496394e26b51.tar.gz
Fix SIGSEGV caused by dropped stack access from child process in gctest
(a cherry-pick of commit 673f0cf3f from 'master') 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/test.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 'win32_threads.c')
0 files changed, 0 insertions, 0 deletions