Skip to content

The collector could scan a thread in a GC-free zone without seeing its last writes #169

Closed

Description

@dimensionscape

A thread entering a GC-free zone saves its registers and stack bounds and then sets mGCFreeZone, a plain volatile bool. A collector that reads it as true skips waiting for that thread and scans what it saved. Nothing ordered the saves before the flag, so on ARM64 and other weakly ordered CPUs the collector could scan stale registers and miss an object held only there. Anything else the thread wrote before entering, such as the Haxe finalizer map, was likewise unordered with the collector's reads. ThreadSanitizer reported it as races between MarkConservative and the thread's own code, and between RunFinalizers and GCSetHaxeFinalizer.

Activity

  1. dimensionscape commented on Oct 17, 2026

    @dimensionscape
    MemberAuthor

    Fixed in 1537531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions