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

Test java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 24
    • 17, 21, 23
    • core-libs
    • b04
    • generic
    • linux

        The testcase java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3(alibaba cloud linux version 3) after JDK-8316304.

        The test log snippet:
        File creation time reported as: 1970-01-01T00:00:00Z
        java.lang.RuntimeException: Expected to be close to: 2024-06-16T02:53:30.875280044Z
                at CreationTime.test(CreationTime.java:72)
                at CreationTime.main(CreationTime.java:132)

        The testcase use /tmp directory to create the file and get the createtime of this file. But on alinux3(alibaba cloud linux version 3), the /tmp is mount as tmpfs, it's not a real physic disk paitition, it's mount from RAM, and the alinux3 doesn't support get the birth time on tmpfs.

        On ubuntu22, when I create a file on /dev/shm(it's also a tmpfs type partition), stat also doesn't support birth time, show as below:
        yansendao@jvmtest:[~]> df -h
        Filesystem Size Used Avail Use% Mounted on
        tmpfs 25G 964K 25G 1% /run
        /dev/vda3 40G 26G 12G 70% /
        tmpfs 123G 0 123G 0% /dev/shm
        tmpfs 5.0M 0 5.0M 0% /run/lock
        /dev/vda2 191M 5.3M 186M 3% /boot/efi
        /dev/vdb 492G 215G 252G 46% /home
        tmpfs 25G 0 25G 0% /run/user/998
        yansendao@jvmtest:[~]> touch /dev/shm/file
        yansendao@jvmtest:[~]> stat /dev/shm/file
          File: /dev/shm/file
          Size: 0 Blocks: 0 IO Block: 4096 regular empty file
        Device: 1dh/29d Inode: 3 Links: 1
        Access: (0664/-rw-rw-r--) Uid: ( 998/yansendao) Gid: ( 998/yansendao)
        Access: 2024-06-16 15:58:48.562278964 +0800
        Modify: 2024-06-16 15:58:48.562278964 +0800
        Change: 2024-06-16 15:58:48.562278964 +0800
         Birth: -


        Alinux3 OS information:
        > cat /etc/os-release
        NAME="Alibaba Cloud Linux"
        VERSION="3 (Soaring Falcon)"
        ID="alinux"
        ID_LIKE="rhel fedora centos anolis"
        VERSION_ID="3"
        UPDATE_ID="9"
        PLATFORM_ID="platform:al8"
        PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)"
        ANSI_COLOR="0;31"
        HOME_URL="https://www.aliyun.com/"

        > uname -a
        Linux j66e07344.sqa.eu95 5.10.134-16.1.al8.x86_64 #1 SMP Thu Dec 7 14:11:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

        > ldd --version
        ldd (GNU libc) 2.32
        Copyright (C) 2020 Free Software Foundation, Inc.
        This is free software; see the source for copying conditions. There is NO
        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
        Written by Roland McGrath and Ulrich Drepper.

        > df -h
        Filesystem Size Used Avail Use% Mounted on
        devtmpfs 94G 0 94G 0% /dev
        tmpfs 94G 20K 94G 1% /dev/shm
        tmpfs 94G 2.7M 94G 1% /run
        tmpfs 94G 0 94G 0% /sys/fs/cgroup
        /dev/sda3 220G 28G 184G 13% /
        tmpfs 94G 20M 94G 1% /tmp
        /dev/sda2 200M 5.8M 195M 3% /boot/efi
        tmpfs 19G 0 19G 0% /run/user/0
        /dev/nvme0n1 880G 414G 421G 50% /home
        tmpfs 19G 0 19G 0% /run/user/995

              syan Sendao Yan
              syan Sendao Yan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: