-
Notifications
You must be signed in to change notification settings - Fork 160
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
Fix the logic for scanning tasks in the Julia GC #4053
Conversation
This removes an unnecessary (and wrong) test that intended to avoid repeated scanning of the main thread stack, but instead skipped scanning of all root stacks.
b22355a
to
a3bb9f8
Compare
@@ -646,7 +646,7 @@ static void GapTaskScanner(jl_task_t * task, int root_task) | |||
if (tag->bits.gc & 2) | |||
rescan = 0; | |||
} | |||
if (stack && tid < 0) { | |||
if (stack) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like the right thing to do....
In fact tid < 0
means tid == -1
means that the task is not the current task of any thread. Why was it ever OK to skip scanning the stack of such tasks? It might have been the previously active task on a thread, right? And then skipping it could lead to us missing a GC root and hence a GC crash, no?
Or is it not that bad? Then what am I missing this time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You aren't missing anything, that was a bug.
Backported to stable-4.11 in 1450c23 |
- gap-system#3925 belongs to 4.12.0 not 4.11.1, - gap-system#4053 now belongs to `topic: julia`, not to `kind: bug: crash` - removed a superfluous "in"
- gap-system#3925 belongs to 4.12.0 not 4.11.1, - gap-system#4053 now belongs to `topic: julia`, not to `kind: bug: crash` - removed a superfluous "in"
This fixes the test that tries to avoid scanning the stack of the current thread twice.