Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the GC task callback from segfaulting. #32088

Merged
merged 1 commit into from
May 20, 2019

Conversation

rbehrends
Copy link
Contributor

It is possible when marking task objects in the GC for the associated
jl_ptls_t reference to be NULL. To determine whether a task is a root
task, we therefore also have to check if that reference is valid.

This is a fix for a bug in the old "GC Extensions" changes added last year that did not manifest until now, because it was triggered by a combination of unusual circumstances. It should be fairly straightforward, as it only adds a missing null pointer check.

It is possible when marking task objects in the GC for the associated
jl_ptls_t reference to be NULL. To determine whether a task is a root
task, we therefore also have to check if that reference is valid.
@JeffBezanson JeffBezanson added the GC Garbage collector label May 20, 2019
@thofma
Copy link
Contributor

thofma commented May 20, 2019

Can this be backported?

@fingolfin
Copy link
Contributor

Yes, a backport to 1.2.x (and ideally also 1.1.x and 1.0.x) would be awesome. While we haven't seen a crash caused by this outside of master, it still seems like the wise choice. Considering the trivial nature of the change, together with the fact that this code is probably not used by anybody other than us, I don't see a risk of a regression.

@Keno
Copy link
Member

Keno commented May 20, 2019

Speaking of master, are you all caught up to the stack changes to tasking? That's caused a bit of a problem for other external language integrations.

@Keno Keno merged commit 25c33e4 into JuliaLang:master May 20, 2019
@rbehrends
Copy link
Contributor Author

@Keno We had a couple of minor hiccups due to the stack changes, but seem to have everything in working order for now.

@fingolfin
Copy link
Contributor

Would backports to 1.1 and 1.0 also be possible? Or are those branch lines not going to receive further updates from here on?

@KristofferC
Copy link
Sponsor Member

1.0 will be updated. 1.1 will likely not.

KristofferC pushed a commit that referenced this pull request May 22, 2019
It is possible when marking task objects in the GC for the associated
jl_ptls_t reference to be NULL. To determine whether a task is a root
task, we therefore also have to check if that reference is valid.

(cherry picked from commit 25c33e4)
@KristofferC KristofferC mentioned this pull request May 22, 2019
58 tasks
@fingolfin fingolfin deleted the rb/gc-callback-nullptr branch June 13, 2019 19:19
@KristofferC KristofferC mentioned this pull request Aug 26, 2019
55 tasks
@KristofferC KristofferC mentioned this pull request Dec 3, 2019
56 tasks
fingolfin pushed a commit to fingolfin/julia that referenced this pull request Feb 3, 2020
It is possible when marking task objects in the GC for the associated
jl_ptls_t reference to be NULL. To determine whether a task is a root
task, we therefore also have to check if that reference is valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants