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
TraceLayerTest.FollowsTheBackingScaleWithNoSizeChange segfaults intermittently on the macOS runner #445
The same commit passed macos on the pull request's own CI, and the change touches only package.json and package-lock.json, so the crash is intermittent rather than caused by the change. The log gives no stack.
Scenario and consequence. The crash is in the test run on CI, not reported from a host. A segfault in the trace layer's backing-scale handling could also point at a real fault when the editor window moves to a screen with another scale. Until that's ruled out, it is at least a CI reliability problem: a crash in a required check ejects a pull request from the merge queue, which then has to be queued again (another hour of checks).
What QuartzCore does (disassembled on macOS 27.2):
On a display change, QuartzCore runs notifyDisplayChange: on its own queue for each Metal display link. It finds the link in a global list (MetalLinkItem::_list, under _list_lock), then takes the link's lock and reads the link's layer.
MetalLinkItem::invalidate() first releases the layer and stores nil (under the link's lock), and only then removes the link from the global list (under _list_lock). A notification that lands between the two steps finds a link whose layer is nil.
On macOS 27.2 notifyDisplayChange: checks for a nil layer and skips the link. On the macOS 15 runner the fault matches the missing check: address 0x20, the layer register 0 and the instance-variable offset register 0x20. alpine-gpui reports the same fault on macOS 26.6.2 (fix(macos): invalidate the display link only after the window close dbuddha/alpine-gpui#644), so every supported macOS below 27 (14, 15, 26) lacks the check.
Why this test. The render server tells a shown layer which display it is on, asynchronously (alpine-gpui traces it to its ImageQueueDidChangeDisplay message; locally a window resize also sends one). This test shows the layer, changes its scale and drawable size about 0.1 s later, then teardown invalidates the link at once, so that message can still be in flight during the invalidation. Both CI runs also had a stalling display, which slows the VM and widens the window. Locally (macOS 27.2) 100 repeats under TSan and 200 separate launches all passed.
Scenario and consequence for users. On macOS 14 to 26, closing the editor within a few milliseconds of a display-change notification (just after a resize or a move to another screen) could crash the host. The window inside invalidate() is tiny, so it is very unlikely for someone clicking close. On CI it ejected a pull request from the merge queue.
Fix. The trace layer tests let that message arrive before destroying the layer. The product's close path keeps the race on macOS 14 to 26; whether to change it is a separate decision.
Activity
zuurbr commentedon Nov 21, 2026
Cause: a race inside QuartzCore on macOS 15, not the trace layer's code
Two occurrences. Besides the merge-queue run above, the same test crashed on 2026-11-14 in the
macos-gluejob (ThreadSanitizer build) of run https://github.com/orizonaudio/Sineless/actions/runs/43653730410, which has a stack:No frame of ours is on the crashing thread.
What QuartzCore does (disassembled on macOS 27.2):
notifyDisplayChange:on its own queue for each Metal display link. It finds the link in a global list (MetalLinkItem::_list, under_list_lock), then takes the link's lock and reads the link's layer.MetalLinkItem::invalidate()first releases the layer and stores nil (under the link's lock), and only then removes the link from the global list (under_list_lock). A notification that lands between the two steps finds a link whose layer is nil.notifyDisplayChange:checks for a nil layer and skips the link. On the macOS 15 runner the fault matches the missing check: address 0x20, the layer register 0 and the instance-variable offset register 0x20. alpine-gpui reports the same fault on macOS 26.6.2 (fix(macos): invalidate the display link only after the window close dbuddha/alpine-gpui#644), so every supported macOS below 27 (14, 15, 26) lacks the check.Why this test. The render server tells a shown layer which display it is on, asynchronously (alpine-gpui traces it to its
ImageQueueDidChangeDisplaymessage; locally a window resize also sends one). This test shows the layer, changes its scale and drawable size about 0.1 s later, then teardown invalidates the link at once, so that message can still be in flight during the invalidation. Both CI runs also had a stalling display, which slows the VM and widens the window. Locally (macOS 27.2) 100 repeats under TSan and 200 separate launches all passed.Scenario and consequence for users. On macOS 14 to 26, closing the editor within a few milliseconds of a display-change notification (just after a resize or a move to another screen) could crash the host. The window inside
invalidate()is tiny, so it is very unlikely for someone clicking close. On CI it ejected a pull request from the merge queue.Fix. The trace layer tests let that message arrive before destroying the layer. The product's close path keeps the race on macOS 14 to 26; whether to change it is a separate decision.