Skip to content

fix: prevent buffer stripe index overflow#2331

Open
zeitlinger wants to merge 1 commit into
mainfrom
agent/fix-buffer-stripe-index
Open

fix: prevent buffer stripe index overflow#2331
zeitlinger wants to merge 1 commit into
mainfrom
agent/fix-buffer-stripe-index

Conversation

@zeitlinger

Copy link
Copy Markdown
Member

Summary

  • compute Buffer stripe indexes with Math.floorMod(long, int)
  • add regression coverage for thread IDs whose low bits previously narrowed to Integer.MIN_VALUE

This is the focused replacement for the #2282 portion of #2297.

Fixes #2282

Ongoing discussion

None. The earlier review did not identify an unresolved design question for this isolated index fix.

Validation

  • mise run lint:fix
  • mise run build
  • ./mvnw test -pl prometheus-metrics-core -Dcoverage.skip=true -Dcheckstyle.skip=true

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping

1 participant