google / google/allocation-instrumenter

String created through java makeConcat not reported

Open
#44 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
492
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Based on findings from https://github.com/bazelbuild/bazel/issues/14890#issuecomment-1049057981 looks like some string concatenations are not reported.

makeConcat was introduced in java 9 - see https://openjdk.java.net/jeps/280 and implementation in java 11 in
http://hg.openjdk.java.net/jdk/jdk11/file/jdk-11+28/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java#l1483

Possibly `UNSAFE.allocateUninitializedArray` calls done from
http://hg.openjdk.java.net/jdk/jdk11/file/jdk-11+28/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java#l1633 could be instrumented - but not sure how it will play with JVM machinery.

Current workaround seems to be `-Djava.lang.invoke.stringConcat=MH_SB_SIZED` that forces to use concat implementation that instrumenter is able to catch.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.