net/http/cgi — validation proof

Go’s own net/http/cgi test suite, converted to C# by go2cs, built against the converted standard library, run under the Go-semantics test host, and compared verdict for verdict against a clean go test -json baseline of the same sources. This page is generated by the converter from that comparison — it is the evidence behind the net/http/cgi row in Validated Test Packages.

Validated 2026-08-30 · converter bf75c4abd

38 matched · 1 disclosed — Go 1.23.12, windows/amd64, converted package src/core/net/http/cgi.

Verdicts

Test go test go2cs
Test500WithEmptyHeaders pass pass
Test500WithNoContentType pass pass
Test500WithNoHeaders pass pass
TestCGIBasicGet pass pass
TestCGIBasicGetAbsPath pass pass
TestCGIBasicPost pass pass
TestCGIEnvIPv6 pass pass
TestCGIPostChunked pass pass
TestChildContentType pass pass
TestChildContentType/html pass pass
TestChildContentType/jpg pass pass
TestChildContentType/no_body pass pass
TestChildContentType/text pass pass
TestChildOnlyHeaders pass pass
TestCopyError pass fail (disclosed)
TestDir pass pass
TestDropProxyHeader pass pass
TestDupHeaders pass pass
TestEnvOverride pass pass
TestHandlerStderr pass pass
TestHostingOurselves pass pass
TestInternalRedirect pass pass
TestKillChildAfterCopyError pass pass
TestNilRequestBody pass pass
TestPathInfo pass pass
TestPathInfoDirRoot pass pass
TestPathInfoNoRoot pass pass
TestRedirect pass pass
TestRemoveLeadingDuplicates pass pass
TestRequest pass pass
TestRequestWithTLS pass pass
TestRequestWithoutHost pass pass
TestRequestWithoutRemotePort pass pass
TestRequestWithoutRequestURI pass pass
TestResponse pass pass
TestResponse/html pass pass
TestResponse/jpg pass pass
TestResponse/no_body pass pass
TestResponse/text pass pass

Disclosed divergences

A disclosed divergence is a specific Go assertion the managed CLR provably cannot satisfy — not a skipped test and not a tolerance. Each one is pinned by exact failure signature in the package’s hand-owned go2cs_test_disclosures.json; a disclosed test that fails any other way is still a hard mismatch.

Test Class Pinned reason
TestCopyError runtime-capability the test’s own instrument is a full-process goroutine dump: handlerRunning() calls runtime.Stack(buf, true) and regexp-matches net/http/cgi\.\(\*Handler\)\.ServeHTTP in it, i.e. it asks the runtime to render ANOTHER goroutine’s frames and then greps them. That is a facility defined over the replaced runtime’s own internals – Go walks every g’s saved stack through its scheduler; the CLR has no supported way to walk another thread’s stack, so runtime.Stack’s all parameter degrades BY DOCUMENTED DESIGN to the calling thread’s own trace (src/core/runtime/managed_impl.cs, both the header’s honest-divergences block and the comment at the Stack() body: “all=true reports only the calling thread – the CLR has no supported way to walk another thread’s stack”). The probe is therefore structurally false for a handler running on any other thread, and the FIRST assert – the pre-conn.Close liveness check pinned here – fails before the test reaches the behavior it was written to measure. Runtime-capability’s admission test is answered no: a truthful managed rendering of a foreign thread’s Go frames does not exist at any cost, and the class’s anti-laundering clause forbids the alternative outright – synthesizing a plausible ServeHTTP frame into the dump would pass this regexp while proving nothing about whether any handler is running, which is fabrication rather than implementation. Pinned AS FAILING for that reason. The behavior actually under test – Handler.ServeHTTP detecting a copy error and killing the CGI child rather than blocking forever on exec.Cmd.Wait – is proven independently, on the same run, by the passing sibling TestKillChildAfterCopyError (integration_test.go:93), which drives the identical path through a limitWriter that errors at 50 KiB and asserts the truncated output: the converted host.go logged Go’s own line, cgi: copy error: past write limit, and the test passed. What is lost here is the instrument, not the behavior. Measured 2026-08-29, i7-5820K, windows/amd64: 39 comparable verdicts, 38 matching, this row the only divergence, Go’s oracle clean