(fs) BasicFileAttributes Linux musl 1.2.5 incompatibility with statx

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 26
    • Affects Version/s: 17.0.11, 21.0.2, 25, 26
    • Component/s: core-libs
    • Environment:

      Alpine Linux with musl 1.2.5

    • b20
    • aarch32
    • linux

      Originally reported here:
      https://mail.openjdk.org/pipermail/core-libs-dev/2025-September/151452.html

      JDK-8316304 introduced BasicFileAttributes.creationTime() support via the Linux statx system call on supported systems. There seems to be an incompatibility with musl 1.2.5 which added support for the statx system call (musl 1.2.4 didn't have support for it).

      "java -jar helloworld.jar" crashes. Unzippping the jar and using
      "java -cp . HelloWorld" works!

      Crashes looks something like those:

      # SIGSEGV (0xb) at pc=0x7693e018, pid=8026, tid=8027
      #
      # JRE version: OpenJDK Runtime Environment (21.0+21) (build 21+21)
      # Java VM: OpenJDK Server VM (21+21, mixed mode, serial gc, linux-arm)
      # Problematic frame:
      # V [libjvm.so+0x61e018]

      FATAL ERROR in native method: Null object passed to JNI
        at sun.nio.fs.UnixNativeDispatcher.stat0(java.base at 21/Native Method)
        at sun.nio.fs.UnixNativeDispatcher.stat(java.base at 21/Unknown Source)
        at sun.nio.fs.UnixFileAttributes.get(java.base at 21/Unknown Source)
        at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(java.base at 21/Unknown Source)
        at sun.nio.fs.UnixFileSystemProvider.readAttributes(java.base at 21/Unknown Source)
        at sun.nio.fs.LinuxFileSystemProvider.readAttributes(java.base at 21/Unknown Source)
        at java.nio.file.Files.readAttributes(java.base at 21/Unknown Source)
        at java.util.zip.ZipFile$Source.get(java.base at 21/Unknown Source)
        at java.util.zip.ZipFile$CleanableResource.<init>(java.base at 21/Unknown Source)
        at java.util.zip.ZipFile.<init>(java.base at 21/Unknown Source)
        at java.util.zip.ZipFile.<init>(java.base at 21/Unknown Source)
        at java.util.jar.JarFile.<init>(java.base at 21/Unknown Source)
        at java.util.jar.JarFile.<init>(java.base at 21/Unknown Source)
        at java.util.jar.JarFile.<init>(java.base at 21/Unknown Source)
        at sun.launcher.LauncherHelper.getMainClassFromJar(java.base at 21/Unknown Source)
        at sun.launcher.LauncherHelper.loadMainClass(java.base at 21/Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(java.base at 21/Unknown Source)
      Aborted

      With musl 1.2.4 everything works fine.

            Assignee:
            Aleksei Voitylov
            Reporter:
            Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: