Skip to content

Avoid false warning when no stacktrace#11971

Open
jpbempel wants to merge 2 commits into
masterfrom
jpbempel/fix-warn-er
Open

Avoid false warning when no stacktrace#11971
jpbempel wants to merge 2 commits into
masterfrom
jpbempel/fix-warn-er

Conversation

@jpbempel

@jpbempel jpbempel commented Jul 16, 2026

Copy link
Copy Markdown
Member

What Does This Do

Motivation

Additional Notes

Contributor Checklist

Jira ticket: DEBUG-5780

@jpbempel
jpbempel requested a review from a team as a code owner July 16, 2026 10:21
@jpbempel
jpbempel requested review from P403n1x87 and removed request for a team July 16, 2026 10:21
@jpbempel jpbempel added comp: debugger Dynamic Instrumentation type: bug fix Bug fix labels Jul 16, 2026

@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: ad80be391c

ℹ️ 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".

Comment on lines +200 to +201
if (innerTrace.length == 0) {
return true;

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 Skip empty stack traces before indexing

When currentEx.getStackTrace() is empty but there are stored snapshots, this true lets processSnapshotsAndSetTags continue to mapping[currentIdx] and later innerTrace[currentIdx]; both arrays are length 0 in that no-stacktrace case, so the exception debugger throws instead of quietly skipping assignment. This should return false (or otherwise skip without warning) rather than treating the sanity check as passed.

Useful? React with 👍 / 👎.

@datadog-prod-us1-5 datadog-prod-us1-5 Bot 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.

Datadog Autotest: FAIL

PR #11971 introduces a critical regression. While it successfully avoids a false warning when exceptions have no stacktrace by adding an early return, it returns true instead of false. This allows the code to proceed to innerTrace[currentIdx] access, causing an ArrayIndexOutOfBoundsException crash. The fix is a one-line change: return false instead of true when innerTrace.length == 0, which gracefully skips the snapshot and achieves the original goal without crashing.

View proposed fix
📊 Validated against 1 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit ad80be3 · What is Autotest? · Any feedback? Reach out in #autotest

String className = snapshot.getProbe().getLocation().getType();
String methodName = snapshot.getProbe().getLocation().getMethod();
if (innerTrace.length == 0) {
return true;

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.

P0 ArrayIndexOutOfBoundsException when exception has empty stacktrace

Production crash when processing exceptions with empty stacktraces (known to occur in AWS Lambda and other environments)

Assertion details
  • Input: Exception with getStackTrace() returning empty array (length 0)
  • Expected: Snapshot should be skipped gracefully without warning or crash
  • Actual: Crash with ArrayIndexOutOfBoundsException at innerTrace[currentIdx] access (line 176)

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · Any feedback? Reach out in #autotest

Suggested change
return true;
return false;

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 57.18% (-0.03%)

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

@pr-commenter

pr-commenter Bot commented Jul 16, 2026

Copy link
Copy Markdown

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1784272801 1784273155
end_time 2026-07-17T07:21:27 2026-07-17T07:27:20
git_branch master jpbempel/fix-warn-er
git_commit_sha 6c8dfc8 4356d4b
start_time 2026-07-17T07:20:02 2026-07-17T07:25:56
See matching parameters
Baseline Candidate
ci_job_id 1868218554 1868218554
ci_pipeline_id 125203492 125203492
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1784272196 1784272196

Summary

Found 5 performance improvements and 0 performance regressions! Performance is the same for 4 metrics, 6 unstable metrics.

scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:loop better
[-486.442µs; -306.850µs] or [-5.235%; -3.302%]
better
[-507.381µs; -320.774µs] or [-5.398%; -3.413%]
better
[-499.598µs; -315.275µs] or [-5.274%; -3.328%]
better
[-513.142µs; -320.158µs] or [-5.350%; -3.338%]
better
[+2.307op/s; +5.746op/s] or [+2.191%; +5.459%]
See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-42.398µs; +26.338µs] or [-14.137%; +8.782%]
unstable
[-59.407µs; +35.968µs] or [-17.110%; +10.359%]
unstable
[-68.559µs; +47.808µs] or [-18.879%; +13.165%]
unstable
[-124.246µs; +170.308µs] or [-9.951%; +13.640%]
same
scenario:basic same same same unstable
[+145.888µs; +386.581µs] or [+14.042%; +37.209%]
unstable
[-133.657op/s; +133.657op/s] or [-5.346%; +5.346%]
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (347.201 µs) : 293, 401
.   : milestone, 347,
basic (297.964 µs) : 290, 306
.   : milestone, 298,
loop (9.399 ms) : 9276, 9521
.   : milestone, 9399,
section candidate
noprobe (335.482 µs) : 301, 370
.   : milestone, 335,
basic (296.306 µs) : 288, 305
.   : milestone, 296,
loop (8.985 ms) : 8980, 8990
.   : milestone, 8985,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 347.201 µs [293.414 µs, 400.988 µs]
basic 297.964 µs [290.214 µs, 305.713 µs]
loop 9.399 ms [9.276 ms, 9.521 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 335.482 µs [300.587 µs, 370.376 µs]
basic 296.306 µs [287.778 µs, 304.834 µs]
loop 8.985 ms [8.98 ms, 8.99 ms]

@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.98 s 13.99 s [-0.9%; +0.7%] (no difference)
startup:insecure-bank:tracing:Agent 12.88 s 13.01 s [-1.7%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 16.84 s 16.16 s [-0.3%; +8.7%] (no difference)
startup:petclinic:iast:Agent 16.86 s 16.91 s [-1.2%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 16.52 s 16.77 s [-2.6%; -0.5%] (maybe better)
startup:petclinic:sca:Agent 16.94 s 16.84 s [-0.3%; +1.5%] (no difference)
startup:petclinic:tracing:Agent 16.07 s 15.69 s [-2.0%; +6.9%] (no difference)

Commit: 4356d4bd · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: debugger Dynamic Instrumentation type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant