cl: preserve recover-visible panic source lines - #2293
Conversation
There was a problem hiding this comment.
Review summary
Careful, well-documented rework of LLGo's recover/panic model: a panicNode linked list on g, per-invocation recover-frame binding, transparent-wrapper aliasing, volatile recover slots, and a conservative mayRecover propagation across cl/, ssa/, and the runtime. The PanicTypeAssert signature change is applied uniformly (verified against the _testrt/_testgo CHECK lines), and nil-handling in the new SSA helpers is solid and test-covered (ssa/recover_metadata_test.go). SIGBUS wiring (SIGBUS != 0 guard + per-platform constants, Linux 0x7, Darwin 0xa) is correct.
One correctness divergence and a few compile-time performance notes are inline. No memory-safety defects were found in the moveToDefer/Recover/abortPanics unlink-and-free ordering.
Non-blocking confirmation (pre-existing, not changed here): Panic still stores the panic value in a non-GC c.Malloc'd node (arg any, z_rt.go:~204), same as before this PR. Since deferred functions run arbitrary allocating user code between the longjmp and Recover, the panic value's GC reachability while a panic is in flight is worth confirming — but this property predates the PR and is out of its scope.
LLGo baseline benchmarks
Program measurements
Core language and compiler benchmarks
Compared with |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
3ccd9d5 to
bc06013
Compare
bc06013 to
e60b5fc
Compare
Summary
GOROOT cases
fixedbugs/bug347.gofixedbugs/bug348.gofixedbugs/issue27201.gofixedbugs/issue29504.gofixedbugs/issue4562.goScope
Depends on #2034 for the recover-time panic stack snapshot. The new work is kept in four layered commits: regression tests, implementation, tracking-rule documentation, and xfail cleanup.
This intentionally excludes the nil-check cases handled by #2256 and unrelated GC/finalizer timing failures.
Validation
go test ./cl -run "TestRuntimeCallerFuncSetKeepsRecoverObservableCallees|TestCompileRuntimeCallerPanicPCLineMetadata|TestRuntimeCallerPackageDetection|TestRuntimeCallerAnalysisEdgeCases" -count=1go test -vet=off ./test/go -run "^TestRuntimeStatementLineInfo$" -count=1