Repository navigation
Conversation
|
@DataDog review |
There was a problem hiding this comment.
More details
The reviewed encoding and serialization paths handle supplementary characters and embedded NULs through UTF-16 conversion and explicit byte lengths. The static specialist returned no actionable findings; runtime behavior was not exercised.
🤖 Bits Code Review · Commit 63bea21
Memory overhead check: ✅ within budgetProfiler
✅ Not budgeted (too noisy on shared runners)
|
CI Test ResultsRun: #46001539087 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Failed Jobs
Summary: Total: 32 | Passed: 31 | Failed: 1 Updated: 2026-11-27 13:15:29 UTC |
|
❌ 29 passed, 1 failed out of 30 expected configurations Test Matrix
Failure Detailsglibc-x64-hotspot-jdk8Tracer+profiler: Links
10 not applicable (not scheduled): musl-x64-openj9, musl-arm64-openj9. OpenJ9 requires glibc; upstream publishes no musl runtime. |
…en conversion fails
…late conversion test fakes
… no path stores raw JVMTI bytes
…er.h and test its boundary branches
…d and cover transcoder lead-byte bounds
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Explicit byte lengths preserve converted NUL bytes through JFR thread serialization, and truncation avoids splitting surrogate pairs. The completed static review identified no actionable defects.
🤖 Bits Code Review · Commit f590bd4
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 4 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 06f9283 | Docs | View more details | Give us feedback! |
|
@DataDog review |
There was a problem hiding this comment.
More details
The UTF-8 conversion preserves callers’ buffer-size assumptions and truncates at character boundaries. The completed static review found no actionable defects, and human PR discussion did not change that conclusion.
🤖 Bits Code Review · Commit 3043993
|
@DataDog review |
There was a problem hiding this comment.
More details
The completed static review found no actionable defect in UTF-8 conversion, buffer sizing, or character-boundary truncation. Human PR discussion did not change that assessment.
🤖 Bits Code Review · Commit e0cb8ae
|
Review of Test: pin the
|
|
Thanks @rkennke, added in a202dc4 (
With the |
|
@DataDog review |
There was a problem hiding this comment.
More details
The conversion preserves the input-length bound that callers use to reserve JFR buffer space and avoids splitting UTF-8 characters at the string cap. The bounded-input case raised in human discussion is covered in the reviewed head.
🤖 Bits Code Review · Commit a202dc4
|
@DataDog review |
There was a problem hiding this comment.
More details
The UTF-8 conversion preserves callers’ buffer-sizing assumptions by never expanding the input and truncating at character boundaries. The completed static review reported no actionable defects; human PR discussion did not change that assessment.
🤖 Bits Code Review · Commit 06f9283
What does this PR do?:
Writes every string in a java-profiler recording as standard UTF-8.
C0 80and a supplementary character as a 6-byte surrogate pair. The JDK's JFR parser decodes encoding-3 strings withnew String(bytes, UTF_8), so these read back as replacement characters. Affected: thread names (JVMTIGetThreadInfo), class and method names (GetClassSignature,GetMethodName), endpoints, labels and context values (JNIGetStringUTFChars), and system properties. Native thread names from/procare cut at 15 bytes and could end in half a character.Buffer::putUtf8converts every string withtoStandardUtf8(standardUtf8.h):C0 80becomes00, and a surrogate pair becomes its 4-byte form;?;MAX_STRING_LENGTHcap never splits a character.Motivation:
PROF-16874. Found while fixing the same bug for virtual-thread names in #1049.
Additional Notes:
putUtf8is the only writer of JFR strings, so one change covers every source. The dictionaries keep the bytes they store, so the per-request JNI paths (endpoints, context values) do no extra work.?replaces 1. Callers size their buffer flushes from the input length, so they stay correct.?. Before, the raw byte reached the file, and readers showed a replacement character for it.updateThreadNamedoes not delete thethread_groupandcontext_class_loaderlocal refs fromGetThreadInfo. They are freed when the JNI call or JVMTI callback returns. It predates this PR.JavaConventionsPluginnow setsoptions.encoding = "UTF-8". The new tests use a non-ASCII method name, and javac on JDK 17 under a C locale would otherwise read sources as ASCII. JDK 18 and later already default to UTF-8.50d0266, then/code-reviewmedium on each later commit. No Critical or High findings remain.How to test the change?:
putUtf8writes the raw bytes, asmaindoes:mainThreadNameEncodingTestworker-😀-é中-a\u0000bworker-��-é中-a��bEndpointEncodingTestGET /items/😀-é中-a\u0000band operationGET /items/��-é中-a��bMethodNameEncodingTestburn𝒜éburn��éNativeThreadNameEncodingTest(Linux)/procnamenative-é中plus the first 2 bytes of中For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.