-
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
Refine the logic for scanning Julia stacks #4058
Conversation
99de293
to
d1096e4
Compare
src/julia_gc.c
Outdated
if (task->copy_stack) { | ||
// task->copy_stack, if not zero or one, is an upper bound for the | ||
// size of the stack. | ||
if (task->copy_stack > 1) { |
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.
I am not sure this is quite right now -- the value task->copy_stack == 1
should probably still be treated separately? I think it can only occur for "fresh" tasks which don't have a stack allocation yet; so I assume we could just do if (task->copy_stack ==1) return;
or so?
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.
Hmm, I'll go and have a look at that.
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.
So, task->copy_stack == 1
implies task->bufsz == 0
. This means that the logic is accidentally correct, but the comment would have to change. But I think that making control flow more explicit by aborting stack scanning for task->copy_stack == 1
is much clearer, so I'll go with that.
24f577a
to
d298d2f
Compare
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.
One minor typo, otherwise looks good and is ready to be merged.
I assume we'll want to backport this to 4.11, too...
40b7ba8
to
5c431b5
Compare
Done in 74cfb2a |
This fixes how we handle scanning the root task of the main thread. It also improves the comments that explain stack scanning logic.