ssa,runtime: tighten recover to direct deferred calls (Defer-node model)#2033
Open
cpunion wants to merge 1 commit into
Open
ssa,runtime: tighten recover to direct deferred calls (Defer-node model)#2033cpunion wants to merge 1 commit into
cpunion wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jul 6, 2026
e617ca2 to
174dfa3
Compare
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 6, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
174dfa3 to
f9fabc8
Compare
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
f9fabc8 to
f72a070
Compare
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
f72a070 to
efa8f54
Compare
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #2023 (contains #2012/#2016/#2019). Re-expresses the surviving value of #1918 — its remaining ~11k diff lines were the pre-#2012 funcinfo draft, superseded by the stage-5 chain.
What changes
recover()only succeeds when called directly by a deferred function (gc semantics). The panic node records its owningDeferframe at rethrow (panicKey/panicNode+GoDeferData), andRecoverchecks the caller is that frame's direct deferred call — arecover()two levels down, or outside any deferred call, returns nil like gc.StartRecoverFrameAlias/EndRecoverFrame, so adapters between the Defer frame and the user function stay invisible to the ownership check.PanicTracebackhook (gc-style traceback), now printing the panic node's argument.goroot conformance
Retired xfails, validated darwin/arm64 go1.26 + linux/arm64 go1.24:
fixedbugs/issue4066.go— previously needed a 2-minute timeout entry; runs in ~2.7s with the Defer-node model.fixedbugs/issue73916.go,issue73916b.go— go1.26 recover-ownership semantics.Validation
ssa(113s) andcl(467s) suites green;test/goRecover/Defer set green underllgo test._demo/go/defergreen.gentests: no trackedout.lldrift.Supersedes #1918. Note for the merge queue: this touches the same
Rethrow/Recoverarea as #2026'sRecoverMarkhook — whichever lands second rebases that contact point (both keep the hook semantics).🤖 Generated with Claude Code