-
Notifications
You must be signed in to change notification settings - Fork 292
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
Avoid exception when capturing fields in jdk16+ #7774
Conversation
Since jdk16, calling setAccessible(true) on fields that are on another java module that is not open/exported will result with InaccessibleObjectException thrown each time. To avoid this exception we can call `trySetAccessible` that will return true if we can call setAccessible without exception. The method `trySetAccessible` is only available since jdk9 so we need to use MethodHandle on it to be able to call it only when it is available. NB: setAccessible for jdk8 will always work anyway. InaccessibleObjectException provides a useful message for the cause of this error and we have added back a similar message by getting the module where resides the field that is not accessible to explain to the user why the field is not captured what it can do to resolve the problem. Fix also the report of evaluation errors for log template for inaccessible fields inside an object (marked UNDEFINED)
Debugger benchmarksParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 8 metrics, 7 unstable metrics. See unchanged results
Request duration reports for reportsgantt
title reports - request duration [CI 0.99] : candidate=None, baseline=None
dateFormat X
axisFormat %s
section baseline
noprobe (318.803 µs) : 255, 383
. : milestone, 319,
basic (308.887 µs) : 293, 324
. : milestone, 309,
loop (10.316 ms) : 10271, 10361
. : milestone, 10316,
section candidate
noprobe (295.359 µs) : 272, 319
. : milestone, 295,
basic (302.026 µs) : 294, 310
. : milestone, 302,
loop (10.34 ms) : 10314, 10366
. : milestone, 10340,
|
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 54 metrics, 9 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.079 s) : 0, 1079372
Total [baseline] (10.462 s) : 0, 10462405
Agent [candidate] (1.072 s) : 0, 1072444
Total [candidate] (10.45 s) : 0, 10449913
section appsec
Agent [baseline] (1.209 s) : 0, 1208630
Total [baseline] (10.641 s) : 0, 10641172
Agent [candidate] (1.211 s) : 0, 1210839
Total [candidate] (10.632 s) : 0, 10632495
section iast
Agent [baseline] (1.202 s) : 0, 1202274
Total [baseline] (10.929 s) : 0, 10928673
Agent [candidate] (1.202 s) : 0, 1202300
Total [candidate] (10.928 s) : 0, 10927805
section profiling
Agent [baseline] (1.271 s) : 0, 1271413
Total [baseline] (10.739 s) : 0, 10739429
Agent [candidate] (1.281 s) : 0, 1281159
Total [candidate] (10.749 s) : 0, 10749166
gantt
title petclinic - break down per module: candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.606 ms) : 0, 687606
BytebuddyAgent [candidate] (683.344 ms) : 0, 683344
GlobalTracer [baseline] (315.288 ms) : 0, 315288
GlobalTracer [candidate] (313.058 ms) : 0, 313058
AppSec [baseline] (54.386 ms) : 0, 54386
AppSec [candidate] (54.055 ms) : 0, 54055
Remote Config [baseline] (669.121 µs) : 0, 669
Remote Config [candidate] (677.495 µs) : 0, 677
Telemetry [baseline] (7.583 ms) : 0, 7583
Telemetry [candidate] (7.546 ms) : 0, 7546
section appsec
BytebuddyAgent [baseline] (701.052 ms) : 0, 701052
BytebuddyAgent [candidate] (702.587 ms) : 0, 702587
GlobalTracer [baseline] (310.263 ms) : 0, 310263
GlobalTracer [candidate] (311.119 ms) : 0, 311119
AppSec [baseline] (162.789 ms) : 0, 162789
AppSec [candidate] (163.281 ms) : 0, 163281
IAST [baseline] (21.005 ms) : 0, 21005
IAST [candidate] (20.252 ms) : 0, 20252
Remote Config [baseline] (643.169 µs) : 0, 643
Remote Config [candidate] (638.916 µs) : 0, 639
Telemetry [baseline] (9.584 ms) : 0, 9584
Telemetry [candidate] (9.261 ms) : 0, 9261
section iast
BytebuddyAgent [baseline] (799.422 ms) : 0, 799422
BytebuddyAgent [candidate] (800.105 ms) : 0, 800105
GlobalTracer [baseline] (302.736 ms) : 0, 302736
GlobalTracer [candidate] (302.297 ms) : 0, 302297
AppSec [baseline] (57.281 ms) : 0, 57281
AppSec [candidate] (56.115 ms) : 0, 56115
IAST [baseline] (21.353 ms) : 0, 21353
IAST [candidate] (22.208 ms) : 0, 22208
Remote Config [baseline] (608.585 µs) : 0, 609
Remote Config [candidate] (608.364 µs) : 0, 608
Telemetry [baseline] (7.082 ms) : 0, 7082
Telemetry [candidate] (7.135 ms) : 0, 7135
section profiling
BytebuddyAgent [baseline] (677.011 ms) : 0, 677011
BytebuddyAgent [candidate] (682.581 ms) : 0, 682581
GlobalTracer [baseline] (396.275 ms) : 0, 396275
GlobalTracer [candidate] (398.47 ms) : 0, 398470
AppSec [baseline] (54.893 ms) : 0, 54893
AppSec [candidate] (55.21 ms) : 0, 55210
Remote Config [baseline] (658.111 µs) : 0, 658
Remote Config [candidate] (664.512 µs) : 0, 665
Telemetry [baseline] (7.51 ms) : 0, 7510
Telemetry [candidate] (7.578 ms) : 0, 7578
ProfilingAgent [baseline] (96.151 ms) : 0, 96151
ProfilingAgent [candidate] (97.426 ms) : 0, 97426
Profiling [baseline] (96.175 ms) : 0, 96175
Profiling [candidate] (97.449 ms) : 0, 97449
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.074 s) : 0, 1074276
Total [baseline] (8.6 s) : 0, 8600034
Agent [candidate] (1.072 s) : 0, 1072473
Total [candidate] (8.549 s) : 0, 8549097
section iast
Agent [baseline] (1.212 s) : 0, 1211970
Total [baseline] (9.1 s) : 0, 9099851
Agent [candidate] (1.201 s) : 0, 1201499
Total [candidate] (9.106 s) : 0, 9105938
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.201 s) : 0, 1201452
Total [baseline] (9.066 s) : 0, 9065630
Agent [candidate] (1.209 s) : 0, 1209133
Total [candidate] (9.088 s) : 0, 9087607
section iast_TELEMETRY_OFF
Agent [baseline] (1.198 s) : 0, 1197509
Total [baseline] (9.108 s) : 0, 9107885
Agent [candidate] (1.198 s) : 0, 1197995
Total [candidate] (9.105 s) : 0, 9104627
gantt
title insecure-bank - break down per module: candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (684.271 ms) : 0, 684271
BytebuddyAgent [candidate] (683.823 ms) : 0, 683823
GlobalTracer [baseline] (313.795 ms) : 0, 313795
GlobalTracer [candidate] (312.771 ms) : 0, 312771
AppSec [baseline] (54.232 ms) : 0, 54232
AppSec [candidate] (53.878 ms) : 0, 53878
Remote Config [baseline] (657.701 µs) : 0, 658
Remote Config [candidate] (670.242 µs) : 0, 670
Telemetry [baseline] (7.488 ms) : 0, 7488
Telemetry [candidate] (7.528 ms) : 0, 7528
section iast
BytebuddyAgent [baseline] (806.018 ms) : 0, 806018
BytebuddyAgent [candidate] (798.921 ms) : 0, 798921
GlobalTracer [baseline] (304.626 ms) : 0, 304626
GlobalTracer [candidate] (302.036 ms) : 0, 302036
AppSec [baseline] (56.577 ms) : 0, 56577
AppSec [candidate] (57.62 ms) : 0, 57620
IAST [baseline] (23.075 ms) : 0, 23075
IAST [candidate] (21.308 ms) : 0, 21308
Remote Config [baseline] (616.938 µs) : 0, 617
Remote Config [candidate] (607.089 µs) : 0, 607
Telemetry [baseline] (7.149 ms) : 0, 7149
Telemetry [candidate] (7.144 ms) : 0, 7144
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (799.023 ms) : 0, 799023
BytebuddyAgent [candidate] (804.027 ms) : 0, 804027
GlobalTracer [baseline] (302.301 ms) : 0, 302301
GlobalTracer [candidate] (304.223 ms) : 0, 304223
AppSec [baseline] (57.273 ms) : 0, 57273
AppSec [candidate] (58.438 ms) : 0, 58438
IAST [baseline] (21.265 ms) : 0, 21265
IAST [candidate] (20.659 ms) : 0, 20659
Remote Config [baseline] (606.681 µs) : 0, 607
Remote Config [candidate] (622.58 µs) : 0, 623
Telemetry [baseline] (7.123 ms) : 0, 7123
Telemetry [candidate] (7.183 ms) : 0, 7183
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (795.731 ms) : 0, 795731
BytebuddyAgent [candidate] (796.062 ms) : 0, 796062
GlobalTracer [baseline] (301.873 ms) : 0, 301873
GlobalTracer [candidate] (302.54 ms) : 0, 302540
AppSec [baseline] (55.183 ms) : 0, 55183
AppSec [candidate] (56.279 ms) : 0, 56279
IAST [baseline] (23.327 ms) : 0, 23327
IAST [candidate] (20.809 ms) : 0, 20809
Remote Config [baseline] (612.183 µs) : 0, 612
Remote Config [candidate] (615.307 µs) : 0, 615
Telemetry [baseline] (6.952 ms) : 0, 6952
Telemetry [candidate] (7.817 ms) : 0, 7817
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 10 metrics, 17 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section baseline
no_agent (1.326 ms) : 1305, 1346
. : milestone, 1326,
appsec (1.719 ms) : 1696, 1742
. : milestone, 1719,
appsec_no_iast (1.734 ms) : 1708, 1761
. : milestone, 1734,
iast (1.484 ms) : 1461, 1507
. : milestone, 1484,
profiling (1.485 ms) : 1462, 1507
. : milestone, 1485,
tracing (1.473 ms) : 1449, 1498
. : milestone, 1473,
section candidate
no_agent (1.339 ms) : 1320, 1358
. : milestone, 1339,
appsec (1.717 ms) : 1694, 1740
. : milestone, 1717,
appsec_no_iast (1.711 ms) : 1687, 1736
. : milestone, 1711,
iast (1.479 ms) : 1456, 1503
. : milestone, 1479,
profiling (1.543 ms) : 1519, 1568
. : milestone, 1543,
tracing (1.482 ms) : 1457, 1506
. : milestone, 1482,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section baseline
no_agent (367.169 µs) : 347, 387
. : milestone, 367,
iast (487.482 µs) : 466, 509
. : milestone, 487,
iast_FULL (555.597 µs) : 534, 577
. : milestone, 556,
iast_GLOBAL (512.503 µs) : 490, 535
. : milestone, 513,
iast_HARDCODED_SECRET_DISABLED (486.009 µs) : 465, 507
. : milestone, 486,
iast_INACTIVE (445.679 µs) : 425, 466
. : milestone, 446,
iast_TELEMETRY_OFF (469.792 µs) : 449, 491
. : milestone, 470,
tracing (441.041 µs) : 420, 462
. : milestone, 441,
section candidate
no_agent (374.775 µs) : 355, 395
. : milestone, 375,
iast (483.552 µs) : 462, 505
. : milestone, 484,
iast_FULL (554.217 µs) : 533, 575
. : milestone, 554,
iast_GLOBAL (514.532 µs) : 492, 537
. : milestone, 515,
iast_HARDCODED_SECRET_DISABLED (486.348 µs) : 465, 508
. : milestone, 486,
iast_INACTIVE (449.74 µs) : 429, 471
. : milestone, 450,
iast_TELEMETRY_OFF (477.759 µs) : 456, 499
. : milestone, 478,
tracing (444.855 µs) : 424, 465
. : milestone, 445,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section baseline
no_agent (15.12 s) : 15120000, 15120000
. : milestone, 15120000,
appsec (15.346 s) : 15346000, 15346000
. : milestone, 15346000,
iast (18.693 s) : 18693000, 18693000
. : milestone, 18693000,
iast_GLOBAL (18.205 s) : 18205000, 18205000
. : milestone, 18205000,
profiling (15.415 s) : 15415000, 15415000
. : milestone, 15415000,
tracing (15.184 s) : 15184000, 15184000
. : milestone, 15184000,
section candidate
no_agent (15.083 s) : 15083000, 15083000
. : milestone, 15083000,
appsec (15.189 s) : 15189000, 15189000
. : milestone, 15189000,
iast (18.989 s) : 18989000, 18989000
. : milestone, 18989000,
iast_GLOBAL (17.956 s) : 17956000, 17956000
. : milestone, 17956000,
profiling (15.205 s) : 15205000, 15205000
. : milestone, 15205000,
tracing (15.607 s) : 15607000, 15607000
. : milestone, 15607000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.41.0-SNAPSHOT~8f53f3bc1e, baseline=1.41.0-SNAPSHOT~a49a0a1fbe
dateFormat X
axisFormat %s
section baseline
no_agent (1.466 ms) : 1454, 1477
. : milestone, 1466,
appsec (2.331 ms) : 2291, 2372
. : milestone, 2331,
iast (2.055 ms) : 2004, 2106
. : milestone, 2055,
iast_GLOBAL (2.117 ms) : 2065, 2170
. : milestone, 2117,
profiling (1.946 ms) : 1904, 1988
. : milestone, 1946,
tracing (1.917 ms) : 1877, 1957
. : milestone, 1917,
section candidate
no_agent (1.465 ms) : 1454, 1477
. : milestone, 1465,
appsec (2.312 ms) : 2272, 2353
. : milestone, 2312,
iast (2.061 ms) : 2009, 2112
. : milestone, 2061,
iast_GLOBAL (2.11 ms) : 2058, 2162
. : milestone, 2110,
profiling (1.941 ms) : 1899, 1983
. : milestone, 1941,
tracing (1.928 ms) : 1888, 1968
. : milestone, 1928,
|
What Does This Do
Since jdk16, calling setAccessible(true) on fields that are on another java module that is not open/exported will result with InaccessibleObjectException thrown each time. To avoid this exception we can call
trySetAccessible
that will return true if we can call setAccessible without exception.The method
trySetAccessible
is only available since jdk9 so we need to use MethodHandle on it to be able to call it only when it is available.NB: setAccessible for jdk8 will always work anyway. InaccessibleObjectException provides a useful message for the cause of this error and we have added back a similar message by getting the module where resides the field that is not accessible to explain to the user why the field is not captured what it can do to resolve the problem.
Fix also the report of evaluation errors for log template for inaccessible fields inside an object (marked UNDEFINED)
Motivation
Performance
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: DEBUG-2890