fix(data-pipeline): contain panics in combined FFI - #2302
Open
lloeki wants to merge 1 commit into
Open
Conversation
Enable `catch_panic` when the data pipeline FFI is bundled through the profiling FFI. Without feature propagation, a Rust panic can cross the combined C library boundary and terminate the host process. Add a packaged C example that triggers a capacity overflow and verifies that the API returns `DDOG_TRACE_EXPORTER_ERROR_CODE_PANIC` instead. APMSP-3830
Contributor
📚 Documentation Check Results📦
|
Contributor
🔒 Cargo Deny Results📦
|
BenchmarksComparisonCandidateCandidate benchmark detailsBaselineBaseline benchmark details |
This comment has been minimized.
This comment has been minimized.
Contributor
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Member
Author
|
This is part of the single native trace exporter API release train consumed through DataDog/dd-trace-rb#6131. |
lloeki
force-pushed
the
lloeki/native-panic-containment
branch
from
July 30, 2026 12:02
7e4e66c to
9a5ee5b
Compare
This was referenced Jul 30, 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 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.
AI-generated code disclosure: this PR was implemented with substantial AI assistance and manually reviewed and validated.
What does this PR do?
Ensures the combined libdatadog profiling artifact enables
catch_panicfor data-pipeline FFI entry points. It also adds a packaged C regression that triggers capacity overflow and verifies that the FFI returns an error instead of aborting the process.Motivation
The standalone data-pipeline FFI crate enables panic containment by default, but the combined profiling artifact disables dependency defaults and did not re-enable it. This closes APMSP-3830 before the native trace exporter payload APIs ship together.
Additional Notes
Stack position: L0, current PR: DataDog/libdatadog PR 2302.
Complete expected review and merge order for one libdatadog release:
L0-L3 are independent and can be reviewed in parallel. Merging them in the listed order is still recommended because it reduces integration and release-branch conflicts, and lands panic containment before the new payload surfaces. L4 is stacked on L1, and L5 is stacked on L4. L4 and L5 remain drafts while their prerequisite APIs are reviewed and rebased; their matching consumer PRs are also drafts pending the single libdatadog/libdatadog-rb release.
L0 tracks APMSP-3830; L1-L5 implement the payload work tracked by APMSP-3219.
How to test the change?
Prior local validation completed successfully:
nix develop -c cargo test -p libdd-profiling-ffi --features data-pipeline-ffipassed the combined profiling/data-pipeline FFI suite: 57 tests.nix develop -c cargo test -p libdd-data-pipeline-ffi --features catch_panic trace_chunks_new_with_overflow_capacity_returns_panic_errorpassed.nix develop -c cargo test -p libdd-data-pipeline-ffi --features catch_panic begin_chunk_with_overflow_capacity_returns_panic_errorpassed.nix develop -c cargo ffi-test --filter trace_exporter_panic_containmentbuilt and passed the packaged C panic-containment regression.nix develop .#nightly --command cargo fmt --all -- --checkpassed.nix develop -c cargo clippy -p libdd-profiling-ffi --all-targets --features data-pipeline-ffi -- -D warningspassed.