bug#77621: coreutils-9.6.53-14af8 on OpenBSD 7.6

Bruno Haible via GNU coreutils Bug Reports <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Organization GNU
Message-ID <1818491.4herOUoSWf@nimes>
On OpenBSD 7.6 there is a test failure:

FAIL: tests/ls/selinux-segfault

Find attached the log file.

To reproduce the issue, just run

$ src/ls -Z .
Segmentation fault (core dumped)

It crashes at strlen(), due to a NULL argument,
invoked from gobble_file (name = ".", type = arg_directory, inode = 0,
command_line_arg = true, dirname = NULL) at ls.c:3642,
invoked from ls.c:1812.

This reminds me the commit
https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=915004f403cb25fadb207ddfdbe6a2f43bd44fac
that was supposed to fix the bug reported in
https://lists.gnu.org/archive/html/coreutils/2025-01/msg00051.html

Apparently this bug has reappeared, at least on OpenBSD.

Bruno
openbsd76-test-suite.log (text/x-log, 5.2 KB)
========================================================
   GNU coreutils 9.6.53-14af8: ./tests/test-suite.log
========================================================

# TOTAL: 658
# PASS:  480
# SKIP:  177
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/ls/selinux-segfault
===============================

++ initial_cwd_=/home/bruno/coreutils-9.6.53-14af8/build
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /home/bruno/coreutils-9.6.53-14af8/build gt-selinux-segfault.sh.XXXX
+++ case $# in
+++ destdir_=/home/bruno/coreutils-9.6.53-14af8/build
+++ template_=gt-selinux-segfault.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ destdir_slash_=/home/bruno/coreutils-9.6.53-14af8/build/
+++ case $template_ in
++++ unset TMPDIR
+++ d=/home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
+++ case $d in
+++ :
+++ test -d /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
++++ ls -dgo /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
+++ perms='drwx------. 2 512 Apr  7 21:51 /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC'
+++ case $perms in
+++ :
+++ echo /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
+++ return
++ test_dir_=/home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
++ cd /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
++ case $srcdir in
++ srcdir=../..
++ builddir=..
++ export srcdir builddir
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ saved_IFS=' 	
'
++ IFS=:
++ new_PATH=
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /home/bruno/coreutils-9.6.53-14af8/build/src/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /home/bruno/bin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /bin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /sbin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /usr/bin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin:/usr/bin
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /usr/sbin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin:/usr/bin:/usr/sbin
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /usr/local/bin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
++ for dir in $PATH
++ IFS=' 	
'
++ case "$dir" in
++ test -d /usr/local/sbin/.
++ new_PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
++ IFS=' 	
'
++ PATH=/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
++ export PATH
++ trap remove_tmp_ EXIT
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/home/bruno/coreutils-9.6.53-14af8/build/./src
+ case $abs_path_dir_ in
+ PATH=/home/bruno/coreutils-9.6.53-14af8/build/./src:/home/bruno/coreutils-9.6.53-14af8/build/src:/home/bruno/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+ create_exe_shims_ /home/bruno/coreutils-9.6.53-14af8/build/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ ls
+ require_built_ ls
+ skip_=no
+ for i in "$@"
+ case " $built_programs " in
+ test no = yes
+ test yes = yes
+ local i
+ for i in $*
+ env ls --version
ls (GNU coreutils) 9.6.53-14af8
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.
+ f=/proc/sys
+ test -r /proc/sys
+ f=.
+ ls -l .
+ mkdir sedir
+ ln -sf missing sedir/broken
+ returns_ 1 ls -L -R -Z -m sedir
../tests/init.sh: line 612: 79448 Segmentation fault      (core dumped) "$@"
+ fail=1
+ ls -Z .
../tests/ls/selinux-segfault.sh: line 34: 95717 Segmentation fault      (core dumped) ls -Z . > out
+ fail=1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ test '' = yes
+ cd /home/bruno/coreutils-9.6.53-14af8/build
+ chmod -R u+rwx /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
+ rm -rf /home/bruno/coreutils-9.6.53-14af8/build/gt-selinux-segfault.sh.yGIC
+ exit 1
FAIL tests/ls/selinux-segfault.sh (exit status: 1)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.