You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gc test: large_object_old_born_array_slot_write_keeps_young_child_alive asserts an exact whole-nursery copied_objects count and fails on macOS (4249 vs 1) — pre-existing on main #7060
The test builds one large old-born array with a single young child, writes the child into slot 0, and asserts the copying minor relocates exactly that one young object. It relocates 4 249.
It is the environment, not the change under test
I hit it while validating #7024 and did the control before concluding anything: the failure is byte-identical on the pristine e279b2d54 tree (same panic site, same left: 4249), so it is not caused by the deferral change. It also reproduces with --exact in a fresh process, so it is not cross-test state either — 4 249 live young objects are simply present in the nursery at the point the test forces its minor.
That points at runtime startup allocations differing between this host and the CI runner. cargo-test on main is red for an unrelated reason (direct_eval_non_definable_global_var_throws, a crates/perry/tests case), and this test is not among the reported failures there, so it evidently passes on ubuntu-latest.
Why it matters
The assertion is an exact equality against a whole-process quantity. Whatever makes 4 249 young objects live at that point on macOS will make the number different again on the next platform or the next startup change, and the test says nothing about the property it is trying to pin — that the old-to-young edge kept this child alive and rewrote this slot, which the surrounding assertions already check.
Two candidate fixes, in preference order:
Assert the child specifically: the test already computes rewritten and asserts it is a nursery pointer distinct from child. Add that the child's forwarded copy is among the copied set, and drop the exact count — or assert copied_objects >= 1.
Give the test a controlled nursery (the CopyingNurseryTestGuard it already uses) that starts from a known-empty young generation, so the exact count is meaningful.
Taking this one. I reproduced it on the same environment as the report (macOS Darwin 25.5.0, arm64, release profile) and am going with the issue's preferred fix, option 1: the property under test — that the old-to-young edge kept this child alive and its slot was rewritten to the forwarded copy — is already pinned by the rewritten != child and pointer_in_nursery(rewritten) assertions, so the whole-process copied_objects equality becomes a lower bound (>= 1) with a comment explaining why an exact count is host-dependent there. Option 2 (a known-empty nursery in CopyingNurseryTestGuard) is more invasive than the test needs.
PR to follow as soon as I've confirmed red → green locally on a pristine main build.
Activity
jdalton commentedon Jul 30, 2026
Taking this one. I reproduced it on the same environment as the report (macOS Darwin 25.5.0, arm64, release profile) and am going with the issue's preferred fix, option 1: the property under test — that the old-to-young edge kept this child alive and its slot was rewritten to the forwarded copy — is already pinned by the
rewritten != childandpointer_in_nursery(rewritten)assertions, so the whole-processcopied_objectsequality becomes a lower bound (>= 1) with a comment explaining why an exact count is host-dependent there. Option 2 (a known-empty nursery inCopyingNurseryTestGuard) is more invasive than the test needs.PR to follow as soon as I've confirmed red → green locally on a pristine
mainbuild.test(gc): assert the child relocation, not a whole-process copied cou…