https://sourceware.org/bugzilla/show_bug.cgi?id=28138

--- Comment #21 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Rainer Orth <r...@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=89ccd18ef6ed3e7146ea4b1b89815c907caefa08

commit 89ccd18ef6ed3e7146ea4b1b89815c907caefa08
Author: Rainer Orth <r...@cebitec.uni-bielefeld.de>
Date:   Mon Jul 28 23:00:26 2025 +0200

    ld: testsuite: Fix "PR ld/28138 (build only)" on Solaris

    The

    FAIL: PR ld/28138 (build only)

    test FAILs on Solaris:

    ld/tmpdir/ld/collect-ld: plugin framework: out of file descriptors. Try
using fewer objects/archives

    ld/tmpdir/ld/collect-ld: cannot find -lgcc: Too many open files
    [...]

    I found that the test PASSes when using ulimit -n 21 instead of the
    current 20.  Looking with strace/truss, on Linux/i686 the following
    files are opened:

    301543 openat(AT_FDCWD, "tmpdir/pr28138",
O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
    301543 openat(AT_FDCWD, "/lib/../lib32/crt1.o", O_RDONLY|O_LARGEFILE) = 4
    301543 openat(AT_FDCWD, "/lib/../lib32/crt1.o", O_RDONLY|O_LARGEFILE) = 5
    301543 openat(AT_FDCWD, "/lib/../lib32/crti.o", O_RDONLY|O_LARGEFILE) = 5
    301543 openat(AT_FDCWD, "/lib/../lib32/crti.o", O_RDONLY|O_LARGEFILE) = 6
    301543 openat(AT_FDCWD, "lib/gcc/i686-pc-linux-gnu/12.1.0/crtbegin.o",
O_RDONLY|O_LARGEFILE) = 6
    301543 openat(AT_FDCWD, "lib/gcc/i686-pc-linux-gnu/12.1.0/crtbegin.o",
O_RDONLY|O_LARGEFILE) = 7
    301543 openat(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY|O_LARGEFILE) = 7
    301543 openat(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY|O_LARGEFILE) = 8
    301543 openat(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY|O_LARGEFILE) = 8
    301543 openat(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY|O_LARGEFILE) = 9
    301543 openat(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY|O_LARGEFILE) = 9
    301543 openat(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY|O_LARGEFILE) = 10
    301543 openat(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY|O_LARGEFILE) = 10
    301543 openat(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY|O_LARGEFILE) = 11
    301543 openat(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY|O_LARGEFILE) = 11
    301543 openat(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY|O_LARGEFILE) = 12
    301543 openat(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY|O_LARGEFILE) = 12
    301543 openat(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY|O_LARGEFILE) = 13
    301543 openat(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY|O_LARGEFILE) = 13
    301543 openat(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY|O_LARGEFILE) = 3
    301543 openat(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY|O_LARGEFILE) = 3
    301543 openat(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY|O_LARGEFILE) = 4
    301543 openat(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY|O_LARGEFILE) = 4
    301543 openat(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY|O_LARGEFILE) = 5

    while on Solaris/i386 there are a couple more:

    27726:  openat64(AT_FDCWD, "tmpdir/pr28138", O_RDWR|O_CREAT|O_TRUNC, 0666)
= 4
    27726:  openat64(AT_FDCWD, "/usr/lib/crt1.o", O_RDONLY) = 5
    27726:  openat64(AT_FDCWD, "/usr/lib/crt1.o", O_RDONLY) = 6
    27726:  openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtp.o",
O_RDONLY) = 6
    27726:  openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtp.o",
O_RDONLY) = 7
    27726:  openat64(AT_FDCWD, "/usr/lib/crti.o", O_RDONLY) = 7
    27726:  openat64(AT_FDCWD, "/usr/lib/crti.o", O_RDONLY) = 8
    27726:  openat64(AT_FDCWD, "/usr/lib/values-Xa.o", O_RDONLY) = 8
    27726:  openat64(AT_FDCWD, "/usr/lib/values-Xa.o", O_RDONLY) = 9
    27726:  openat64(AT_FDCWD, "/usr/lib/values-xpg6.o", O_RDONLY) = 9
    27726:  openat64(AT_FDCWD, "/usr/lib/values-xpg6.o", O_RDONLY) = 10
    27726:  openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtbegin.o",
O_RDONLY) = 10
    27726:  openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtbegin.o",
O_RDONLY) = 11
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY) = 11
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY) = 12
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY) = 12
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY) = 13
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY) = 13
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY) = 14
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY) = 14
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY) = 15
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY) = 15
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY) = 16
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY) = 16
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY) = 17
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY) = 17
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY) = 18
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY) = 18
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY) = 19
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY) = 19
    27726:  openat64(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY) Err#24 EMFILE

    While it seems weird that the same files are opened twice for reading,
    it's no wonder that 20 fds aren't enough on Solaris.

    To avoid this, I've raised the limit to 25, hoping that this will be
    enough on more targets.

    Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

    2025-07-25  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

            ld:
            * testsuite/ld-plugin/lto.exp (PR ld/28138 test): Raise fd limit
            to 25.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to