Skip to content

fix(ci): stop the Windows recovered-panic heap crash and the Pass-2 temp-dir race - #1288

Merged
Dumbris merged 2 commits into
mainfrom
fix/httpapi-registry-add-nil-config
Sep 16, 2026
Merged

Dumbris merged 2 commits into
mainfrom
fix/httpapi-registry-add-nil-config

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 16, 2026

Copy link
Copy Markdown
Member

Why

Two CI failures that hit Spec 105 PRs (#1282, #1284, #1285) without those PRs touching the code that failed:

  1. Build Binaries (windows-latest) — Go runtime crashes in internal/httpapi (fatal error: found pointer to free object, unexpected fault address 0xffffffffffffffff with a garbage stack). Root cause: TestMutatingServerRoutes_AdminAllowed/registry-add-server drives handleAddFromRegistry with a controller stub that returns nil, nil, nil; the handler dereferenced cfg.Name, chi's recoverer swallowed the nil-pointer panic and the test passed on every OS. Under Go 1.26 on windows/amd64 the recovered hardware exception corrupts the Go heap (golang/go#81238), so the test binary dies at a later GC — intermittently, on whichever PR runs next.
  2. End-to-End Tests (ubuntu-latest)TestServiceStartScanDeepOnRunsSourceResolutionAndPass2: TempDir RemoveAll cleanup: directory not empty. The Pass-2 goroutine writes tools.json into the server working dir after ResolveFullSource returns and before it registers its engine job, so waitForScanIdle can return in the "Pass 1 cleared, Pass 2 not yet started" window and teardown races the write (known rerun-clearable flake since 2026-08-31).

What

  • handleAddFromRegistry: a nil config on the success branch is a JSON 500 (registry returned no server configuration), mirroring the nil-tolerance redactedRegistrySummary already has; TestAddFromRegistry_NilConfigIsAnError pins it (fails on main with the recovered panic). A full internal/httpapi run now logs zero recovered panics.
  • Scanner test: wait for the Pass-2 job to reach a terminal status in storage (its last write on every exit path) before waitForScanIdle. -race -count=20, also under GOMAXPROCS=1: green.

🤖 Generated with Claude Code

A controller that reports success without a server config (the test
doubles do) was dereferenced in handleAddFromRegistry; chi's recoverer
turned the fault into a bare 500. Under Go 1.26 on windows/amd64 the
recovered hardware exception corrupts the Go heap (golang/go#81238), so
the internal/httpapi test binary died later with "found pointer to free
object" / "unexpected fault address" on unrelated PRs (#1282, #1285).

Return a JSON 500 instead, the way redactedRegistrySummary already
tolerates a nil entry, and pin it with a test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 841bcb4
Status: ✅  Deploy successful!
Preview URL: https://dc6ebae2.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-httpapi-registry-add-nil.mcpproxy-docs.pages.dev

View logs

TestServiceStartScanDeepOnRunsSourceResolutionAndPass2 failed on ubuntu
CI with "TempDir RemoveAll cleanup: directory not empty": the Pass-2
goroutine writes tools.json into the server working dir after
ResolveFullSource returns and before it registers its engine job, so an
idle engine can mean "Pass 1 cleared, Pass 2 not started yet" and the
test's teardown raced the write. Wait for the Pass-2 job to reach a
terminal status in storage (its last write on every exit path) first.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Dumbris Dumbris changed the title fix(httpapi): stop the recovered nil-config panic in add-from-registry (Windows CI crash) fix(ci): stop the Windows recovered-panic heap crash and the Pass-2 temp-dir race Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/httpapi-registry-add-nil-config

Available Artifacts

  • archive-darwin-amd64 (30 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (30 MB)
  • archive-windows-arm64 (26 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (24 MB)
  • installer-dmg-darwin-arm64 (21 MB)
  • smart-mcp-proxymcpproxy-go3YBIPH.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 35112724985 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit 8acb506 into main Sep 16, 2026
43 checks passed
@Dumbris
Dumbris deleted the fix/httpapi-registry-add-nil-config branch September 16, 2026 15:45
Dumbris added a commit that referenced this pull request Sep 16, 2026
…1288)

This branch diverged from main before #1288 landed, so PR-B's CI hit the
exact regression it fixed: handleAddFromRegistry's success path dereferenced
a nil cfg, chi's recoverer turned the panic into a bare 500, and the
recovered hardware fault corrupted the Go heap on windows/amd64 under Go
1.26 (golang/go#81238) — the internal/httpapi test binary crashed with
"found pointer to free object" and took the whole Windows unit-test job (and
the binaries job's httpapi/scanner test bundle) down with it. Cherry-picked
the same fix main already carries: the nil-config guard with a JSON 500 (and
its pinning test), plus the unrelated Pass-2 temp-dir teardown race fix in
the scanner test this same upstream commit bundled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants