Crash: assert(UTF8::is_legal_utf8((const unsigned char*)msg, strlen(msg), true)) failed: must be

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 27
    • Component/s: hotspot

      Test: runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java

      Seen twice so far on Linux-x64

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35291/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/b5949ed7-c005-490f-93e6-9551c1030b60/runs/83cfb015-12fc-4d94-b954-89eee650ae13/workspace/open/src/hotspot/share/utilities/exceptions.cpp:325), pid=3142803, tid=3142935
      # assert(UTF8::is_legal_utf8((const unsigned char*)msg, strlen(msg), true)) failed: must be
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0+2) (fastdebug build 27-ea+2-62)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-ea+2-62, mixed mode, tiered, compressed class ptrs, z gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xde2634] Exceptions::fthrow(JavaThread*, char const*, int, Symbol*, char const*, ...)+0x1b4
      #
      # Core dump will be written. Default location: Determined by the following: "/opt/core.sh %p" (alternatively, falling back to /opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35643/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d6aeaf13-a4ec-44cb-b36f-380f7c2af438/runs/f3f70db5-ffe7-44c1-b328-b004577246cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_runtime_no_cds/scratch/3/core.3142803)
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      --------------- S U M M A R Y ------------

      Command Line: -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/25/37/bundles/linux-x64/jdk-25_linux-x64_bin.tar.gz/jdk-25 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35643/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d6aeaf13-a4ec-44cb-b36f-380f7c2af438/runs/f3f70db5-ffe7-44c1-b328-b004577246cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_runtime_no_cds/tmp -XX:AOTCache=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35643/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d6aeaf13-a4ec-44cb-b36f-380f7c2af438/runs/f3f70db5-ffe7-44c1-b328-b004577246cb/./testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_runtime_no_cds/aot/jdk.aotcache -XX:+AOTClassLinking -XX:+UseZGC -Djava.library.path=/opt/mach5/mesos/work_dir/jib-master/install/jdk-27+2-62/linux-x64-debug.test/hotspot/jtreg/native --patch-module=java.base=/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35643/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d6aeaf13-a4ec-44cb-b36f-380f7c2af438/runs/f3f70db5-ffe7-44c1-b328-b004577246cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_runtime_no_cds/patches/java.base -Djava.security.policy=file:/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35643/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d6aeaf13-a4ec-44cb-b36f-380f7c2af438/runs/f3f70db5-ffe7-44c1-b328-b004577246cb/./testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_runtime_no_cds/jtreg.policy com.sun.javatest.regtest.agent.AgentServer -id 32 -logfile /opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S35643/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d6aeaf13-a4ec-44cb-b36f-380f7c2af438/runs/f3f70db5-ffe7-44c1-b328-b004577246cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_runtime_no_cds/jtData/agentServer.32.trace -allowSetSecurityManager -port 34641 -timeoutFactor 4.0

      Host: AMD EPYC 9J14 96-Core Processor, 12 cores, 23G, Oracle Linux Server release 8.10
      Time: Wed Dec 10 06:30:23 2025 UTC elapsed time: 0.575165 seconds (0d 0h 0m 0s)

      --------------- T H R E A D ---------------

      Current thread (0x00007f8d400199b0): JavaThread "Thread-2" [_thread_in_vm, id=3142935, stack(0x00007f8d47dff000,0x00007f8d47eff000) (1024K)]

      Stack: [0x00007f8d47dff000,0x00007f8d47eff000], sp=0x00007f8d47efce70, free space=1015k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xde2634] Exceptions::fthrow(JavaThread*, char const*, int, Symbol*, char const*, ...)+0x1b4 (exceptions.cpp:325)
      V [libjvm.so+0x153e3b4] LinkResolver::check_field_accessability(Klass*, Klass*, Klass*, fieldDescriptor const&, JavaThread*)+0x2f4 (linkResolver.cpp:975)
      V [libjvm.so+0x153e653] LinkResolver::resolve_field(fieldDescriptor&, LinkInfo const&, Bytecodes::Code, ClassInitMode, JavaThread*)+0x1b3 (linkResolver.cpp:1027)
      V [libjvm.so+0x153f3cf] LinkResolver::resolve_field_access(fieldDescriptor&, constantPoolHandle const&, int, methodHandle const&, Bytecodes::Code, ClassInitMode, JavaThread*)+0x21f (linkResolver.cpp:991)
      V [libjvm.so+0x10be90e] InterpreterRuntime::resolve_get_put(Bytecodes::Code, int, methodHandle&, constantPoolHandle&, ClassInitMode, JavaThread*)+0xae (interpreterRuntime.cpp:669)
      V [libjvm.so+0x10c8622] InterpreterRuntime::resolve_get_put(Bytecodes::Code, JavaThread*)+0x172 (interpreterRuntime.cpp:655)
      V [libjvm.so+0x10c9504] InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0x174 (interpreterRuntime.cpp:1002)
      j HostNoNestMember.test()I+10
      j TestNestHostErrorWithMultiThread$TestThread.run()V+23
      v ~StubRoutines::Stub Generator call_stub_stub 0x00007f8dd78755fa
      V [libjvm.so+0x10e5c0e] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x50e (javaCalls.cpp:416)
      V [libjvm.so+0x10e6353] JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x313 (javaCalls.cpp:324)
      V [libjvm.so+0x10e6993] JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*)+0xb3 (javaCalls.cpp:186)
      V [libjvm.so+0x12a2153] thread_entry(JavaThread*, JavaThread*)+0xe3 (jvm.cpp:2704)
      V [libjvm.so+0x1124d7b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:776)
      V [libjvm.so+0x1ba9036] Thread::call_run()+0xb6 (thread.cpp:242)
      V [libjvm.so+0x17fe7d8] thread_native_entry(Thread*)+0x118 (os_linux.cpp:860)
      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j HostNoNestMember.test()I+10
      j TestNestHostErrorWithMultiThread$TestThread.run()V+23
      v ~StubRoutines::Stub Generator call_stub_stub 0x00007f8dd78755fa

      This section of hs_err file is particularly interesting:

      Top of Stack: (sp=0x00007f8d47efce70)
      0x00007f8d47efce70: fefefefefefefefe fefefefefefefefe ................
      0x00007f8d47efce80: fefefefefefefefe 0000003000000030 ........0...0...
      0x00007f8d47efce90: 00007f8d47efd3a0 00007f8d47efd2b0 ...G.......G....
      0x00007f8d47efcea0: 6f48207373616c63 7473654e6f4e7473 class HostNoNest
      0x00007f8d47efceb0: 74207265626d654d 206f742064656972 Member tried to
      0x00007f8d47efcec0: 7020737365636361 6620657461766972 access private f
      0x00007f8d47efced0: 736f4820646c6569 4d7473654e6f4e74 ield HostNoNestM
      0x00007f8d47efcee0: 654d247265626d65 6c61762e7265626d ember$Member.val
      0x00007f8d47efcef0: 74736f4828206575 654d7473654e6f4e ue (HostNoNestMe
      0x00007f8d47efcf00: 646e61207265626d 4e6f4e74736f4820 mber and HostNoN
      0x00007f8d47efcf10: 65626d654d747365 7265626d654d2472 estMember$Member
      0x00007f8d47efcf20: 206e692065726120 2064656d616e6e75 are in unnamed
      0x00007f8d47efcf30: 6f20656c75646f6d 726564616f6c2066 module of loader
      0x00007f8d47efcf40: 656e2e6176616a20 616c434c52552e74 java.net.URLCla
      0x00007f8d47efcf50: 726564616f4c7373 3739623836374020 ssLoader @768b97
      0x00007f8d47efcf60: baba28202c296330 babababababababa 0c), (..........
      0x00007f8d47efcf70: babababababababa babababababababa ................
      0x00007f8d47efcf80: babababababababa babababababababa ................
      0x00007f8d47efcf90: babababababababa babababababababa ................
      0x00007f8d47efcfa0: babababababababa babababababababa ................
      0x00007f8d47efcfb0: babababababababa babababababababa ................
      0x00007f8d47efcfc0: babababababababa babababababababa ................
      0x00007f8d47efcfd0: babababababababa babababababababa ................
      0x00007f8d47efcfe0: babababababababa babababababababa ................
      0x00007f8d47efcff0: babababababababa babababababababa ................
      0x00007f8d47efd000: babababababababa babababababababa ................
      0x00007f8d47efd010: babababababababa babababababababa ................
      0x00007f8d47efd020: babababababababa babababababababa ................
      0x00007f8d47efd030: fe0029bababababa fefefefefefefefe .....)..........
      0x00007f8d47efd040: fefefefefefefefe fefefefefefefefe ................
      0x00007f8d47efd050: fefefefefefefefe fefefefefefefefe ................
      0x00007f8d47efd060: fefefefefefefefe fefefefefefefefe ................

      The stack contains a partial copy of the exception message that is supposed to be used, but the rest of ababab. Not clear if the message should actually be on the stack given the way the code works.

            Assignee:
            David Holmes
            Reporter:
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: