allocation-instrumenter icon indicating copy to clipboard operation
allocation-instrumenter copied to clipboard

String created through java makeConcat not reported

Open glukasiknuro opened this issue 3 years ago • 0 comments

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.

glukasiknuro avatar Feb 23 '22 20:02 glukasiknuro