🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.maint.glibc
Article #2

Bug#1150233: libc6: fts_read() ENAMETOOLONGs after filename exceeds around 36620ish bytes (regression vs BSD FTS, fixed in 2.44)

#2
From: наб
Date: Wed, 07 Oct 2026 13:20
138 lines
6224 bytes
--wgf4z3ctmzyg4nkv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: libc6
Version: 2.41-12
Severity: normal
Tags: upstream
Control: found -1 2.36-9+deb12u13
Control: found -1 2.43-7
Control: forwarded -1 https://sourceware.org/bugzilla/show_bug.cgi?id=22944

Dear Maintainer,

-- >8 --
#include <err.h>
#include <fts.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>

int main(int, char * const * argv) {
        errno = 0;
        FTS * stream = fts_open(argv, FTS_PHYSICAL, nullptr);
        for(FTSENT * ent; (ent = fts_read(stream));) {
                printf("%zu: %s\n", strlen(ent->fts_path), ent->fts_info == FTS_NS ? "FTS_NS" :
                ent->fts_info == FTS_D ? "FTS_D" :
                ent->fts_info == FTS_DNR ? "FTS_DNR" :
                ent->fts_info == FTS_DP ? "FTS_DP" :
                ent->fts_info == FTS_F ? "FTS_F" :
                ent->fts_info == FTS_SL ? "FTS_SL" :
                ent->fts_info == FTS_SLNONE ? "FTS_SLNONE" :
                ent->fts_info == FTS_DEFAULT ? "FTS_DEFAULT" :
                ent->fts_info == FTS_ERR ? "FTS_ERR" :
                ent->fts_info == FTS_DC ? "FTS_DC" :
                ent->fts_info == FTS_DOT ? "FTS_DOT" :
                ent->fts_info == FTS_NSOK ? "FTS_NSOK" :
                "idk");
        }
        err(0, nullptr);
}
-- >8 --
when run as
  mkdir -p $(yes a/ | head -n $((32 * 1024)) | tr -d '\n') && cc ftstest.c && ./a.out a
tails out with
  36615: FTS_D
  36617: FTS_D
  36619: FTS_D
  36621: FTS_D
  a.out: File name too long
(with s/a/qq/ it's after 36617). The correct tail ends like
(captured with musl and void-linux/musl-fts 1.2.7):
  5: FTS_DP
  3: FTS_DP
  1: FTS_DP
  a.out: No error information

Upstream commit 99303f387179332d64e5ee34a6b58e82a523bae5
(io: Use gnulib fts implementation (BZ 22944, BZ 20331)),
included in glibc 2.44, fixes this:
  65529: FTS_D
  65531: FTS_D
  65533: FTS_D
  65535: FTS_D
  65535: FTS_DP
  65533: FTS_DP
  65531: FTS_DP
  65529: FTS_DP
  65527: FTS_DP
  ...
  13: FTS_DP
  11: FTS_DP
  9: FTS_DP
  7: FTS_DP
  5: FTS_DP
  3: FTS_DP
  1: FTS_DP
  a: Success

This bug appears equivalent to
  https://sourceware.org/bugzilla/show_bug.cgi?id=22944

However, glibc 2.44 and trunk (46d325b68c1e49ad87b5e99a1ec9df5406350e31)
have a different bug when given absolute filenames in this case.

Best,

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: amd64, i386

Kernel: Linux 6.7.7-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libc6 depends on:
ii  libgcc-s1  14.2.0-14

Versions of packages libc6 recommends:
ii  libidn2-0  2.3.7-2+b1

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.89
pn  glibc-doc              <none>
ii  libc-l10n              2.41-12
ii  libnss-nis             3.1-5+b1
ii  libnss-nisplus         1.3-5+b2
ii  locales                2.41-12

-- debconf information excluded

--wgf4z3ctmzyg4nkv
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmrGQ4QACgkQvP0LAY0m
WPFN4g/6A4js8isnqPo+gRQGb3N37+lAyl0xN7nk4SgfASnMhHV0v5OSwUPXmMNr
2zTAjbgmrkyhc4600Y0pRtdzczY4nE2i3iBhtiipsJ9iUbRJ+n74tKB+y3Thhr5f
Oikj39U40FF9kRDoWuTOd1OLxeQLJhDh81JtvScu32PrgQBxjZuXqNKIx1GZYC8i
MQKXAzDlR2GhCLyldtjld/FbrTdS4f/Bhfb+r4blfDlVRZz37bIu03NWuJp8avzL
i5OI9aB3Fm56DCdm1469YGfsuoww+5IUGQ5XL0j66p7mj76eEFx/2ZKEKomSr8E3
3Z+p5GumJAzmxLtLU1Eto8YA11En35jc5OdYZ8whow+D745XMCobEK3r5veR01Aa
ChYsb70a9W6IaCMO1Xt2RCqiJdCtMG5V0YWF/W7ieLU4oNL+RRY7k/O0D8TSMj54
TuxD0b5lJjlU41SpYAzzWp40s/QWXKmEuPuHaYLrqrIIDPrT8Pm+YbWo6lNAsTmd
C3plVqZiYScVdU/Lwpusa9kIlCKUhzJCqvG00imwBcojneIkd9qkCdT2ztxpMhd7
T3kr5F4sX/ujKFLfpkHqil4ANCTMiYU4M6ARtdXqVU2XFvHLnZ6mfPDF9j2Ubi7Q
DU9WjmAyv2yWt9QnYxbK6PpzF45/l9RYQBD+9t2AS5Wr7histNU=
=pT7H
-----END PGP SIGNATURE-----

--wgf4z3ctmzyg4nkv--
Technical Details
Message-ID: <NLzIR-45eX-5@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: наб <nabijaczleweli@nabijaczleweli.xyz>
Newsgroups: linux.debian.bugs.dist,linux.debian.maint.glibc
Subject: Bug#1150233: libc6: fts_read() ENAMETOOLONGs after filename exceeds around 36620ish bytes (regression vs BSD FTS, fixed in 2.44)
Date: Wed, 07 Oct 2026 15:20:01 +0200
Message-ID: <NLzIR-45eX-5@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Oct  7 13:15:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: 1.057
Reply-To: наб <nabijaczleweli@nabijaczleweli.xyz>, 1150233@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: debian-glibc@lists.debian.org
X-Debian-Pr-Message: report 1150233
X-Debian-Pr-Package: libc6
X-Debian-Pr-Keywords: upstream
X-Debian-Pr-Source: eglibc, glibc
X-Reportbug-Version: 12.0.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="wgf4z3ctmzyg4nkv"
Content-Disposition: inline
User-Agent: NeoMutt/20240329
X-Greylist: delayed 444 seconds by postgrey-1.37 at buxtehude; Wed, 07 Oct 2026 13:12:45 UTC
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1995542
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 138
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 7 Oct 2026 15:05:16 +0200
X-Original-Message-ID: <2trk74f2huthuoghtd7shb2aw35mx4kugzm4j4yktb33ui6p33@tarta.nabijaczleweli.xyz>