Skip to content

Conversation

@anakrish
Copy link
Collaborator

@anakrish anakrish commented Jan 20, 2026

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 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 anakrish changed the title feat!: Panic safe guard for FFI feat(ffi): unwind safety: shield FFI entrypoints with panic guard Jan 20, 2026
@anakrish anakrish marked this pull request as ready for review January 20, 2026 21:22
Copy link

@dpokluda dpokluda left a comment

Choose a reason for hiding this comment

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

:shipit:

@anakrish anakrish merged commit 80686d6 into microsoft:main Jan 21, 2026
41 checks passed
@anakrish anakrish deleted the unwind-safe branch January 21, 2026 03:50
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