Skip to content

BUILD-15895: Always disable Base64 intrinsics for the Maven scanner - #397

Merged
tomverin merged 2 commits into
masterfrom
bugfix/tom/BUILD-15895-scanner-base64-intrinsics
Dec 4, 2026
Merged

tomverin merged 2 commits into
masterfrom
bugfix/tom/BUILD-15895-scanner-base64-intrinsics

Conversation

@tomverin

@tomverin tomverin commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Append -XX:-UseBASE64Intrinsics to SONAR_SCANNER_JAVA_OPTS after scanner-java-opts, so a caller-supplied -Xmx does not drop the workaround.
  • BUILD-15895

Test plan

  • A workflow that leaves scanner-java-opts at the default still runs the scanner with -Xmx512m -XX:-UseBASE64Intrinsics
  • A workflow that sets scanner-java-opts (for example -Xmx30g) still receives that value plus -XX:-UseBASE64Intrinsics

Callers that set scanner-java-opts replace the default, so the workaround has to be appended after the input.
@tomverin
tomverin requested a review from a team as a code owner December 4, 2026 14:53
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

BUILD-15895

@datadog-sonarsource

This comment has been minimized.

Comment thread build-maven/action.yml Resolved

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.

Does the JDK option works with all architectures?

@tomverin

tomverin commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Does the JDK option works with all architectures?

Yes. -XX:-UseBASE64Intrinsics is valid on both x86-64 and ARM for Java 11 and newer, which is what the Maven scanner runs. On ARM, and on older x86 CPUs without AVX-512 VBMI, the flag does nothing harmful: those machines are not affected, and HotSpot just keeps the ordinary Base64 decoder.

The single quotes were redundant, and the README input table needs the same note as the action.
@tomverin

tomverin commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Yes. -XX:-UseBASE64Intrinsics is valid on x86-64 and ARM for Java 11 and newer. On ARM, and on x86 without AVX-512 VBMI, it leaves the ordinary Base64 decoder in place. Java 8 does not know the flag and would fail to start; the Maven scanner JREs are Temurin 17 and 21.

-XX:UseAVX=2 is the flag that ARM rejects. This change does not set it.

@gitar-bot

gitar-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Appending -XX:-UseBASE64Intrinsics changes Maven scanner JVM behavior and could reduce Base64-processing performance during analysis.

Always appends -XX:-UseBASE64Intrinsics to SONAR_SCANNER_JAVA_OPTS after scanner-java-opts, so a caller-supplied -Xmx no longer drops the Base64 workaround. The README input row now documents that the flag is always appended, addressing the omission finding. No open issues found.

✅ 1 closed
✅ Quality: README scanner-java-opts entry omits the always-appended flag

📄 build-maven/action.yml:29-30
This PR changes build-maven/action.yml and the header comment in build.sh to say that -XX:-UseBASE64Intrinsics is always added to SONAR_SCANNER_JAVA_OPTS. The scanner-java-opts row in the README's build-maven inputs table was not updated. It still reads only "Additional Java options for the Sonar scanner (SONAR_SCANNER_JAVA_OPTS)" with default -Xmx512m.

The README is where users look up action inputs, so it now disagrees with the action's own description. Add the same note to that row.

Verification Rules 3/3 met Repos 12 inspected · PRs 1 inspected

Functional validation No results

Rules 3 passed 3 not applicable

✅ Internal artifact registries
✅ Release secrets usage
✅ Repository license compliance

Broader impact Repos 12 inspected PRs 1 inspected
Cross-repo 12 repositories inspected 0 open impacts

SonarSource/sonarqube-ide-visualstudio-roslyn Inspected
SonarSource/license-headers Inspected
SonarSource/nodejs-maven-plugin Inspected
SonarSource/sonar-html Inspected
SonarSource/rspec-maven-plugin Inspected

7 more repositories

Cross-PR 1 PR inspected 0 open impacts

PR 389: BUILD-14521 Add develocity-token-expiry input for the Develocity OIDC access token Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@tomverin
tomverin merged commit cc547dd into master Dec 4, 2026
21 checks passed
@tomverin
tomverin deleted the bugfix/tom/BUILD-15895-scanner-base64-intrinsics branch December 4, 2026 15:31
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.

2 participants