-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ArrayIndexOutOfBoundsException in adjustLocalVarsBasedOnArgs #7013
Conversation
ArrayIndexOutOfBoundsException was thrown because size of the args and local vars were not correctly took into account. with Long/Double type it actually takes 2 slots into the local var tables. Add a protection against index out of bounds but also adjust local var array for long or double.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good, thanks!
I only skimmed the adjustLocalVarsBasedOnArgs
test, I saw we are asserting on many test cases but I didn't read them in detail.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.076 s) : 0, 1075776
Total [baseline] (8.557 s) : 0, 8557456
Agent [candidate] (1.083 s) : 0, 1083056
Total [candidate] (8.551 s) : 0, 8550536
section iast
Agent [baseline] (1.21 s) : 0, 1209838
Total [baseline] (9.006 s) : 0, 9005965
Agent [candidate] (1.2 s) : 0, 1199661
Total [candidate] (9.019 s) : 0, 9019080
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.202 s) : 0, 1202185
Total [baseline] (8.971 s) : 0, 8971470
Agent [candidate] (1.205 s) : 0, 1205242
Total [candidate] (8.963 s) : 0, 8963302
section iast_TELEMETRY_OFF
Agent [baseline] (1.199 s) : 0, 1198843
Total [baseline] (9.017 s) : 0, 9017389
Agent [candidate] (1.197 s) : 0, 1197346
Total [candidate] (9.005 s) : 0, 9005469
gantt
title insecure-bank - break down per module: candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (673.253 ms) : 0, 673253
BytebuddyAgent [candidate] (678.169 ms) : 0, 678169
GlobalTracer [baseline] (310.445 ms) : 0, 310445
GlobalTracer [candidate] (312.577 ms) : 0, 312577
AppSec [baseline] (49.488 ms) : 0, 49488
AppSec [candidate] (49.546 ms) : 0, 49546
Remote Config [baseline] (662.293 µs) : 0, 662
Remote Config [candidate] (657.266 µs) : 0, 657
Telemetry [baseline] (7.589 ms) : 0, 7589
Telemetry [candidate] (7.571 ms) : 0, 7571
section iast
BytebuddyAgent [baseline] (800.78 ms) : 0, 800780
BytebuddyAgent [candidate] (792.68 ms) : 0, 792680
GlobalTracer [baseline] (292.562 ms) : 0, 292562
GlobalTracer [candidate] (290.742 ms) : 0, 290742
AppSec [baseline] (50.489 ms) : 0, 50489
AppSec [candidate] (51.158 ms) : 0, 51158
Remote Config [baseline] (668.764 µs) : 0, 669
Remote Config [candidate] (1.368 ms) : 0, 1368
Telemetry [baseline] (7.336 ms) : 0, 7336
Telemetry [candidate] (6.69 ms) : 0, 6690
IAST [baseline] (23.5 ms) : 0, 23500
IAST [candidate] (22.653 ms) : 0, 22653
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (794.64 ms) : 0, 794640
BytebuddyAgent [candidate] (795.655 ms) : 0, 795655
GlobalTracer [baseline] (291.028 ms) : 0, 291028
GlobalTracer [candidate] (291.85 ms) : 0, 291850
AppSec [baseline] (49.898 ms) : 0, 49898
AppSec [candidate] (49.067 ms) : 0, 49067
Remote Config [baseline] (1.406 ms) : 0, 1406
Remote Config [candidate] (1.46 ms) : 0, 1460
Telemetry [baseline] (6.654 ms) : 0, 6654
Telemetry [candidate] (6.635 ms) : 0, 6635
IAST [baseline] (24.151 ms) : 0, 24151
IAST [candidate] (26.219 ms) : 0, 26219
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (791.859 ms) : 0, 791859
BytebuddyAgent [candidate] (790.583 ms) : 0, 790583
GlobalTracer [baseline] (290.309 ms) : 0, 290309
GlobalTracer [candidate] (290.894 ms) : 0, 290894
AppSec [baseline] (49.417 ms) : 0, 49417
AppSec [candidate] (49.542 ms) : 0, 49542
Remote Config [baseline] (613.065 µs) : 0, 613
Remote Config [candidate] (592.972 µs) : 0, 593
Telemetry [baseline] (7.36 ms) : 0, 7360
Telemetry [candidate] (6.585 ms) : 0, 6585
IAST [baseline] (24.882 ms) : 0, 24882
IAST [candidate] (24.819 ms) : 0, 24819
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.083 s) : 0, 1083038
Total [baseline] (10.437 s) : 0, 10437395
Agent [candidate] (1.084 s) : 0, 1083922
Total [candidate] (10.459 s) : 0, 10458959
section appsec
Agent [baseline] (1.191 s) : 0, 1190683
Total [baseline] (10.444 s) : 0, 10444316
Agent [candidate] (1.189 s) : 0, 1189226
Total [candidate] (10.462 s) : 0, 10461522
section iast
Agent [baseline] (1.203 s) : 0, 1203399
Total [baseline] (10.711 s) : 0, 10711307
Agent [candidate] (1.202 s) : 0, 1202181
Total [candidate] (10.768 s) : 0, 10767939
section profiling
Agent [baseline] (1.274 s) : 0, 1273696
Total [baseline] (10.628 s) : 0, 10628344
Agent [candidate] (1.281 s) : 0, 1281021
Total [candidate] (10.602 s) : 0, 10601684
gantt
title petclinic - break down per module: candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (678.208 ms) : 0, 678208
BytebuddyAgent [candidate] (679.697 ms) : 0, 679697
GlobalTracer [baseline] (312.278 ms) : 0, 312278
GlobalTracer [candidate] (311.853 ms) : 0, 311853
AppSec [baseline] (49.618 ms) : 0, 49618
AppSec [candidate] (49.5 ms) : 0, 49500
Remote Config [baseline] (669.103 µs) : 0, 669
Remote Config [candidate] (661.877 µs) : 0, 662
Telemetry [baseline] (7.677 ms) : 0, 7677
Telemetry [candidate] (7.595 ms) : 0, 7595
section appsec
BytebuddyAgent [baseline] (695.683 ms) : 0, 695683
BytebuddyAgent [candidate] (694.66 ms) : 0, 694660
GlobalTracer [baseline] (293.291 ms) : 0, 293291
GlobalTracer [candidate] (292.785 ms) : 0, 292785
AppSec [baseline] (148.612 ms) : 0, 148612
AppSec [candidate] (148.724 ms) : 0, 148724
Remote Config [baseline] (618.335 µs) : 0, 618
Remote Config [candidate] (615.452 µs) : 0, 615
Telemetry [baseline] (8.492 ms) : 0, 8492
Telemetry [candidate] (8.465 ms) : 0, 8465
IAST [baseline] (19.298 ms) : 0, 19298
IAST [candidate] (19.282 ms) : 0, 19282
section iast
BytebuddyAgent [baseline] (795.829 ms) : 0, 795829
BytebuddyAgent [candidate] (794.665 ms) : 0, 794665
GlobalTracer [baseline] (291.167 ms) : 0, 291167
GlobalTracer [candidate] (291.261 ms) : 0, 291261
AppSec [baseline] (50.14 ms) : 0, 50140
AppSec [candidate] (49.516 ms) : 0, 49516
Remote Config [baseline] (1.316 ms) : 0, 1316
Remote Config [candidate] (664.112 µs) : 0, 664
Telemetry [baseline] (6.589 ms) : 0, 6589
Telemetry [candidate] (6.627 ms) : 0, 6627
IAST [baseline] (23.994 ms) : 0, 23994
IAST [candidate] (25.058 ms) : 0, 25058
section profiling
BytebuddyAgent [baseline] (680.417 ms) : 0, 680417
BytebuddyAgent [candidate] (683.762 ms) : 0, 683762
GlobalTracer [baseline] (381.871 ms) : 0, 381871
GlobalTracer [candidate] (384.111 ms) : 0, 384111
AppSec [baseline] (50.447 ms) : 0, 50447
AppSec [candidate] (50.886 ms) : 0, 50886
Remote Config [baseline] (712.412 µs) : 0, 712
Remote Config [candidate] (713.422 µs) : 0, 713
Telemetry [baseline] (7.549 ms) : 0, 7549
Telemetry [candidate] (7.554 ms) : 0, 7554
ProfilingAgent [baseline] (96.153 ms) : 0, 96153
ProfilingAgent [candidate] (97.044 ms) : 0, 97044
Profiling [baseline] (96.177 ms) : 0, 96177
Profiling [candidate] (97.068 ms) : 0, 97068
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section baseline
no_agent (1.346 ms) : 1326, 1366
. : milestone, 1346,
appsec (1.706 ms) : 1681, 1730
. : milestone, 1706,
appsec_no_iast (1.735 ms) : 1711, 1758
. : milestone, 1735,
iast (1.472 ms) : 1450, 1494
. : milestone, 1472,
profiling (1.486 ms) : 1463, 1510
. : milestone, 1486,
tracing (1.466 ms) : 1443, 1489
. : milestone, 1466,
section candidate
no_agent (1.345 ms) : 1326, 1364
. : milestone, 1345,
appsec (1.699 ms) : 1674, 1723
. : milestone, 1699,
appsec_no_iast (1.694 ms) : 1669, 1719
. : milestone, 1694,
iast (1.462 ms) : 1439, 1485
. : milestone, 1462,
profiling (1.534 ms) : 1508, 1561
. : milestone, 1534,
tracing (1.46 ms) : 1437, 1484
. : milestone, 1460,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section baseline
no_agent (365.019 µs) : 346, 385
. : milestone, 365,
iast (463.946 µs) : 444, 484
. : milestone, 464,
iast_FULL (532.252 µs) : 512, 553
. : milestone, 532,
iast_GLOBAL (489.901 µs) : 469, 511
. : milestone, 490,
iast_HARDCODED_SECRET_DISABLED (467.669 µs) : 447, 488
. : milestone, 468,
iast_INACTIVE (438.18 µs) : 418, 459
. : milestone, 438,
iast_TELEMETRY_OFF (466.094 µs) : 445, 487
. : milestone, 466,
tracing (435.484 µs) : 415, 456
. : milestone, 435,
section candidate
no_agent (364.707 µs) : 345, 385
. : milestone, 365,
iast (466.148 µs) : 446, 487
. : milestone, 466,
iast_FULL (528.943 µs) : 508, 550
. : milestone, 529,
iast_GLOBAL (482.049 µs) : 462, 502
. : milestone, 482,
iast_HARDCODED_SECRET_DISABLED (469.652 µs) : 449, 490
. : milestone, 470,
iast_INACTIVE (445.72 µs) : 424, 468
. : milestone, 446,
iast_TELEMETRY_OFF (463.554 µs) : 443, 485
. : milestone, 464,
tracing (438.458 µs) : 418, 459
. : milestone, 438,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section baseline
no_agent (15.052 s) : 15052000, 15052000
. : milestone, 15052000,
appsec (15.058 s) : 15058000, 15058000
. : milestone, 15058000,
iast (18.68 s) : 18680000, 18680000
. : milestone, 18680000,
iast_GLOBAL (18.062 s) : 18062000, 18062000
. : milestone, 18062000,
profiling (15.439 s) : 15439000, 15439000
. : milestone, 15439000,
tracing (14.898 s) : 14898000, 14898000
. : milestone, 14898000,
section candidate
no_agent (15.217 s) : 15217000, 15217000
. : milestone, 15217000,
appsec (15.02 s) : 15020000, 15020000
. : milestone, 15020000,
iast (18.943 s) : 18943000, 18943000
. : milestone, 18943000,
iast_GLOBAL (17.912 s) : 17912000, 17912000
. : milestone, 17912000,
profiling (15.213 s) : 15213000, 15213000
. : milestone, 15213000,
tracing (15.033 s) : 15033000, 15033000
. : milestone, 15033000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.35.0-SNAPSHOT~283052bf29, baseline=1.35.0-SNAPSHOT~6df14c1b0f
dateFormat X
axisFormat %s
section baseline
no_agent (1.463 ms) : 1452, 1475
. : milestone, 1463,
appsec (2.214 ms) : 2179, 2248
. : milestone, 2214,
iast (1.888 ms) : 1853, 1923
. : milestone, 1888,
iast_GLOBAL (1.924 ms) : 1889, 1959
. : milestone, 1924,
profiling (2.323 ms) : 2145, 2502
. : milestone, 2323,
tracing (1.843 ms) : 1811, 1875
. : milestone, 1843,
section candidate
no_agent (1.467 ms) : 1456, 1479
. : milestone, 1467,
appsec (2.212 ms) : 2178, 2246
. : milestone, 2212,
iast (1.891 ms) : 1856, 1926
. : milestone, 1891,
iast_GLOBAL (1.932 ms) : 1897, 1967
. : milestone, 1932,
profiling (1.864 ms) : 1831, 1897
. : milestone, 1864,
tracing (1.845 ms) : 1813, 1877
. : milestone, 1845,
|
What Does This Do
Add a protection against index out of bounds but also adjust local var array for long or double.
Motivation
ArrayIndexOutOfBoundsException
was thrown because size of the args and local vars were not correctly took into account. with Long/Double type it actually takes 2 slots into the local var tables.Additional Notes
Jira ticket: DEBUG-2373