Thread View: linux.debian.bugs.dist
1 messages
1 total messages
Started by наб
Wed, 07 Oct 2026 13:20
Bug#1150233: libc6: fts_read() ENAMETOOLONGs after filename exceeds around 36620ish bytes (regression vs BSD FTS, fixed in 2.44)
Author: наб
Date: Wed, 07 Oct 2026 13:20
Date: Wed, 07 Oct 2026 13:20
138 lines
6308 bytes
6308 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--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads