Accordingly to jtreg's annotations in the test it should be run with ParallelGC only. Any attempts to run with other GC causes the following failure:
Conflicting collector combinations in option list; please refer to the release notes for the combinations allowed
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
The suggested fix is:
@@ -30,6 +30,7 @@
* @summary Verifies that no partially initialized String object escapes from
* C2's String concat optimization in a highly concurrent setting.
* This test triggers the bug in about 1 out of 10 runs.
+ * @requires vm.gc == "null" | vm.gc == "Parallel"
* @compile -XDstringConcat=inline TestStringObjectInitialization.java
* @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-CompactStrings
* -XX:-UseG1GC -XX:+UseParallelGC TestStringObjectInitialization
It should prevent the test from being run under inappropriate GC.