Skip to content

fix(crashtracking): handle new lines in client submitted exception message - #1836

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
gyuheon0h/PROF-14177-handle-newline-msg
Apr 1, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
gyuheon0h/PROF-14177-handle-newline-msg

Conversation

@gyuheon0h

@gyuheon0h gyuheon0h commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Escapes new lines from API consumer submitted unhandled exception message, then unescapes it when writing the report. This is necessary, because API consumers can submit arbitrary exception messages, and if they contain new lines, the receiver state machine parsing breaks as it depends on chunks of data being sent as lines.

Motivation

This crash log has no message because the exception message being sent has new lines in it

Additional Notes

I've looked at other places where API consumers submit raw strings that we just pass in raw, and I cannot find other plausible places where this could be an issue

How to test the change?

Bin_test updated to include a new line in the input to the unhandled exception API

gyuheon0h commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

@gyuheon0h gyuheon0h changed the title Handle newlines fix(crashtracking): handle new lines in client submitted exception message Apr 1, 2026
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

Summary by Rule

Rule Base Branch PR Branch Change

Annotation Counts by File

File Base Branch PR Branch Change

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 20 20 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 55 55 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 8 8 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 195 195 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@gyuheon0h
gyuheon0h marked this pull request as ready for review April 1, 2026 14:20
@gyuheon0h
gyuheon0h requested a review from a team as a code owner April 1, 2026 14:20
@gyuheon0h
gyuheon0h requested a review from gleocadie April 1, 2026 14:20
@datadog-official

datadog-official Bot commented Apr 1, 2026

Copy link
Copy Markdown

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 28.57%
Overall Coverage: 71.48% (-0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 984afb9 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@codecov-commenter

codecov-commenter commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.48%. Comparing base (4ee2470) to head (984afb9).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           gyuheon0h/fix-stale-prebuild    #1836      +/-   ##
================================================================
- Coverage                         71.50%   71.48%   -0.03%     
================================================================
  Files                               426      426              
  Lines                             67096    67100       +4     
================================================================
- Hits                              47978    47965      -13     
- Misses                            19118    19135      +17     
Components Coverage Δ
libdd-crashtracker 65.97% <33.33%> (-0.04%) ⬇️
libdd-crashtracker-ffi 34.09% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 86.20% <ø> (ø)
libdd-data-pipeline-ffi 72.22% <ø> (ø)
libdd-common 79.94% <ø> (ø)
libdd-common-ffi 73.87% <ø> (ø)
libdd-telemetry 62.78% <ø> (ø)
libdd-telemetry-ffi 16.75% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 70.31% <ø> (-2.25%) ⬇️
libdd-profiling 82.05% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 64.94% <ø> (ø)
datadog-sidecar 31.38% <ø> (+0.03%) ⬆️
datdog-sidecar-ffi 11.84% <ø> (ø)
spawn-worker 54.69% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.24% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 88.73% <ø> (ø)
datadog-tracer-flare 86.88% <ø> (ø)
libdd-log 74.69% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gyuheon0h

Copy link
Copy Markdown
Contributor Author

Gonna verify end to end before merging this

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

LGTM

@dd-octo-sts

dd-octo-sts Bot commented Apr 1, 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.so 8.76 MB 8.76 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 102.11 MB 102.12 MB +0% (+6.43 KB) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 119.08 MB 119.12 MB +.03% (+42.49 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.36 MB 11.36 MB +0% (+640 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 27.41 MB 27.41 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 80.69 KB 80.69 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 187.83 MB 187.84 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 924.51 MB 924.51 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.06 MB 9.06 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 80.69 KB 80.69 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 27.01 MB 27.01 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 61.33 MB 61.33 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.27 MB 23.27 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 81.94 KB 81.94 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 192.37 MB 192.39 MB +0% (+16.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 909.65 MB 909.65 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.90 MB 6.90 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 81.94 KB 81.94 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 29.12 MB 29.12 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 57.70 MB 57.70 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 88.96 MB 88.97 MB +.01% (+12.43 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 10.34 MB 10.34 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 111.75 MB 111.78 MB +.02% (+29.92 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 12.09 MB 12.09 MB +0% (+272 B) 👌

@gyuheon0h

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Apr 1, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-04-01 15:25:48 UTC ℹ️ Start processing command /merge


2026-04-01 15:25:52 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 45m (p90).


2026-04-01 15:49:39 UTC ⚠️ MergeQueue: This merge request build was cancelled

gyuheon.oh@datadoghq.com cancelled this merge request build

@gyuheon0h
gyuheon0h changed the base branch from main to graphite-base/1836 April 1, 2026 17:51
@gyuheon0h
gyuheon0h force-pushed the gyuheon0h/PROF-14177-handle-newline-msg branch from 70768f7 to 1aa5b50 Compare April 1, 2026 17:51
@gyuheon0h
gyuheon0h changed the base branch from graphite-base/1836 to gyuheon0h/fix-stale-prebuild April 1, 2026 17:51
@gyuheon0h
gyuheon0h force-pushed the gyuheon0h/PROF-14177-handle-newline-msg branch from 1aa5b50 to 984afb9 Compare April 1, 2026 17:58
Base automatically changed from gyuheon0h/fix-stale-prebuild to main April 1, 2026 19:25
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot requested a review from a team as a code owner April 1, 2026 19:25
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 02d95c0 into main Apr 1, 2026
121 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the gyuheon0h/PROF-14177-handle-newline-msg branch April 1, 2026 20:13
hoolioh added a commit that referenced this pull request Aug 19, 2026
# Release proposal for libdd-crashtracker, libdd-gotter and their
dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-gotter
**Next version:** `1.0.0`
**Semver bump:** `major`
**Tag:** `libdd-gotter-v1.0.0`

**Warning:** this is an initial release. Please verify that the version
and commits included are correct.


## libdd-crashtracker
**Next version:** `2.0.0`
**Semver bump:** `major`
**Tag:** `libdd-crashtracker-v2.0.0`

### ⚠️ major bump forced due to:

- `libdd-common`: ^1.0.0 → ^5.2.0
- `libdd-telemetry`: ^1.0.0 → ^7.0.0

### Commits

- feat(crashtracking)!: retrieve c assert message for linux when
`__assert_fail` is dynamically loaded (#2268)
- test: skip/shorten slow miri jobs (#2331)
- feat(crashtracking): send debug log when no data is received at all
(#2321)
- fix(crashtracking): check fields and exclude uuid for `has_data`
(#2322)
- refactor: migrate to workspace dependencies, phase 4 (#2296)
- refactor: migrate to workspace dependencies, phase 3 (#2283)
- chore: moving to workspace-level dependencies, phase 2 (#2270)
- refactor: consolidate core dependencies at workspace level (phase 1)
(#2253)
- test: stabilize flaky tests (#2256)
- feat(telemetry)!: make telemetry worker wasm-compatible for the
TraceExporter (#2172)
- chore(crashtracking): harden multi thread ptrace collection (#2216)
- fix(sidecar): don't double-encode file:// telemetry endpoints (#2230)
- fix: new clippy lints (#2219)
- refactor(sidecar)!: Avoid a dedicated socket for crashtracker (#2179)
- refactor(clippy): prefer core and alloc imports (#2196)
- refactor(libdd-telemetry)!: avoid leaking libdd-common types in the
public API (#2152)
- feat(crashtracking): collect all native stacks for unhandled exception
and also crashing thread (#2155)
- fix(crashtracking): sanitize type and message for unhandled exceptions
(#2148)
- fix(crashtracking): multi thread collection centos flakes harden
(#2113)
- chore(crashtracking)!: remove frame count experimental field (#2114)
- fix(crashtracking): authenticate peer granted socket ptrace access
(#2098)
- feat(crashtracking)!: add experimental frame count field (#2099)
- fix(crashtracker): increase test_waitall_nohang timeout to 500ms
(#2097)
- fix(crashtracker): support socket based receiver for all thread
collection (#2080)
- fix(crashtracker): set failed thread stack collection as incomplete
empty stack (#2079)
- fix(crashtracking)!: flatten all threads object into a list of
`ThreadData` (#2054)
- refactor(crashtracker): update imports to linux only (#2036)
- fix(crashtracker): move preload logger marking after recursive guard
(#2023)
- fix(libdd-telemetry): restore previous Cargo.toml version (#1993)
- feat!: integrate obfuscation to the stats exporter [APMSP-2764]
(#1819)
- chore(crashtracking)!: create errorsintake crash ping directly from
telemetry (#1963)
- feat(telemetry)!: include dependencies and integrations in
app-extended-heartbeat (#1962)
- feat(crashtracking)!: collect all threads (#1878)
- chore(crashtracking): bump libdatadog-libunwind to v1.0.2 (#1942)
- chore(crashtracking): default errors intake crash report upload to be
on (#1902)
- chore(libdd-crashtracker): remove path reference for
libdd-libunwind-sys (#1877)
- fix(crashtracking): handle new lines in client submitted exception
message (#1836)
- fix(crashtracker): Fix bin_tests in gitlab (#1832)
- feat(crashtracking)!: improve parity between errors intake payload and
telemetry intake payload (#1823)
- feat(crashtracking)!: emit ucontext registers as structured data
(#1787)
- fix(ci): use single threaded for all tests that mutate signal state
and use non-fatal signal (#1812)
- fix(crashtracking): fix SIGCHLD signal guarding while in CT signal
handler (#1807)
- fix(ci): use single threaded to avoid race conditions for sa guard
tests (#1800)
- fix(crashtracking): guard sigchld and sigpipe during crashtracker
signal handler execution (#1771)
- chore(crashtracking): preserve errno for crashtracker (#1767)
- chore(crashtracker): use weaker mem ordering for OP_COUNTERS (#1744)
- chore(crashtracking): rename target triple to runtime platform (#1747)
- chore(ci): give libdd-libunwind-sys its own version (#1743)
- chore(crashtracking): add tag for target triple (#1741)
- refactor(libdd-crashtracker)!: avoid leaking Endpoint through the
public API (#1705)
- chore(cargo): bump to 29.0.0 (#1702)
- fix(crashtracking): use libunwind to unwind frames (#1663)
- chore(deps): bump blazesym to 0.2.3 and blazesym-c to 0.1.7 (#1654)
- chore(ci): fix crashtracker receiver binary rpath setting (#1652)
- chore(crashtracking): emit a best effort stacktrace for Mac (#1645)
- chore(crashtracker): use default-features=false for aws-lc-sys (#1625)
- feat(crashtracking): report unhandled exceptions (#1596)
- refactor(ddcommon)!: remove direct dependency on hyper client
everywhere in common (#1604)
- feat(crashtracking): include `Kind` in crash ping and clarify
requirements (#1595)
- fix(crashtracking): add process_tags to application field (#1576)
- ci: update nightly in CI to 2026-02-08 (#1539)
- fix(telemetry)!: fix logs payload format [APMSP-2590] (#1498)
- chore(crashtracking): bump os_info crate to 3.14 (#1507)
- Don't bail (#1494)
- feat(crashtracking)!: emit crashing thread name in crash report for
linux crashes (#1485)
- test(crashtracking): add minimal LD preload test for crashtracker
collector (#1428)
- chore: release libddcommon-v1.1.0 (#1456)
- chore: prepare libdd-telemetry-v2.0.0 (#1457)
- [crashtracker] Retrieve panic message when crashing (#1361)
- fix(sidecar): AWS lambda also can return EACCESS for shm_open (#1446)
- chore(crashtracking): add `is_crash_debug` tag to crashtracker
receiver debug logs (#1445)
- [crashtracker] Log errors in crashtracker receiver (#1395)
- chore: add changelog for every published crate (#1396)
- Fix CI (#1389)
- [crashtracker] Set OS info in the crash info builder when receiving
report (#1388)
- crashtracker: support cxx bindings for crashinfo (#1379)


[APMSP-2764]:
https://datadoghq.atlassian.net/browse/APMSP-2764?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: hoolioh <107922352+hoolioh@users.noreply.github.com>
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.

3 participants