mcpproxy-go icon indicating copy to clipboard operation
mcpproxy-go copied to clipboard

ci: Windows Go runtime crash "found pointer to free object" in internal/security/scanner

Open Dumbris opened this issue 2 weeks ago • 1 comments

The Windows unit-test job crashed in the Go runtime while running internal/security/scanner:

fatal error: found pointer to free object
runtime.(*mspan).reportZombies   runtime/mgcsweep.go:893
runtime.(*sweepLocked).sweep      runtime/mgcsweep.go:673
runtime.bgsweep                   runtime/mgcsweep.go:300
...
created by .../internal/security/scanner.selfCheckScoreEntries in goroutine 4871
    internal/security/scanner/tpa_selfcheck.go:287
FAIL github.com/smart-mcp-proxy/mcpproxy-go/internal/security/scanner 1171.109s

Run: Unit Tests (windows-latest, 1.26), main at 8a28d57b2, attempt 1 — https://github.com/smart-mcp-proxy/mcpproxy-go/actions/runs/44876791304/job/136766354343 (Go 1.26.11). A rerun of the failed job passed.

"found pointer to free object" is the GC detecting a zombie object, meaning something kept a pointer to memory the GC had already freed. The cause is either memory corruption (unsafe code or cgo, or a race the detector didn't see) or a Go runtime bug on Windows. The repo already works around a Windows runtime fault (golang/go#81189, "unexpected fault address"). This crash has a different signature, so it may be a different bug, and it is not covered by that retry wrapper.

Next steps: check whether the dependencies selfCheckScoreEntries uses (regexp2 / goja) run unsafe or finalizer code. Try reproducing with GODEBUG=gccheckmark=1 or -race on Windows. If the same thing shows up again, report it upstream.

Dumbris avatar Nov 21 '26 14:11 Dumbris

Coverage check: already covered, no change needed. The retry wrapper (scripts/go-test-retry-runtime-fault.sh, #1823) was extended by #1994 (merged 2026-11-23) to treat fatal error: found pointer to free object like the #1794 unexpected fault address signature. It is applied to the Windows step in unit-tests.yml (all packages, incl. internal/security/scanner) and pr-build.yml. It retries only packages whose block has a fault line and no --- FAIL:, timeout or DATA RACE, once, with a ::warning:: annotation. The self-test runs in CI. Scanned the logs of the last 30 failed unit-tests.yml runs: neither signature appears in any, so no run has been left red by it since #1994. Leaving this open for the upstream Go bug (golang/go#81189).

Dumbris avatar Nov 24 '26 13:11 Dumbris