Skip to content

Fix potential init crash by catching exceptions in scope_exit reset()#40691

Merged
OneBlue merged 2 commits into
masterfrom
user/oneblue/scope_exit_log
Jun 3, 2026
Merged

Fix potential init crash by catching exceptions in scope_exit reset()#40691
OneBlue merged 2 commits into
masterfrom
user/oneblue/scope_exit_log

Conversation

@OneBlue

@OneBlue OneBlue commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This catches exceptions thrown from scope_exit. Because reset() is marked noexcept, an exception thrown from there could crash init.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@OneBlue OneBlue requested a review from a team as a code owner June 2, 2026 20:53
Copilot AI review requested due to automatic review settings June 2, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Linux-side wil::details::lambda_call (scope-exit helper) to prevent exceptions thrown by the cleanup lambda from escaping reset() noexcept, which could otherwise terminate the process (notably impacting init).

Changes:

  • Wraps scope_exit lambda execution in lambda_call::reset() with exception handling.
  • Attempts to log caught exceptions during scope-exit execution.
Comment thread src/linux/inc/lxwil.h Outdated
@OneBlue OneBlue merged commit 6cdc2b8 into master Jun 3, 2026
11 checks passed
@OneBlue OneBlue deleted the user/oneblue/scope_exit_log branch June 3, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants