Skip to content

fix(crashtracking): check fields and exclude uuid for has_data - #2322

Merged
gyuheon0h merged 3 commits into
mainfrom
gyuheon0h/has-data-field-check
Aug 5, 2026
Merged

fix(crashtracking): check fields and exclude uuid for has_data#2322
gyuheon0h merged 3 commits into
mainfrom
gyuheon0h/has-data-field-check

Conversation

@gyuheon0h

@gyuheon0h gyuheon0h commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Excludes uuid field from CrashInfoBuilder when checking for has_data

Motivation

Previously, the has_data check would compare the whole struct against Self::default(). However, uuid is generated when the builder is created, so this would always return true

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@gyuheon0h gyuheon0h changed the title Check fields exclude uuid for has_data fix(crashtracking): check fields and exclude uuid for has_data Aug 5, 2026
@gyuheon0h
gyuheon0h force-pushed the gyuheon0h/has-data-field-check branch from e46ad6c to c0f2ebb Compare August 5, 2026 17:04
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation Check Results

⚠️ 1104 documentation warning(s) found

📦 libdd-crashtracker - 1104 warning(s)


Updated: 2026-08-05 17:31:44 UTC | Commit: bda4e34 | missing-docs job results

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔒 Cargo Deny Results

⚠️ 2 issue(s) found, showing only errors (advisories, bans, sources)

📦 libdd-crashtracker - 2 error(s)

Show output
error[vulnerability]: Invalid pointer dereference in `fmt::Pointer` impl for `Atomic` and `Shared` when the underlying pointer is invalid
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:59:1
   │
59 │ crossbeam-epoch 0.9.18 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0204
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0204
   ├ Affected versions of `fmt::Display` dereference the underlying pointer. This causes a invalid pointer dereference e.g., when a pointer created with `Atomic::null` or `Shared::null`. `fmt::Debug` impls and pre-0.9 `fmt::Display` impls, which do not dereference pointers, are not affected by this issue.
   ├ Announcement: https://github.com/crossbeam-rs/crossbeam/pull/1276
   ├ Solution: Upgrade to >=0.9.20 (try `cargo update -p crossbeam-epoch`)
   ├ crossbeam-epoch v0.9.18
     └── crossbeam-deque v0.8.5
         └── rayon-core v1.12.1
             └── rayon v1.10.0
                 └── criterion v0.5.1
                     ├── (dev) libdd-crashtracker v1.0.0
                     └── (dev) libdd-ddsketch v1.1.0
                         └── libdd-telemetry v6.0.0
                             └── libdd-crashtracker v1.0.0 (*)

error[unsound]: Rand is unsound with a custom logger using `rand::rng()`
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:204:1
    │
204 │ rand 0.8.5 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
    │
    ├ ID: RUSTSEC-2026-0097
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0097
    ├ It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
      
      - The `log` and `thread_rng` features are enabled
      - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined
      - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`
      - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
      - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed
      
      `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.
    ├ Announcement: https://github.com/rust-random/rand/pull/1763
    ├ Solution: Upgrade to >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 (try `cargo update -p rand`)
    ├ rand v0.8.5
      ├── libdd-common v5.1.0
      │   ├── libdd-capabilities-impl v3.0.0
      │   │   ├── libdd-crashtracker v1.0.0
      │   │   ├── libdd-shared-runtime v2.0.0
      │   │   │   └── libdd-telemetry v6.0.0
      │   │   │       └── libdd-crashtracker v1.0.0 (*)
      │   │   └── (dev) libdd-telemetry v6.0.0 (*)
      │   ├── (build) libdd-crashtracker v1.0.0 (*)
      │   ├── libdd-shared-runtime v2.0.0 (*)
      │   └── libdd-telemetry v6.0.0 (*)
      ├── libdd-crashtracker v1.0.0 (*)
      └── (dev) libdd-ddsketch v1.1.0
          └── libdd-telemetry v6.0.0 (*)

advisories FAILED, bans ok, sources ok

Updated: 2026-08-05 17:31:12 UTC | Commit: bda4e34 | dependency-check job results

@gyuheon0h
gyuheon0h force-pushed the gyuheon0h/has-data-field-check branch from c0f2ebb to d9cc808 Compare August 5, 2026 17:09
@gyuheon0h
gyuheon0h marked this pull request as ready for review August 5, 2026 17:09
@gyuheon0h
gyuheon0h requested review from a team as code owners August 5, 2026 17:09
@datadog-official

datadog-official Bot commented Aug 5, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 75.07% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 55c8d8c | Docs | Datadog PR Page | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9cc80831c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

let mut blank = Self::default();
blank.uuid = self.uuid;

self != &blank

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Don't drop streams that only reached config

When the collector starts a real crash report, emit_crashreport writes and flushes the config before message/siginfo/kind, and process_line stores that config outside CrashInfoBuilder. If the collector exits or the pipe closes after the config block but before the first builder field, this new comparison leaves has_data() false, so receive_report_from_stream returns Ok(None) and the receiver silently treats a partial crash report as normal termination instead of surfacing the incomplete report/error. Consider tracking that any crash-report section was received, or include config.is_some() in the post-loop decision.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

@pr-commenter

pr-commenter Bot commented Aug 5, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-08-05 17:45:00

Comparing candidate commit d9cc808 in PR branch gyuheon0h/has-data-field-check with baseline commit 8b3d8ee in branch main.

Found 3 performance improvements and 0 performance regressions! Performance is the same for 137 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:vec_map/get_hit/128

  • 🟩 execution_time [-1.112µs; -1.090µs] or [-7.530%; -7.384%]
  • 🟩 throughput [+692134.104op/s; +704569.516op/s] or [+7.984%; +8.127%]

scenario:vec_map/get_miss/64

  • 🟩 execution_time [-20.223ns; -20.122ns] or [-42.052%; -41.841%]

Benchmark execution time: 2026-08-05 17:54:59

Comparing candidate commit d9cc808 in PR branch gyuheon0h/has-data-field-check with baseline commit 8b3d8ee in branch main.

Found 3 performance improvements and 6 performance regressions! Performance is the same for 159 metrics, 10 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:alloc_free/system/256

  • 🟥 execution_time [+1.211ns; +1.274ns] or [+8.493%; +8.929%]

scenario:alloc_free/system/4096

  • 🟥 execution_time [+5.265ns; +5.446ns] or [+6.060%; +6.268%]

scenario:glob_matcher/unicode_exact_match/wall_time

  • 🟥 execution_time [+3.270ns; +3.389ns] or [+4.368%; +4.526%]

scenario:glob_matcher/unicode_pattern_ascii_subject/wall_time

  • 🟥 execution_time [+4.925ns; +5.008ns] or [+5.488%; +5.580%]

scenario:glob_matcher/unicode_pattern_wildcard_match/wall_time

  • 🟥 execution_time [+6.183ns; +6.267ns] or [+5.013%; +5.081%]

scenario:profiler_attached/fast_path_system/4096

  • 🟥 execution_time [+13.846ns; +14.053ns] or [+13.276%; +13.474%]

scenario:profiler_attached/slow_path_system/4096

  • 🟩 execution_time [-8.851ns; -8.686ns] or [-5.763%; -5.655%]

scenario:trace_buffer/2_senders/no_delay

  • 🟩 execution_time [-91.730µs; -75.401µs] or [-5.134%; -4.220%]
  • 🟩 throughput [+44623.427op/s; +54349.458op/s] or [+4.427%; +5.391%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

@gyuheon0h
gyuheon0h marked this pull request as draft August 5, 2026 17:17

@danielsn danielsn 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.

But please set a description and motivation for this PR

Comment thread rust-toolchain.toml Outdated
@gyuheon0h
gyuheon0h marked this pull request as ready for review August 5, 2026 17:20
@dd-octo-sts

dd-octo-sts Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 87.84 MB 87.84 MB +0% (+1.24 KB) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.07 MB 8.07 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 98.97 MB 98.98 MB +0% (+1.21 KB) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.88 MB 10.88 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.21 MB 26.21 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 89.92 KB 89.92 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 188.66 MB 188.66 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 985.57 MB 985.57 MB +0% (+2.13 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.56 MB 8.56 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 89.92 KB 89.92 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.22 MB 25.22 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 50.23 MB 50.23 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 22.84 MB 22.84 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 91.33 KB 91.33 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 193.44 MB 193.44 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 974.34 MB 974.34 MB +0% (+2.16 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.61 MB 6.61 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 91.33 KB 91.33 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.12 MB 27.12 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 47.83 MB 47.83 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 78.21 MB 78.22 MB +0% (+504 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.00 MB 9.00 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 93.85 MB 93.85 MB +0% (+472 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.97 MB 10.97 MB +.03% (+4.00 KB) 🔍

@gyuheon0h
gyuheon0h merged commit 1674a4a into main Aug 5, 2026
58 checks passed
@gyuheon0h
gyuheon0h deleted the gyuheon0h/has-data-field-check branch August 5, 2026 18:16
bwoebi added a commit that referenced this pull request Aug 7, 2026
…mote_config/agentless_fetcher

* 'main' of github.com:DataDog/libdatadog:
  feat(data-pipeline)!: add flush_and_close to the trace buffer (#2313)
  refactor(rc)!: make conversion from RemoteConfigProduct back and forth generally available (#2325)
  chore: release v40.0.0 (#2326)
  feat(datadog-ffe): server-side EVP flagevaluation payload + bincode-safe sidecar delivery (#2117)
  feat(data-pipeline): set structured span values (#2300)
  feat(telemetry)!: Add Installation signature and AppProduct changes payloads (#2213)
  fix(libdd-trace-utils): apply SpanLink flags masking when v0.5 json encoding (#2314)
  feat(data-pipeline): encode structured values (#2304)
  feat(crashtracking): send debug log when no data is received at all (#2321)
  chore: release v39.0.0 (#2324)
  feat(data-pipeline): add span links FFI (#2305)
  fix(crashtracking): check fields and exclude uuid for `has_data` (#2322)
  feat(data-pipeline): add span events FFI (#2301)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants