Fix SIGSEGV when lib/modules is unreadable

XMLWordPrintable

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

      The JVM crashes with a SIGSEGV during startup if the runtime image (lib/modules) exists but is unreadable. This case may happen due to deployment permission errors or strict security hardening.

      The issue occurs in AOTClassLocationConfig::validate. The call to ClassLoader::get_jrt_entry() returns nullptr when the modules file cannot be read. The code subsequently attempts to dereference this null pointer to access ->name(), causing the crash.

      Steps to Reproduce:
      chmod a-r ./lib/modules ; ./bin/java -version

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f7bcf4a272a, pid=1700, tid=1701
      #
      # JRE version: (25.0.3) (fastdebug build )
      # Java VM: OpenJDK 64-Bit Server VM
      # Problematic frame:
      # V [libjvm.so+0x6a272a] AOTClassLocationConfig::validate(char const*, bool, bool*) const+0x2aa

            Assignee:
            Boris Ulasevich
            Reporter:
            Boris Ulasevich
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: