Repository navigation
Conversation
Experimental test-only harness: a global allocator proxy that returns null at a chosen allocation ordinal, a controller that runs one worker process per ordinal and mode, and strict contract and toy-scenario tests. Jira: PROF-16808
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
BenchmarksComparisonBenchmark execution time: 2026-11-20 13:53:02 Comparing candidate commit 2abe6fe in PR branch Found 0 performance improvements and 5 performance regressions! Performance is the same for 163 metrics, 9 unstable metrics.
|
This comment has been minimized.
This comment has been minimized.
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
|
Run ddog_Vec_Tag_push in one-shot and sticky modes for an empty vector, a vector at capacity, and a long key and value. Crash outcomes are recorded with the stack and the owned call site, and do not fail the test. Jira: PROF-16808
The test-only feature shares one policy and event counter between logical arena requests and backing-chunk growth, so those failures can be enumerated without changing production types. Jira: PROF-16808
Move the arena chaos wrappers from libdd-alloc into a crate-private module of libdd-profiling, compiled only under the allocation_chaos_test cfg (LIBDD_ALLOCATION_CHAOS_TEST=1). Drop the allocation-chaos-test Cargo features so published crates gain no public items or features. The harness reaches the observer through a cfg-gated extern static and builds its own arena wrappers. Jira: PROF-16808
What does this PR do?
Experimental, test-only harness to find the profiling FFI paths that crash when an allocation fails (the allocator returns null). Draft: not meant to be merged as is. No production allocation-path changes.
Step 1:
ScopedFailingAllocator(global allocator of theallocation_failuretest binary only), controller/worker, contract tests and toy scenarios.Step 2:
ddog_Vec_Tag_pushin one-shot and sticky modes, for an empty vector, a vector at capacity, and a long key and value. Every ordinal aborts. The report records the stack and the owned call site, the innermost libdatadog frame that allocates:libdd-common-ffi/src/tags.rs:39and:40, the key and value cloneslibdd-common/src/tag.rs:230,format!inTag::newlibdd-common-ffi/src/vec.rs:112, infallibleVec::push(called fromtags.rs:43)Step 3: arena allocators behind the non-default
allocation-chaos-testfeature.ChaosAllocatorwraps logical requests (ArenaRequest) and backing-chunk growth (ArenaBacking) and shares the harness policy and event counter.StringTable,SetandSliceSetuse that arena only when the feature is on; a production build keepsChainAllocator<VirtualAllocator>. Scenarios: first insertion, insertion from spare capacity, exact chunk exhaustion, growth to a new chunk, and an item larger than the chunk hint, plus a first insertion through each of the three collections. Every ordinal returns an out-of-memory error.Crash outcomes are findings: they are recorded and do not fail the test. A nondeterministic trace does.
Motivation
Find every path in the profiling FFI used by the .NET profiler where an allocation failure causes a crash, panic, abort, hang or leak instead of an out-of-memory error. The findings report (later step) is the input for the fix tickets.
Additional Notes
Next steps: the profile and exporter lifecycle, release isolation, coverage-guided scenario discovery, and
FINDINGS.md. Per-scenario reports are written to$CARGO_TARGET_TMPDIR/allocation_failure/and merged into that file at the last step.Workers disable core dumps (they abort on purpose).
cargo build -p libdd-profiling-ffidoes not enableallocation-chaos-test; the integration test does, through its dev-dependency.How to test the change?
Local validation on Linux aarch64, debug and release. Windows and macOS were not run locally (CI only).
Jira: PROF-16808