Repository navigation
Fix LLDB notification callback continuation - #6054
Merged
max-charlamb merged 2 commits intoSep 22, 2026
Merged
max-charlamb merged 2 commits into
max-charlamb merged 2 commits into
Conversation
Return the notification disposition through the LLDB breakpoint callback instead of recursively continuing the process from inside the callback. Co-authored-by: Copilot <[email protected]> Copilot-Session: 2d5c60f7-9c89-42e6-b9fc-04ef78c8f8d8
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The behavioral change matches the described LLDB callback contract and appears correct; only a small, non-blocking maintainability nit remains.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR fixes an intermittent macOS ARM64 SOS failure caused by continuing the debuggee from inside LLDB’s exception breakpoint callback while resolving pending managed bpmd breakpoints. The change aligns LLDB callback behavior with an explicit stop/continue contract based on HRESULT, avoiding re-entrancy into LLDB and keeping errors inspectable.
Changes:
- Update SOS’s PAL/LLDB CLR-notification handling to return
S_FALSE(continue) forDEBUG_STATUS_GO*dispositions instead of issuing an immediate nestedprocess continue. - Update the LLDB exception breakpoint callback to interpret
HRESULTreturn values as stop/continue disposition (S_FALSE=> continue; anything else => stop). - Document the exception-callback return contract in
lldbservices.h.
| File | Description |
|---|---|
| src/SOS/Strike/strike.cpp | Returns S_FALSE on LLDB/PAL when the notification disposition is “go/continue”, preventing nested process continue during the callback. |
| src/SOS/lldbplugin/services.cpp | Changes callback disposition logic to continue only on S_FALSE, and stop on S_OK or errors. |
| src/SOS/inc/lldbservices.h | Documents the stop/continue/error contract for exception callbacks. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Keep the CDB break in its platform branch so the LLDB return path has no dead statement. Co-authored-by: Copilot <[email protected]> Copilot-Session: 2d5c60f7-9c89-42e6-b9fc-04ef78c8f8d8
steveisok
approved these changes
Sep 21, 2026
hoyosjs
approved these changes
Sep 21, 2026
max-charlamb
enabled auto-merge (squash)
September 21, 2026 18:06
Member
Author
|
/ba-g flaky test run |
This was referenced Sep 24, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Summary
Fix intermittent macOS ARM64 failures when SOS resolves a pending managed
bpmdbreakpoint from an LLDB exception callback.The LLDB callback now uses its return value as the stop/continue disposition:
S_OKstops the process.S_FALSEcontinues after the callback unwinds.HRESULTstops so the processing error remains inspectable.The CDB path is unchanged and continues to use its debugger event command (
sxe -c "!SOSHandleCLRN" clrn) followed byg.Failure evidence
The same
SOS.Tests.GcWhereTests.GcWhere_Moveslive test failed independently on different machines, configurations, and runtime versions:AtGen1ondci-mac-build-441.AtGen2onDNCHELIXMAC099.AtGen2ondci-mac-build-425.In each failure, SOS reported that the method was JIT-compiled and installed an LLDB breakpoint at the resulting native address. Continuing did not report that breakpoint. Instead, the process stopped with SIGABRT, and
clrstackshowed anAccessViolationExceptionin the requested marker method at the breakpoint address.Event chain
bpmdcreates a pending managed breakpoint and registersHandleExceptionNotificationthroughILLDBServices::SetExceptionCallback.SetExceptionCallbackstores that handler as the LLDB breakpoint callback baton.ExceptionBreakpointCallback.HandleCLRNotificationEventtranslates the notification.CNotification::OnCodeGenerated2resolves the pending breakpoint, installs the concrete native breakpoint, and setsDEBUG_STATUS_GO_HANDLED.process continueimmediately, while LLDB was still insideExceptionBreakpointCallback.HandleCLRNotificationEventreturnedS_OK, whichExceptionBreakpointCallbackinterpreted astrue(stop). The resulting control flow was therefore "continue recursively, then return stop".This change returns
S_FALSEfor PAL notifications whose disposition isDEBUG_STATUS_GO*. LLDB receivesfalsefrom its callback and performs the continuation only after the callback has unwound. Non-CLR exceptions observed by the broad LLDB exception breakpoint also returnS_FALSE, preserving the previous continue behavior without re-entering LLDB.Stress reproduction
On a macOS ARM64 checkout built with the SOS test harness, repeatedly launch a fresh live target with the matrix narrowed to the affected path:
The historical CI rate was 3 failures in 37 completed macOS ARM64 SOS legs, so a repeated fresh-process run is substantially stronger than a single green CI leg. The same loop can be run before and after this change for an A/B comparison.
Validation
Build.cmd -skipmanaged -configuration Debug