Skip to content

task: Add missing write-barrier in save_stack#62387

Merged
topolarity merged 2 commits into
JuliaLang:masterfrom
topolarity:ct/fix-missing-task-wb
Jul 15, 2026
Merged

task: Add missing write-barrier in save_stack#62387
topolarity merged 2 commits into
JuliaLang:masterfrom
topolarity:ct/fix-missing-task-wb

Conversation

@topolarity

Copy link
Copy Markdown
Member

Caught by JuliaCI/julia-buildkite#541.

Reproduces readily with JULIA_COPY_STACKS=1 in an MMTK_PLAN=StickyImmix build:

$ JULIA_COPY_STACKS=1 ./julia --startup-file=no -e "fib(x) = @sync begin; function f(x); x in (0, 1) && return x; a = Threads.@spawn f(x - 2); b = Threads.@spawn f(x - 1); fetch(a) + fetch(b); end; f(x); end; println(fib(25))"

[2035119] signal 11 (1): Segmentation fault

This doesn't affect the stock GC which has a persistent remset, but it does matter for MMTK.

Investigated from core dump by Claude Fable 🤖 (w/ some human prodding)

@topolarity topolarity added GC Garbage collector GC: MMTK MMTK GC integration labels Jul 15, 2026
@topolarity topolarity requested a review from qinsoon July 15, 2026 01:37

@qinsoon qinsoon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix.

@topolarity

Copy link
Copy Markdown
Member Author

I'm a bit surprised StickyImmix was ever working, given this bug (threads.jl hits it very reliably)

Is it just that we never tested it on the full test suite?

@qinsoon

qinsoon commented Jul 15, 2026

Copy link
Copy Markdown
Member

I'm a bit surprised StickyImmix was ever working, given this bug (threads.jl hits it very reliably)

Is it just that we never tested it on the full test suite?

We used to run the test suite in the binding CI (before moving the binding code into the Julia repo). We run the tests with our scripts, but mostly we run make test-xx. The last run was from last month, and threads.jl tests passed.

Sticky immix was also tested in the original PR to buildkite (JuliaCI/julia-buildkite#517) in Feb. But after that, we haven't ever run the entire test suite for sticky immix on Julia's CI.

@topolarity

Copy link
Copy Markdown
Member Author

I'm glad I asked - Thanks for helping me reconstruct the history.

That means this regressed recently then. Looks like https://github.com/JuliaLang/julia/pull/62224/changes#diff-1ac89047bd5ddf49f271321da0d86793efdc534d0edd56548b3ea0dcd2f37c04R464
which moved the barrier before the store but also accidentally across a safepoint.

@topolarity topolarity force-pushed the ct/fix-missing-task-wb branch from 55778ef to 3fc0e18 Compare July 15, 2026 03:54
@topolarity topolarity added the merge me PR is reviewed. Merge when all tests are passing label Jul 15, 2026
@topolarity topolarity merged commit 5d10c35 into JuliaLang:master Jul 15, 2026
6 of 9 checks passed
@adienes adienes removed the merge me PR is reviewed. Merge when all tests are passing label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GC: MMTK MMTK GC integration GC Garbage collector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants