Skip to content

feat(ffi): unwind safety: shield FFI entrypoints with panic guard - #546

Merged
Anand Krishnamoorthi (anakrish) merged 1 commit into
microsoft:mainfrom
anakrish:unwind-safe
Jan 21, 2026
Merged

feat(ffi): unwind safety: shield FFI entrypoints with panic guard#546
Anand Krishnamoorthi (anakrish) merged 1 commit into
microsoft:mainfrom
anakrish:unwind-safe

Conversation

@anakrish

@anakrish Anand Krishnamoorthi (anakrish) commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator

This PR implements widely accepted Rust programming practices for
dealing with panics across ABI (programming language) boundaries.

  • Add panic_guard.rs to wrap FFI calls and prevent panic across FFI/ABI boundary (undefined behavior).
  • Capture per-thread backtraces via a temporary panic hook
  • After a panic, subsequent invocations are poisoned.
  • Integrate with_unwind_guard across the engine, schema registry, and target registry exportis

@anakrish
Anand Krishnamoorthi (anakrish) force-pushed the unwind-safe branch 4 times, most recently from a2da010 to 7397f83 Compare January 20, 2026 21:07
This PR implements widely accepted Rust programming practices for
dealing with panics across ABI (programming language) boundaries.

- Add panic_guard.rs to wrap FFI calls and prevent panic across FFI/ABI boundary (undefined behavior).
- Capture per-thread backtraces via a temporary panic hook
- After a panic, subsequent invocations are poisoned.
- Integrate with_unwind_guard across the engine, schema registry, and target registry exportis

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
@anakrish Anand Krishnamoorthi (anakrish) changed the title feat!: Panic safe guard for FFI feat(ffi): unwind safety: shield FFI entrypoints with panic guard Jan 20, 2026
@anakrish
Anand Krishnamoorthi (anakrish) marked this pull request as ready for review January 20, 2026 21:22

@dpokluda David Pokluda (dpokluda) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

@anakrish
Anand Krishnamoorthi (anakrish) merged commit 80686d6 into microsoft:main Jan 21, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants