Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8329651

TestLibGraal.java crashes with assert(_stack_base != nullptr)

    XMLWordPrintable

Details

    • b18

    Description

      We have this crash on Windows in libgraal testing:

      The native stack trace for the crashing/hanging JVMCI compiler thread in process 97224 is:

        17 Id: 17bc8.8df4 Suspend: 1 Teb: 0000004c`2fdae000 Unfrozen
       # Child-SP RetAddr Call Site
      00 0000004c`30ffb208 00007ffa`fe49d3a1 ntdll!ZwWaitForSingleObject+0x14
      01 0000004c`30ffb210 00007ffa`fe4a8a92 ntdll!RtlInitializeSid+0x111
      02 0000004c`30ffb250 00007ffa`fe4a513d ntdll!RtlUnicodeToMultiByteN+0x3c2
      03 0000004c`30ffb2d0 00007ffa`fe4a1c5c ntdll!RtlFormatCurrentUserKeyPath+0x1fd
      04 0000004c`30ffb470 00007ffa`faaef21f ntdll!LdrLoadDll+0x8c
      05 0000004c`30ffb570 00007ffa`faae7e41 KERNELBASE!LoadLibraryExW+0x16f
      06 0000004c`30ffb5e0 00007ffa`eef95eb3 KERNELBASE!LoadLibraryExA+0x31
      07 0000004c`30ffb620 00007ffa`eef8c232 dbgcore!MiniDumpReadDumpStream+0xf673
      08 0000004c`30ffb660 00007ffa`eef84fa5 dbgcore!MiniDumpReadDumpStream+0x59f2
      09 0000004c`30ffb6f0 00007ffa`eef85f32 dbgcore+0x4fa5
      0a 0000004c`30ffb7a0 00007ffa`eef867d3 dbgcore+0x5f32
      0b 0000004c`30ffbfe0 00007ffa`e50b352b dbgcore!MiniDumpWriteDump+0x253
      0c 0000004c`30ffc0e0 00007ffa`e4dae342 jvm!WindowsDbgHelp::miniDumpWriteDump(
                  void * hProcess = 0xffffffff`ffffffff,
                  unsigned long ProcessId = 0x17bc8,
                  void * hFile = 0x00000000`000004c0,
                  _MINIDUMP_TYPE DumpType = 0n6182 (No matching enumerant),
                  struct _MINIDUMP_EXCEPTION_INFORMATION * ExceptionParam = 0x00000000`00000000,
                  struct _MINIDUMP_USER_STREAM_INFORMATION * UserStreamParam = 0x00000000`00000000,
                  struct _MINIDUMP_CALLBACK_INFORMATION * CallbackParam = 0x00000000`00000000)+0x6b
      0d 0000004c`30ffc140 00007ffa`e5067f11 jvm!os::abort(
                  bool dump_core = true,
                  void * siginfo = 0x00000000`00000000,
                  void * context = 0x00000000`00000000)+0xd2
      0e 0000004c`30ffc1c0 00007ffa`e5068024 jvm!VMError::report_and_die(
                  int id = 0n-536870912,
                  char * message = 0x00007ffa`e5181400 "assert(_stack_base != nullptr) failed",
                  char * detail_fmt = 0x00007ffa`e51813f0 "Sanity check",
                  char * detail_args = 0x0000004c`30ffc4a0 "p???",
                  class Thread * thread = 0x000001ff`c10e6170,
                  unsigned char * pc = 0x00000000`00000000 "",
                  void * siginfo = 0x00000000`00000000,
                  void * context = 0x00000000`00000000,
                  char * filename = 0x00007ffa`e5181430 "c:\sb\prod\1710542487\workspace\open\src\hotspot\share\runtime/thread.hpp",
                  int lineno = 0n546,
                  unsigned int64 size = 0)+0xe21
      0f 0000004c`30ffc3b0 00007ffa`e467391b jvm!VMError::report_and_die(
                  class Thread * thread = 0x000001ff`c10e6170,
                  void * context = 0x00000000`00000000,
                  char * filename = 0x00007ffa`e5181430 "c:\sb\prod\1710542487\workspace\open\src\hotspot\share\runtime/thread.hpp",
                  int lineno = 0n546,
                  char * message = 0x00007ffa`e5181400 "assert(_stack_base != nullptr) failed",
                  char * detail_fmt = 0x00007ffa`e51813f0 "Sanity check",
                  char * detail_args = 0x0000004c`30ffc4a0 "p???")+0x64
      10 0000004c`30ffc420 00007ffa`e4925d49 jvm!report_vm_error(
                  char * file = 0x00007ffa`e5181430 "c:\sb\prod\1710542487\workspace\open\src\hotspot\share\runtime/thread.hpp",
                  int line = 0n546,
                  char * error_msg = 0x00007ffa`e5181400 "assert(_stack_base != nullptr) failed",
                  char * detail_fmt = 0x00007ffa`e51813f0 "Sanity check")+0x5b
      11 (Inline Function) --------`-------- jvm!Thread::stack_base(void)+0x6b
      12 (Inline Function) --------`-------- jvm!Thread::stack_end(void)+0x6b
      13 0000004c`30ffc480 00007ffa`e4fdafa1 jvm!JavaThread::print_on_error(
                  class outputStream * st = 0x0000004c`30ffe0b0,
                  char * buf = 0x00007ffa`e577ed50 "",
                  int buflen = 0n2000)+0x269
      14 (Inline Function) --------`-------- jvm!Threads::print_on_error(void)+0x75
      15 0000004c`30ffc4e0 00007ffa`e506645c jvm!Threads::print_on_error(
                  class outputStream * st = 0x0000004c`30ffe0b0,
                  class Thread * current = 0x000001ff`c10e6170,
                  char * buf = 0x00007ffa`e577ed50 "",
                  int buflen = 0n2000)+0x171
      16 0000004c`30ffc600 00007ffa`e50678fe jvm!VMError::report(
                  class outputStream * st = 0x0000004c`30ffe0b0,
                  bool _verbose = true)+0x26bc
      17 0000004c`30ffe020 00007ffa`e467370e jvm!VMError::report_and_die(
                  int id = 0n-536870912,
                  char * message = 0x00007ffa`e52c65e8 "fatal error",
                  char * detail_fmt = 0x00007ffa`e5380320 "Fatal error in JVMCI shared library JavaVM[%d] owned by JVMCI runtime %d",
                  char * detail_args = 0x0000004c`30ffe2a0 "???",
                  class Thread * thread = 0x000001ff`c10e6170,
                  unsigned char * pc = 0x00000000`00000000 "",
                  void * siginfo = 0x00000000`00000000,
                  void * context = 0x00000000`00000000,
                  char * filename = 0x00007ffa`e537fbd0 "c:\sb\prod\1710542487\workspace\open\src\hotspot\share\jvmci\jvmciRuntime.cpp",
                  int lineno = 0n1034,
                  unsigned int64 size = 0)+0x80e
      18 0000004c`30ffe210 00007ffa`e4b05919 jvm!report_fatal(
                  VMErrorType error_type = 0n-536870912 (No matching enumerant),
                  char * file = 0x00007ffa`e537fbd0 "c:\sb\prod\1710542487\workspace\open\src\hotspot\share\jvmci\jvmciRuntime.cpp",
                  int line = 0n1034,
                  char * detail_fmt = 0x00007ffa`e5380320 "Fatal error in JVMCI shared library JavaVM[%d] owned by JVMCI runtime %d")+0x7e
      *** WARNING: Unable to verify checksum for c:\ade\mesos\work_dir\jib-master\install\jdk-23-galahadeestaging+1-138\windows-x64-debug.jdk\jdk-23\fastdebug\bin\jvmcicompiler.dll
      19 0000004c`30ffe280 00007ffa`dfa7729b jvm!_fatal(void)+0x79
      1a 0000004c`30ffe2c0 0000004c`30ffe230 jvmcicompiler!Java_com_oracle_truffle_runtime_hotspot_libgraal_TruffleToLibGraalCalls_getExceptionHandlersCount+0x5aceb
      1b 0000004c`30ffe2c8 000001ff`f85e9bc8 0x0000004c`30ffe230
      1c 0000004c`30ffe2d0 000001ff`f90bbca8 0x000001ff`f85e9bc8
      1d 0000004c`30ffe2d8 00000003`f90127e0 0x000001ff`f90bbca8
      1e 0000004c`30ffe2e0 000001ff`f7eb1b58 0x00000003`f90127e0
      1f 0000004c`30ffe2e8 000001ff`f84f3f00 0x000001ff`f7eb1b58
      20 0000004c`30ffe2f0 000001ff`f7ec1ba8 0x000001ff`f84f3f00
      21 0000004c`30ffe2f8 000001ff`f7a00000 0x000001ff`f7ec1ba8
      22 0000004c`30ffe300 000001ff`f944bb40 0x000001ff`f7a00000
      23 0000004c`30ffe308 00007ffa`dfa77288 0x000001ff`f944bb40
      24 0000004c`30ffe310 0000004c`30ffe2c0 jvmcicompiler!Java_com_oracle_truffle_runtime_hotspot_libgraal_TruffleToLibGraalCalls_getExceptionHandlersCount+0x5acd8
      25 0000004c`30ffe318 00000000`00000000 0x0000004c`30ffe2c0

      This is a test to ensure that -Dlibgraal.CrashAtIsFatal=true works so frame 0x18 for `jvm!report_fatal` is expected but frame 0x10 for `jvm!report_vm_error` is not. The latter happens because _stack_base for some thread is null (https://github.com/openjdk/jdk/blob/07194195cefc568048fa639b6f8534ce3718c8d2/src/hotspot/share/runtime/thread.hpp#L546).

      Looking at the hs-err report shows the recursive crash happens when print info for the Finalizer thread:

      Java Threads: ( => current thread )
        0x000001ffd5ccee70 JavaThread "main" [_thread_blocked, id=39396, stack(0x0000004c2ff00000,0x0000004c30000000) (1024K)]
        0x000001ffc10e04c0 JavaThread "Reference Handler" daemon [_thread_blocked, id=132784, stack(0x0000004c30800000,0x0000004c30900000) (1024K)]
        0x000001ffc10e1470 JavaThread "Finalizer" daemon [_thread_new, id=134064
      [error occurred during error reporting (printing all threads), id 0xe0000000, Internal Error (c:\sb\prod\1710542487\workspace\open\src\hotspot\share\runtime/thread.hpp:546)]

      This implies that the Finalizer thread has not yet started. The hs-err code needs to guard against this.

      Attachments

        Issue Links

          Activity

            People

              dholmes David Holmes
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: