Skip to content

Fix ByteCountingInputStream when reading past EOF #8988

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manuel-alvarez-alvarez
Copy link
Member

What Does This Do

Fixes ByteCountingInputStream when reading single bytes past EOF.

Motivation

Additional Notes

This PR was generated with CODEX with the following prompt:

Go through the codebase, find issues and propose one task to fix a typo, one task to fix a bug, one task to fix a code comment or documentation discrepancy, and one task to improve a test.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@manuel-alvarez-alvarez manuel-alvarez-alvarez requested a review from a team as a code owner June 16, 2025 08:27
@manuel-alvarez-alvarez manuel-alvarez-alvarez added type: bug comp: profiling Profiling tag: ai generated Based on context generated by AI labels Jun 16, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jun 16, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master malvarez/fix-byte-counting-is-eof
git_commit_date 1750059786 1750062302
git_commit_sha 88aa5b2 fef357e
release_version 1.50.0-SNAPSHOT~88aa5b2174 1.50.0-SNAPSHOT~fef357e06e
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1750064542 1750064542
ci_job_id 982900851 982900851
ci_pipeline_id 67811053 67811053
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zvqazpau-project-304-concurrent-0-e5v2skgt 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zvqazpau-project-304-concurrent-0-e5v2skgt 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 11 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~fef357e06e, baseline=1.50.0-SNAPSHOT~88aa5b2174

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.032 s) : 0, 1032175
Total [baseline] (8.543 s) : 0, 8543264
Agent [candidate] (1.024 s) : 0, 1024498
Total [candidate] (8.557 s) : 0, 8556826
section iast
Agent [baseline] (1.157 s) : 0, 1156597
Total [baseline] (9.209 s) : 0, 9209189
Agent [candidate] (1.156 s) : 0, 1156041
Total [candidate] (9.247 s) : 0, 9246575
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.152 s) : 0, 1152453
Total [baseline] (9.245 s) : 0, 9245482
Agent [candidate] (1.162 s) : 0, 1161530
Total [candidate] (9.216 s) : 0, 9215750
section iast_TELEMETRY_OFF
Agent [baseline] (1.148 s) : 0, 1147713
Total [baseline] (9.26 s) : 0, 9260016
Agent [candidate] (1.15 s) : 0, 1150203
Total [candidate] (9.254 s) : 0, 9254430
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.032 s -
Agent iast 1.157 s 124.423 ms (12.1%)
Agent iast_HARDCODED_SECRET_DISABLED 1.152 s 120.278 ms (11.7%)
Agent iast_TELEMETRY_OFF 1.148 s 115.539 ms (11.2%)
Total tracing 8.543 s -
Total iast 9.209 s 665.924 ms (7.8%)
Total iast_HARDCODED_SECRET_DISABLED 9.245 s 702.218 ms (8.2%)
Total iast_TELEMETRY_OFF 9.26 s 716.752 ms (8.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.024 s -
Agent iast 1.156 s 131.543 ms (12.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.162 s 137.033 ms (13.4%)
Agent iast_TELEMETRY_OFF 1.15 s 125.705 ms (12.3%)
Total tracing 8.557 s -
Total iast 9.247 s 689.748 ms (8.1%)
Total iast_HARDCODED_SECRET_DISABLED 9.216 s 658.924 ms (7.7%)
Total iast_TELEMETRY_OFF 9.254 s 697.604 ms (8.2%)
gantt
    title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~fef357e06e, baseline=1.50.0-SNAPSHOT~88aa5b2174

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.377 ms) : 0, 687377
BytebuddyAgent [candidate] (683.365 ms) : 0, 683365
GlobalTracer [baseline] (241.293 ms) : 0, 241293
GlobalTracer [candidate] (240.52 ms) : 0, 240520
AppSec [baseline] (60.744 ms) : 0, 60744
AppSec [candidate] (59.762 ms) : 0, 59762
Debugger [baseline] (6.205 ms) : 0, 6205
Debugger [candidate] (6.121 ms) : 0, 6121
Remote Config [baseline] (737.165 µs) : 0, 737
Remote Config [candidate] (746.8 µs) : 0, 747
Telemetry [baseline] (12.07 ms) : 0, 12070
Telemetry [candidate] (10.522 ms) : 0, 10522
section iast
BytebuddyAgent [baseline] (804.638 ms) : 0, 804638
BytebuddyAgent [candidate] (804.262 ms) : 0, 804262
GlobalTracer [baseline] (231.32 ms) : 0, 231320
GlobalTracer [candidate] (231.344 ms) : 0, 231344
IAST [baseline] (26.835 ms) : 0, 26835
IAST [candidate] (27.926 ms) : 0, 27926
AppSec [baseline] (55.755 ms) : 0, 55755
AppSec [candidate] (54.375 ms) : 0, 54375
Debugger [baseline] (5.972 ms) : 0, 5972
Debugger [candidate] (6.05 ms) : 0, 6050
Remote Config [baseline] (593.209 µs) : 0, 593
Remote Config [candidate] (599.498 µs) : 0, 599
Telemetry [baseline] (7.902 ms) : 0, 7902
Telemetry [candidate] (7.922 ms) : 0, 7922
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (801.654 ms) : 0, 801654
BytebuddyAgent [candidate] (808.015 ms) : 0, 808015
GlobalTracer [baseline] (230.697 ms) : 0, 230697
GlobalTracer [candidate] (232.186 ms) : 0, 232186
IAST [baseline] (25.956 ms) : 0, 25956
IAST [candidate] (27.369 ms) : 0, 27369
AppSec [baseline] (56.183 ms) : 0, 56183
AppSec [candidate] (55.753 ms) : 0, 55753
Debugger [baseline] (5.939 ms) : 0, 5939
Debugger [candidate] (6.047 ms) : 0, 6047
Remote Config [baseline] (591.164 µs) : 0, 591
Remote Config [candidate] (595.038 µs) : 0, 595
Telemetry [baseline] (7.889 ms) : 0, 7889
Telemetry [candidate] (7.892 ms) : 0, 7892
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (797.554 ms) : 0, 797554
BytebuddyAgent [candidate] (799.42 ms) : 0, 799420
GlobalTracer [baseline] (231.744 ms) : 0, 231744
GlobalTracer [candidate] (231.225 ms) : 0, 231225
IAST [baseline] (26.271 ms) : 0, 26271
IAST [candidate] (28.77 ms) : 0, 28770
AppSec [baseline] (52.857 ms) : 0, 52857
AppSec [candidate] (52.807 ms) : 0, 52807
Debugger [baseline] (5.997 ms) : 0, 5997
Debugger [candidate] (6.03 ms) : 0, 6030
Remote Config [baseline] (587.874 µs) : 0, 588
Remote Config [candidate] (605.49 µs) : 0, 605
Telemetry [baseline] (7.816 ms) : 0, 7816
Telemetry [candidate] (7.848 ms) : 0, 7848
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~fef357e06e, baseline=1.50.0-SNAPSHOT~88aa5b2174

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.026 s) : 0, 1026262
Total [baseline] (10.511 s) : 0, 10510842
Agent [candidate] (1.031 s) : 0, 1031383
Total [candidate] (10.617 s) : 0, 10616600
section appsec
Agent [baseline] (1.179 s) : 0, 1178866
Total [baseline] (10.715 s) : 0, 10715101
Agent [candidate] (1.181 s) : 0, 1180643
Total [candidate] (10.742 s) : 0, 10741628
section iast
Agent [baseline] (1.151 s) : 0, 1151220
Total [baseline] (10.865 s) : 0, 10864970
Agent [candidate] (1.156 s) : 0, 1155887
Total [candidate] (10.865 s) : 0, 10864873
section profiling
Agent [baseline] (1.276 s) : 0, 1275914
Total [baseline] (10.929 s) : 0, 10928630
Agent [candidate] (1.282 s) : 0, 1281599
Total [candidate] (10.945 s) : 0, 10944919
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.026 s -
Agent appsec 1.179 s 152.604 ms (14.9%)
Agent iast 1.151 s 124.958 ms (12.2%)
Agent profiling 1.276 s 249.651 ms (24.3%)
Total tracing 10.511 s -
Total appsec 10.715 s 204.259 ms (1.9%)
Total iast 10.865 s 354.127 ms (3.4%)
Total profiling 10.929 s 417.787 ms (4.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.031 s -
Agent appsec 1.181 s 149.26 ms (14.5%)
Agent iast 1.156 s 124.504 ms (12.1%)
Agent profiling 1.282 s 250.216 ms (24.3%)
Total tracing 10.617 s -
Total appsec 10.742 s 125.028 ms (1.2%)
Total iast 10.865 s 248.273 ms (2.3%)
Total profiling 10.945 s 328.319 ms (3.1%)
gantt
    title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~fef357e06e, baseline=1.50.0-SNAPSHOT~88aa5b2174

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (682.731 ms) : 0, 682731
BytebuddyAgent [candidate] (686.668 ms) : 0, 686668
GlobalTracer [baseline] (240.477 ms) : 0, 240477
GlobalTracer [candidate] (241.841 ms) : 0, 241841
AppSec [baseline] (59.903 ms) : 0, 59903
AppSec [candidate] (59.545 ms) : 0, 59545
Debugger [baseline] (6.126 ms) : 0, 6126
Debugger [candidate] (6.195 ms) : 0, 6195
Remote Config [baseline] (733.673 µs) : 0, 734
Remote Config [candidate] (742.966 µs) : 0, 743
Telemetry [baseline] (12.67 ms) : 0, 12670
Telemetry [candidate] (12.688 ms) : 0, 12688
section appsec
BytebuddyAgent [baseline] (705.401 ms) : 0, 705401
BytebuddyAgent [candidate] (707.732 ms) : 0, 707732
GlobalTracer [baseline] (234.773 ms) : 0, 234773
GlobalTracer [candidate] (234.978 ms) : 0, 234978
IAST [baseline] (21.875 ms) : 0, 21875
IAST [candidate] (21.959 ms) : 0, 21959
AppSec [baseline] (179.402 ms) : 0, 179402
AppSec [candidate] (178.622 ms) : 0, 178622
Debugger [baseline] (5.878 ms) : 0, 5878
Debugger [candidate] (5.819 ms) : 0, 5819
Remote Config [baseline] (620.964 µs) : 0, 621
Remote Config [candidate] (614.952 µs) : 0, 615
Telemetry [baseline] (7.335 ms) : 0, 7335
Telemetry [candidate] (7.28 ms) : 0, 7280
section iast
BytebuddyAgent [baseline] (800.431 ms) : 0, 800431
BytebuddyAgent [candidate] (804.163 ms) : 0, 804163
GlobalTracer [baseline] (230.394 ms) : 0, 230394
GlobalTracer [candidate] (231.434 ms) : 0, 231434
IAST [baseline] (26.856 ms) : 0, 26856
IAST [candidate] (27.668 ms) : 0, 27668
AppSec [baseline] (54.885 ms) : 0, 54885
AppSec [candidate] (54.502 ms) : 0, 54502
Debugger [baseline] (5.966 ms) : 0, 5966
Debugger [candidate] (5.965 ms) : 0, 5965
Remote Config [baseline] (590.768 µs) : 0, 591
Remote Config [candidate] (593.566 µs) : 0, 594
Telemetry [baseline] (7.886 ms) : 0, 7886
Telemetry [candidate] (7.935 ms) : 0, 7935
section profiling
BytebuddyAgent [baseline] (676.66 ms) : 0, 676660
BytebuddyAgent [candidate] (681.528 ms) : 0, 681528
GlobalTracer [baseline] (361.286 ms) : 0, 361286
GlobalTracer [candidate] (362.693 ms) : 0, 362693
AppSec [baseline] (64.22 ms) : 0, 64220
AppSec [candidate] (64.751 ms) : 0, 64751
Debugger [baseline] (6.133 ms) : 0, 6133
Debugger [candidate] (6.194 ms) : 0, 6194
Remote Config [baseline] (645.413 µs) : 0, 645
Remote Config [candidate] (663.597 µs) : 0, 664
Telemetry [baseline] (8.165 ms) : 0, 8165
Telemetry [candidate] (8.158 ms) : 0, 8158
ProfilingAgent [baseline] (107.93 ms) : 0, 107930
ProfilingAgent [candidate] (106.401 ms) : 0, 106401
Profiling [baseline] (107.958 ms) : 0, 107958
Profiling [candidate] (106.429 ms) : 0, 106429
Loading

Load

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master malvarez/fix-byte-counting-is-eof
git_commit_date 1750059786 1750062302
git_commit_sha 88aa5b2 fef357e
release_version 1.50.0-SNAPSHOT~88aa5b2174 1.50.0-SNAPSHOT~fef357e06e
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1750064504 1750064504
ci_job_id 982900853 982900853
ci_pipeline_id 67811053 67811053
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-wygnhpf-project-304-concurrent-3-rk501dy3 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-wygnhpf-project-304-concurrent-3-rk501dy3 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

Summary

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

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~fef357e06e, baseline=1.50.0-SNAPSHOT~88aa5b2174
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.478 ms) : 1467, 1490
.   : milestone, 1478,
appsec (2.403 ms) : 2355, 2451
.   : milestone, 2403,
iast (2.187 ms) : 2125, 2248
.   : milestone, 2187,
iast_GLOBAL (2.232 ms) : 2170, 2293
.   : milestone, 2232,
profiling (2.039 ms) : 1989, 2089
.   : milestone, 2039,
tracing (2.007 ms) : 1960, 2054
.   : milestone, 2007,
section candidate
no_agent (1.484 ms) : 1472, 1496
.   : milestone, 1484,
appsec (2.403 ms) : 2355, 2452
.   : milestone, 2403,
iast (2.179 ms) : 2118, 2240
.   : milestone, 2179,
iast_GLOBAL (2.234 ms) : 2173, 2296
.   : milestone, 2234,
profiling (2.046 ms) : 1997, 2096
.   : milestone, 2046,
tracing (2.005 ms) : 1958, 2052
.   : milestone, 2005,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.478 ms [1.467 ms, 1.49 ms] -
appsec 2.403 ms [2.355 ms, 2.451 ms] 924.993 µs (62.6%)
iast 2.187 ms [2.125 ms, 2.248 ms] 708.63 µs (47.9%)
iast_GLOBAL 2.232 ms [2.17 ms, 2.293 ms] 753.52 µs (51.0%)
profiling 2.039 ms [1.989 ms, 2.089 ms] 560.955 µs (38.0%)
tracing 2.007 ms [1.96 ms, 2.054 ms] 529.052 µs (35.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.484 ms [1.472 ms, 1.496 ms] -
appsec 2.403 ms [2.355 ms, 2.452 ms] 919.358 µs (61.9%)
iast 2.179 ms [2.118 ms, 2.24 ms] 695.088 µs (46.8%)
iast_GLOBAL 2.234 ms [2.173 ms, 2.296 ms] 750.048 µs (50.5%)
profiling 2.046 ms [1.997 ms, 2.096 ms] 562.395 µs (37.9%)
tracing 2.005 ms [1.958 ms, 2.052 ms] 521.18 µs (35.1%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~fef357e06e, baseline=1.50.0-SNAPSHOT~88aa5b2174
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.004 s) : 15004000, 15004000
.   : milestone, 15004000,
appsec (14.689 s) : 14689000, 14689000
.   : milestone, 14689000,
iast (18.397 s) : 18397000, 18397000
.   : milestone, 18397000,
iast_GLOBAL (17.797 s) : 17797000, 17797000
.   : milestone, 17797000,
profiling (15.109 s) : 15109000, 15109000
.   : milestone, 15109000,
tracing (14.969 s) : 14969000, 14969000
.   : milestone, 14969000,
section candidate
no_agent (15.594 s) : 15594000, 15594000
.   : milestone, 15594000,
appsec (14.748 s) : 14748000, 14748000
.   : milestone, 14748000,
iast (19.184 s) : 19184000, 19184000
.   : milestone, 19184000,
iast_GLOBAL (18.205 s) : 18205000, 18205000
.   : milestone, 18205000,
profiling (15.141 s) : 15141000, 15141000
.   : milestone, 15141000,
tracing (15.073 s) : 15073000, 15073000
.   : milestone, 15073000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.004 s [15.004 s, 15.004 s] -
appsec 14.689 s [14.689 s, 14.689 s] -315.0 ms (-2.1%)
iast 18.397 s [18.397 s, 18.397 s] 3.393 s (22.6%)
iast_GLOBAL 17.797 s [17.797 s, 17.797 s] 2.793 s (18.6%)
profiling 15.109 s [15.109 s, 15.109 s] 105.0 ms (0.7%)
tracing 14.969 s [14.969 s, 14.969 s] -35.0 ms (-0.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.594 s [15.594 s, 15.594 s] -
appsec 14.748 s [14.748 s, 14.748 s] -846.0 ms (-5.4%)
iast 19.184 s [19.184 s, 19.184 s] 3.59 s (23.0%)
iast_GLOBAL 18.205 s [18.205 s, 18.205 s] 2.611 s (16.7%)
profiling 15.141 s [15.141 s, 15.141 s] -453.0 ms (-2.9%)
tracing 15.073 s [15.073 s, 15.073 s] -521.0 ms (-3.3%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: profiling Profiling tag: ai generated Based on context generated by AI type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant