Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assertion violation about GC_mark_lock_holder in fork_child_proc
PR #678 (bdwgc). `GC_mark_lock_holder` value is computed based on `pthread_self()`, the latter is not guaranteed to preserve the value in a child process after forking, thus we should not check `GC_mark_lock_holder` value in `fork_child_proc()`. * pthread_support.c [GC_ASSERTIONS && GC_PTHREADS_PARAMARK] (GC_mark_lock_holder): Move definition upper (to be before `fork_cancel_state`). * pthread_support.c [CAN_HANDLE_FORK && PARALLEL_MARK && !GC_WIN32_THREADS && !(THREAD_SANITIZER && GC_ASSERTIONS && CAN_CALL_ATFORK)] (fork_child_proc): Call `pthread_mutex_unlock()` instead of `GC_release_mark_lock()`; add comment. * pthread_support.c [CAN_HANDLE_FORK && PARALLEL_MARK && !GC_WIN32_THREADS && GC_ASSERTIONS && !(THREAD_SANITIZER && CAN_CALL_ATFORK)] (fork_child_proc): Set `GC_mark_lock_holder` to `NO_THREAD`; add comment. Co-authored-by: Augustin Cavalier <[email protected]>
- Loading branch information