[lworld] Disable Valhalla specific VM flags when --enable-preview is not set

XMLWordPrintable

      There are currently a lot of failures in the CI with the assert below.

      The reason is that C2 is using UseArrayFlattening to decide if some array type is known to be not flat. When --enable-preview is not provided, we know that nothing is flat (i.e. all array types are known to be not flat). However, since UseArrayFlattening is still set to true by default, we execute some C2 code that checks the flag and then assumes some array is not known to be non-flat. This clashes with other code that does an --enable-preview check and we get inconsistent results, leading to the assertion failure below.

      The fix I propose is to just disable all Valhalla specific flags and emit a warning when the user sets these flags without --enable-preview.

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S11659/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c5b82d4a-84b4-4d87-b8a2-34a4bb6c285b/runs/fea0f070-3d71-4575-9d06-7cdc3404dd00/workspace/open/src/hotspot/share/opto/parse2.cpp:89), pid=473702, tid=473744
      # assert(UseArrayFlattening && is_reference_type(bt) && element_ptr->can_be_inline_type() && (!element_ptr->is_inlinetypeptr() || element_ptr->inline_klass()->maybe_flat_in_array())) failed: array can't be flat
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0+1) (fastdebug build 27-valhalla+1-9)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-valhalla+1-9, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
      # Problematic frame:
      # V [libjvm.so+0x1680288] Parse::array_load(BasicType)+0x144
      .............
      Command Line: -Dtest.vm.opts=-XX:MaxRAMPercentage=6.25 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/25/37/bundles/linux-aarch64/jdk-25_linux-aarch64_bin.tar.gz/jdk-25 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/tmp -XX:AOTCache=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/./testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/aot/jdk.aotcache -Dtest.tool.vm.opts=-J-XX:MaxRAMPercentage=6.25 -J-Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/25/37/bundles/linux-aarch64/jdk-25_linux-aarch64_bin.tar.gz/jdk-25 -J-Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/tmp -J-XX:AOTCache=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/./testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/aot/jdk.aotcache -Dtest.compiler.opts= -Dtest.java.opts=-XX:+AOTClassLinking -XX:+UseG1GC -Dtest.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/linux-aarch64-debug.jdk/jdk-27/fastdebug -Dcompile.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/linux-aarch64-debug.jdk/jdk-27/fastdebug -Dtest.timeout.factor=4.0 -Dtest.nativepath=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/linux-aarch64-debug.test/hotspot/jtreg/native -Dtest.root=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/src.full/open/test/hotspot/jtreg -Dtest.name=compiler/intrinsics/math/TestSignumIntrinsic.java -Dtest.verbose=Verbose[p=BRIEF,f=FULL,e=FULL,t=true,m=false] -Dtest.file=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/src.full/open/test/hotspot/jtreg/compiler/intrinsics/math/TestSignumIntrinsic.java -Dtest.main.class=compiler.intrinsics.math.TestSignumIntrinsic -Dtest.src=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/src.full/open/test/hotspot/jtreg/compiler/intrinsics/math -Dtest.src.path=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/src.full/open/test/hotspot/jtreg/compiler/intrinsics/math:/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/src.full/open/test/lib -Dtest.classes=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/classes/0/compiler/intrinsics/math/TestSignumIntrinsic.d -Dtest.class.path=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/classes/0/compiler/intrinsics/math/TestSignumIntrinsic.d:/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/classes/0/compiler/intrinsics/math/TestSignumIntrinsic.d/test/lib -Dtest.class.path.prefix=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/classes/0/compiler/intrinsics/math/TestSignumIntrinsic.d:/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/src.full/open/test/hotspot/jtreg/compiler/intrinsics/math:/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/classes/0/compiler/intrinsics/math/TestSignumIntrinsic.d/test/lib -XX:MaxRAMPercentage=6.25 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/25/37/bundles/linux-aarch64/jdk-25_linux-aarch64_bin.tar.gz/jdk-25 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/tmp -XX:AOTCache=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/./testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/aot/jdk.aotcache -XX:+AOTClassLinking -XX:+UseG1GC -Djava.library.path=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27-valhalla+1-9/linux-aarch64-debug.test/hotspot/jtreg/native -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -Xcomp -XX:+UseSignumIntrinsic com.sun.javatest.regtest.agent.MainWrapper /opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35171/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/46debad0-a0da-4e26-8115-12cd1f1e9f0f/runs/0208c822-f640-4f73-834e-ac9b4f70d46e/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler/compiler/intrinsics/math/TestSignumIntrinsic.d/main.2.jta
      ..................
      Current CompileTask:
      C2:13281 2885 !b 4 java.lang.invoke.BootstrapMethodInvoker::invoke (978 bytes)

      Stack: [0x0000ffff7d7d8000,0x0000ffff7d9d6000], sp=0x0000ffff7d9d1630, free space=2021k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1680288] Parse::array_load(BasicType)+0x144 (parse2.cpp:89)
      V [libjvm.so+0x1690b24] Parse::do_one_bytecode()+0x2e04 (parse2.cpp:2958)
      V [libjvm.so+0x1676f7c] Parse::do_one_block()+0x318 (parse1.cpp:1714)
      V [libjvm.so+0x167836c] Parse::do_all_blocks()+0x13c (parse1.cpp:771)
      V [libjvm.so+0x167ba18] Parse::Parse(JVMState*, ciMethod*, float)+0xb14 (parse1.cpp:675)
      V [libjvm.so+0x84966c] ParseGenerator::generate(JVMState*)+0xec (callGenerator.cpp:99)
      V [libjvm.so+0xbe3fd4] Parse::do_call()+0xd08 (doCall.cpp:777)
      V [libjvm.so+0x168e138] Parse::do_one_bytecode()+0x418 (parse2.cpp:3521)
      V [libjvm.so+0x1676f7c] Parse::do_one_block()+0x318 (parse1.cpp:1714)
      V [libjvm.so+0x167836c] Parse::do_all_blocks()+0x13c (parse1.cpp:771)
      V [libjvm.so+0x167ba18] Parse::Parse(JVMState*, ciMethod*, float)+0xb14 (parse1.cpp:675)
      V [libjvm.so+0x84966c] ParseGenerator::generate(JVMState*)+0xec (callGenerator.cpp:99)
      V [libjvm.so+0xa3dca8] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x10d8 (compile.cpp:827)
      V [libjvm.so+0x84621c] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x2d8 (c2compiler.cpp:149)
      V [libjvm.so+0xa4cfec] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb08 (compileBroker.cpp:2345)
      V [libjvm.so+0xa4df18] CompileBroker::compiler_thread_loop()+0x638 (compileBroker.cpp:1989)
      V [libjvm.so+0xfb5ec8] JavaThread::thread_main_inner()+0x108 (javaThread.cpp:777)
      V [libjvm.so+0x199336c] Thread::call_run()+0xac (thread.cpp:242)
      V [libjvm.so+0x162703c] thread_native_entry(Thread*)+0x11c (os_linux.cpp:860)
      C [libc.so.6+0x80b50] start_thread+0x300


            Assignee:
            Christian Hagedorn
            Reporter:
            Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: