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

Conversation

rbehrends
Copy link
Contributor

This fixes the test that tries to avoid scanning the stack of the current thread twice.

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.
@coveralls
Copy link

coveralls commented Jun 17, 2020

Coverage Status

Coverage increased (+0.0003%) to 84.892% when pulling a3bb9f8 on rbehrends:fix-taskscanner-logic into 946cde4 on gap-system:master.

@@ -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.

@fingolfin fingolfin added backport-to-4.11 kind: bug Issues describing general bugs, and PRs fixing them kind: bug: crash Issues describing bugs that cause GAP to crash, and PRs fixing them (used for release notes) topic: julia Julia GC integration and related matters labels Jun 17, 2020
@fingolfin fingolfin merged commit 3e6229f into gap-system:master Jun 17, 2020
@fingolfin fingolfin deleted the fix-taskscanner-logic branch June 17, 2020 13:50
@fingolfin
Copy link
Member

Backported to stable-4.11 in 1450c23

@PaulaHaehndel PaulaHaehndel self-assigned this Feb 16, 2021
@PaulaHaehndel PaulaHaehndel added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Feb 16, 2021
@PaulaHaehndel PaulaHaehndel removed their assignment Feb 16, 2021
@PaulaHaehndel PaulaHaehndel changed the title Fix the logic for scanning tasks in the Julia GC. Fix the logic for scanning tasks in the Julia GC Feb 17, 2021
@fingolfin fingolfin removed kind: bug: crash Issues describing bugs that cause GAP to crash, and PRs fixing them (used for release notes) kind: bug Issues describing general bugs, and PRs fixing them labels Feb 24, 2021
ThomasBreuer added a commit to ThomasBreuer/gap that referenced this pull request Feb 24, 2021
- 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"
ThomasBreuer added a commit to ThomasBreuer/gap that referenced this pull request Feb 25, 2021
- 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"
fingolfin pushed a commit that referenced this pull request Feb 28, 2021
- #3925 belongs to 4.12.0 not 4.11.1,
- #4053 now belongs to `topic: julia`, not to `kind: bug: crash`
- removed a superfluous "in"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-4.11-DONE release notes: added PRs introducing changes that have since been mentioned in the release notes topic: julia Julia GC integration and related matters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants