https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90719

            Bug ID: 90719
           Summary: libphobos.phobos_shared/std/file.d FAILs on 32-bit
                    Solaris
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
            Target: *-*-solaris2.11

libphobos.phobos_shared/std/file.d currently FAILs on 32-bit Solaris:

FAIL: libphobos.phobos_shared/std/file.d execution test

core.exception.AssertError@/vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/../src/std/file.d(1040):
unittest failure

[2000-Feb-03 23:12:09.5593787] [2000-Feb-04 01:09:39.5593787] [2019-Jun-01
10:45:13.9496087] [-1008 weeks, -1 days, -10 hours, -33 minutes, -4 secs, -390
ms, and -230 μs] [-1008 weeks, -1 days, -8 hours, -35 minutes, -34 secs, -390
ms, and -230 μs]

It turns out there's another mismatch between the system and druntime
declarations, this time affecting struct stat:

Solaris 11 <sys/stat.h> has

struct  stat {
        dev_t           st_dev;
        long            st_pad1[3];     /* reserved for network id */
        ino_t           st_ino;
        mode_t          st_mode;
        nlink_t         st_nlink;
        uid_t           st_uid;
        gid_t           st_gid;
        dev_t           st_rdev;
        long            st_pad2[2];
        off_t           st_size;
#if _FILE_OFFSET_BITS != 64
        long            st_pad3;        /* future off_t expansion */
#endif
        timespec_t      st_atim;
        timespec_t      st_mtim;
        timespec_t      st_ctim;
        blksize_t       st_blksize;
        blkcnt_t        st_blocks;
        char            st_fstype[_ST_FSTYPSZ];
        long            st_pad4[8];     /* expansion area */
};

while libdruntime/core/sys/posix/sys/stat.d has

        struct stat32_t
        {
            dev_t st_dev;
            c_long[3] st_pad1;
            ino_t st_ino;
            mode_t st_mode;
            nlink_t st_nlink;
            uid_t st_uid;
            gid_t st_gid;
            dev_t st_rdev;
            c_long[2] st_pad2;
            off_t st_size;
            c_long st_pad3;
            union
            {
                timestruc_t st_atim;
                time_t      st_atime;
            }
            union
            {
                timestruc_t st_mtim;
                time_t      st_mtime;
            }
            union
            {
                timestruc_t st_ctim;
                time_t      st_ctime;
            }
            blksize_t st_blksize;
            blkcnt_t st_blocks;
            char[_ST_FSTYPSZ] st_fstype = 0;
            c_long[8] st_pad4;
        }

        static if (__USE_FILE_OFFSET64)
            alias stat64_t stat_t;
        else
            alias stat32_t stat_t;

i.e. st_pad3 is included in the non-largefile version of struct stat when it
shouldn't be.

Fixed by the attached patch which lets the test PASS.

Reply via email to