https://github.com/JuliaLang/julia
Revision c591bf2f412c208c00e55ee503db840104aaca45 authored by Jameson Nash on 08 March 2022, 20:31:33 UTC, committed by GitHub on 08 March 2022, 20:31:33 UTC
There appeared to be a possibility they could race and the data field
might already be destroyed before we reached the close callback,
from looking at the state of the program when reproducing #44460.

This is because the uv_return_spawn set the handle to NULL, which later
can cause the uvfinalize to exit early (if the finalizer gets run on
another thread, since we have disabled finalizers on our thread). Then
the GC can reap the julia Process object prior to uv_close cleaning up
the object. We solve this by calling disassociate_julia_struct before
dropping the reference to the handle. But then we also fully address any
remaining race condition by having uvfinalize acquire a lock also.

The uv_return_spawn callback also needs to be synchronized with the
constructor, since we might have arrived there before we finished
allocating the Process struct here, leading to missed exit events.

Fixes #44460
1 parent 061d248
History
Tip revision: c591bf2f412c208c00e55ee503db840104aaca45 authored by Jameson Nash on 08 March 2022, 20:31:33 UTC
process: ensure uvfinalize and _uv_close_cb are synchronized (#44476)
Tip revision: c591bf2
File Mode Size
.buildkite
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.clang-format -rw-r--r-- 3.3 KB
.codecov.yml -rw-r--r-- 52 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 433 bytes
.mailmap -rw-r--r-- 12.1 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 22.5 KB
HISTORY.md -rw-r--r-- 349.4 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 49.6 KB
Makefile -rw-r--r-- 26.2 KB
NEWS.md -rw-r--r-- 1.8 KB
README.md -rw-r--r-- 7.4 KB
THIRDPARTY.md -rw-r--r-- 3.7 KB
VERSION -rw-r--r-- 10 bytes
julia.spdx.json -rw-r--r-- 35.8 KB
sysimage.mk -rw-r--r-- 4.1 KB

README.md

back to top