Skip to content

Windows: compiler panics 'invalid free' building the pcre2 .wo bundle (native-Windows only; cross-from-macOS is clean) #1081

Closed

Description

@ehartford

The real blocker behind the Windows release/self-host reds (past #1075's link-metadata issue, which is fixed). Captured via a diagnostic run with #1035's stderr echo (release workflow, windows-x86_64, run 33999504153):

 --> D:/a/with/with/lib/std/re/pcre2_auto_possess.w:3900:27
3900 |             if not (((if (unsafe *__local_chr_ptr) != 4294967295: 1 else: 0) != 0)) {
  |                           ^^^^^^^^^^^^^^^^^^^^^^^
invalid free addr=2164888967488
panic: invalid free: pointer is not an allocated payload start
error: action target 'pcre2-wo-build' failed during comptime evaluation: pcre2-wo-build: bundle build failed with exit code 1

The freshly-built with-stage1.exe crashes with an invalid free while compiling the migrated pcre2 corpus for the .wo bundle (build lib/std/re/bundle.w --emit-obj --bundle-corpus std/re). It fails fast (~34 s), so it is not codegen volume or a link step — it is a memory-corruption crash in the compiler's own runtime.

Platform scope: native Windows only. The linux-x86_64, linux-aarch64 and darwin bundle builds succeed (v0.15.1.10/.13 published those assets). Cross-compiling the SAME target from macOS — with build lib/std/re/bundle.w --emit-obj --target=windows_x86_64 --bundle-corpus std/re -o x.o — exits 0 and emits the object cleanly. So it is a drop/free bug in the compiler's runtime as it runs on Windows, exposed by this corpus, not a codegen-for-windows defect.

Route (docs/deep-debugging-tools.md — a free bug starts with the allocator, on Windows): a diagnostic release/self-host run with WITH_DEBUG_ALLOC=1 WITH_ALLOC_NO_REUSE=1 on the pcre2-wo-build sub-invocation to get the alloc/free sites, then WITH_DEBUG_ALLOC_TRAP_FREE=2164888967488 for the alloc/free timeline and drop origins. This needs a Windows runner (or a Windows machine) — it does not reproduce on macOS/Linux.

Landed toward Windows already (real, not this bug): #1075 native lld-link env fallback, the build-runner retry once bootstrap runtime + linker metadata exist, and the Darwin-stdio-globals / CRLF fixes (Rob's #1029/#1016). Windows stays pinned at v0.15.1.8 in seed.lock until this crash is fixed; Mac and Linux bootstrap from v0.15.1.10.

Activity

  1. added 2 commits that reference this issue on Sep 7, 2026
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