GNU bug report logs -
#77621
coreutils-9.6.53-14af8 on OpenBSD 7.6
Previous Next
Reported by: Bruno Haible <bruno <at> clisp.org>
Date: Mon, 7 Apr 2025 22:42:02 UTC
Severity: normal
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 77621 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Paul Eggert wrote:
> I don't see the problem on cfarm220.cfarm.net with the current coreutils
That's because you are not on the /dev/wd0a disk on that machine.
What I see by single-stepping through "ls -Z ." in gdb is:
1. f->scontext gets set to "?".
2. Upon the first entry to function file_has_aclinfo_cache,
all 4 variables
static int unsupported_return;
static char *unsupported_scontext;
static int unsupported_scontext_err;
static dev_t unsupported_device;
are 0 or NULL, respectively. (As expected, since it's the first call
to this function.)
f->stat.st_dev is 0 (since "." is on the /dev/wd0a disk and this device
has major and minor number both 0).
Thus the condition (f->stat_ok && f->stat.st_dev == unsupported_device)
evaluates to true, and four lines later, in
ai->scontext = unsupported_scontext;
an scontext gets set to NULL.
The fix is obviously to ignore these 4 static variables if they have not
been initialized. Done through the attached patch, which fixes the crash.
[0001-ls-Fix-crash-of-ls-Z-.-on-OpenBSD-s-dev-wd0a-disk.patch (text/x-patch, attachment)]
This bug report was last modified 102 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.