Re: [bug-bash] The kill test of util-linux fails with bash 5.3
From:
Dr. Werner Fink
Subject:
Re: [bug-bash] The kill test of util-linux fails with bash 5.3
Date:
Wed, 23 Jul 2025 09:18:45 +0200
On 2025/07/23 08:42:54 +0200, Dr. Werner Fink wrote:
> On 2025/07/22 10:07:41 -0400, Chet Ramey wrote:
> > On 7/22/25 10:04 AM, Dr. Werner Fink wrote:
> > > On 2025/07/22 09:55:38 -0400, Chet Ramey wrote:
> > > > On 7/22/25 9:47 AM, Dr. Werner Fink wrote:
> > > > > On 2025/07/22 09:10:05 -0400, Chet Ramey wrote:
> > > > > > On 7/22/25 8:12 AM, Dr. Werner Fink wrote:
> > > > > > > On 2025/07/22 13:15:38 +0200, Dr. Werner Fink wrote:
> > > > > > > [...]
> > > > > > >
> > > > > > > found a not expanded m4 autoconf macro GL_MDA_DEFINES in
> > > > > > > m4/fcntl-o.m4
> > > > > >
> > > > > > Good catch. What happens if you take that macro out and re-run
> > > > > > autoconf
> > > > > > and configure?
> > > > >
> > > > > As I do autoconfig by default for bash it shows
> > > >
> > > > Are you sure it changes config.h?
> > >
> > > It changes not the config.h AFAICS ... I only cross this during
> > > searching for the missing network. I've to see how the ssh_ping
> > > works.
> >
> > Yeah, I have no idea what those things are doing.
>
> That makes two of us ... nevertheless
>
> I've picked out one test torture_connect to shorten test runs a bit and
> run below libssh-0.11.2/build
>
> ctest --output-on-failure --force-new-ctest-process -R torture_connect
>
> it works with old bash-5.2 linked to /bin/sh as well as the dash and
> ksh-93vu linked to /bin/sh ... but with bash-5.3 it does not work.
>
> With strace I see that in case of bash-5.3 the sshd.pid of the server
> side will not be written causing all following client tests have to fail.
>
> 307826 openat(AT_FDCWD, "/tmp/test_socket_wrapper_EElgbB/sshd/sshd.pid",
> O_RDONLY) = -1 ENOENT (No such file or directory)
>
> whereas with bash-5.2
>
> 1525 openat(AT_FDCWD, "/tmp/test_socket_wrapper_p3ZppW/sshd/sshd.pid",
> O_WRONLY|O_CREAT|O_TRUNC, 0666 <unfinished ...>
> 1526 <... access resumed>) = 0
> 1526 newfstatat(AT_FDCWD, "/usr/bin/sh", <unfinished ...>
> 1525 <... openat resumed>) = 11
>
Starting sshd with bash-5.3 leads to
307827 execve("/bin/sh", ["sh", "-c", "--",
"KRB5CCNAME=/tmp/test_socket_wrapper_EElgbB/gss/cc
KRB5_CONFIG=/tmp/test_socket_wrapper_EElgbB/gss/k/krb5.conf
KRB5_KDC_PROFILE=/tmp/test_socket_wra
pper_EElgbB/gss/k KRB5_KTNAME=/tmp/test_socket_wrapper_EElgbB/gss/d/ssh.keytab
KRB5RCACHETYPE=none /usr/sbin/sshd -r -f
/tmp/test_socket_wrapper_EElgbB/sshd/sshd_config -E /tmp/test_socket_wr
apper_EElgbB/sshd/daemon.log 2>
/tmp/test_socket_wrapper_EElgbB/sshd/cwrap.log"], 0x555e23d57cf0 /* 63 vars */
<unfinished ...>
307826 <... clone3 resumed>) = 307827
307826 munmap(0x7f7a0d302000, 36864) = 0
307826 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
307826 wait4(307827, <unfinished ...>
307827 <... execve resumed>) = 0
[...]
307827 futex(0x7ff1d2806158, FUTEX_WAKE_PRIVATE, 2147483647) = 0
307827 getresuid([399], [399], [399]) = 0
307827 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
307827 +++ killed by SIGSEGV +++
hence no sever side and no pid file
With `ulimit -c unlimited` I see a core dump of the bash-5.3
#0 0x0000000000000000 in ?? ()
Missing separate debuginfos, use: zypper install
socket_wrapper-debuginfo-1.5.0-1.1.x86_64
nss_wrapper-debuginfo-1.1.16-1.3.x86_64 uid_wrapper-debuginfo-1.3.1-1.3.x86_64
pam_wrapper-debuginfo-1.1.7-1.4.x86_64 libreadline8-debuginfo-8.2.13-2.3.x86_64
glibc-debuginfo-2.41-3.1.x86_64 libncurses6-debuginfo-6.5.20250712-77.1.x86_64
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000056477dc724bb in uidget () at
/home/abuild/rpmbuild/BUILD/bash-5.3.0-build/bash-5.3/shell.c:1322
#2 main (argc=4, argv=0x7ffd55b37c78, env=0x7ffd55b37ca0) at
/home/abuild/rpmbuild/BUILD/bash-5.3.0-build/bash-5.3/shell.c:424
(gdb) up 1
#1 0x000056477dc724bb in uidget () at
/home/abuild/rpmbuild/BUILD/bash-5.3.0-build/bash-5.3/shell.c:1322
1322 (void) getresgid (¤t_user.gid, ¤t_user.egid,
¤t_user.savegid);
Strange ... AFAICS clone3() is used to spawn the subprocess for the shell
307826 clone3({flags=CLONE_VM|CLONE_VFORK|CLONE_CLEAR_SIGHAND,
exit_signal=SIGCHLD, stack=0x7f7a0d302000, stack_size=0x9000}, 88 <unfinished
...>
307827 rt_sigprocmask(SIG_BLOCK, NULL, ~[KILL STOP], 8) = 0
307827 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[],
sa_flags=SA_RESTORER, sa_restorer=0x7f7a0d042260}, NULL, 8) = 0
307827 rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[],
sa_flags=SA_RESTORER, sa_restorer=0x7f7a0d042260}, NULL, 8) = 0
307827 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
307827 execve("/bin/sh", ["sh", "-c", "--",
"KRB5CCNAME=/tmp/test_socket_wrapper_EElgbB/gss/cc
KRB5_CONFIG=/tmp/test_socket_wrapper_EElgbB/gss/k/krb5.conf
KRB5_KDC_PROFILE=/tmp/test_socket_wrapper_EElgbB/gss/k
KRB5_KTNAME=/tmp/test_socket_wrapper_EElgbB/gss/d/ssh.keytab
KRB5RCACHETYPE=none /usr/sbin/sshd -r -f
/tmp/test_socket_wrapper_EElgbB/sshd/sshd_config -E
/tmp/test_socket_wrapper_EElgbB/sshd/daemon.log 2>
/tmp/test_socket_wrapper_EElgbB/sshd/cwrap.log"], 0x555e23d57cf0 /* 63 vars */
<unfinished ...>
Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr