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

Fix the logic for scanning tasks in the Julia GC #4053

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/julia_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Member

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?

Copy link
Contributor Author

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.

if (task->copy_stack) {
// We know which part of the task stack is actually used,
// so we shorten the range we have to scan.
Expand Down