--001a113d0ad4005fe8054536ac86
Content-Type: text/plain; charset=UTF-8
Hi list,
I am using Debian Stretch, obtained with debootstrap (as of Jan 02 2017).
Linux kernel of the host is 4.4.6, and the following is run in a chroot.
File system is ext4.
When I try to run "./configure" of one of the applications I use, it fails, claiming that gmake is not present.
When looking into the "configure script" I find this construct:
/bin/sh -c 'make --version | grep GNU' >/dev/null 2>&1
And when I test it, I see this:
root@mini:/# /bin/sh -c 'make --version | grep GNU' >/dev/null 2>&1 root@mini:/# echo $?
2
root@mini:/# /bin/sh -c 'make --version | grep GNU' >/dev/null 2>/dev/null root@mini:/# echo $?
0
root@mini:/#
There is apparently something that goes wrong when "dup(2)" is used as in
&1
I did an strace of the two constructs:
This is the failing:
"/bin/sh -c 'make --version | gre"..., 8192) = 55
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(1, F_DUPFD, 10) = 11
close(1) = 0
fcntl(11, F_SETFD, FD_CLOEXEC) = 0
dup2(3, 1) = 1
close(3) = 0
fcntl(2, F_DUPFD, 10) = 12
close(2) = 0
fcntl(12, F_SETFD, FD_CLOEXEC) = 0
dup2(1, 2)
[pid 11678] read(0, "GNU Make 4.1\nBuilt for x86_64-pc"..., 32768) =
297
[pid 11678] splice(0, NULL, 1, NULL, 32768, SPLICE_F_MOVE) = -1
EINVAL
(Invalid argument)
And this one works
read(0, /bin/sh -c 'make --version | grep GNU' > /dev/null
/dev/null
" /bin/sh -c 'make --version | gr"..., 8192) = 64
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(1, F_DUPFD, 10) = 11
close(1) = 0
fcntl(11, F_SETFD, FD_CLOEXEC) = 0
dup2(3, 1) = 1
close(3) = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(2, F_DUPFD, 10) = 12
close(2) = 0
fcntl(12, F_SETFD, FD_CLOEXEC) = 0
dup2(3, 2) = 2
close(3)
[pid 11689] read(0, "GNU Make 4.1\nBuilt for x86_64-pc"..., 32768) =
297
[pid 11689] splice(0, NULL, 1, NULL, 32768, SPLICE_F_MOVE) = 0
This suggests that there is something with the "splice(2)" system call.
I tried with grep_2.25-6 wich was in Stretch before. It works as below:
[pid 11821] <... read resumed> "GNU Make 4.1\nBuilt for x86_64-
pc"...,
32768) = 297
...
[pid 11821] read(0, "", 32768) = 0
[pid 11821] write(1, "GNU Make 4.1\nLicense GPLv3+: GNU"..., 91) = 91
It seems to work because it uses read(0,...) and write(1,...) instead of splice().
I could temporarily downgrade grep to that version, but I fear that the
problem may be of a more general nature.
yours,
Lars Bro
--001a113d0ad4005fe8054536ac86
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir="ltr">Hi list,<br><br>I am using Debian Stretch, obtained with debootstrap (as of Jan 02 2017). Linux kernel of the host is 4.4.6, and the following is run in a chroot. File system is ext4.<br><br>When I try to run "./configure" of one
of the applications I use, it fails, claiming that gmake is not present.<br><br>When looking into the "configure script" I find this construct:<br><br>/bin/sh -c 'make --version | grep GNU' >/dev/null 2>&1<br><br>And when I
test it, I see this:<br><br>root@mini:/# /bin/sh -c 'make --version | grep GNU' >/dev/null 2>&1<br>root@mini:/# echo $?<br>2<br>root@mini:/# /bin/sh -c 'make --version | grep GNU' >/dev/null 2>/dev/null<br>root@mini:/#
echo $?<br>0<br>root@mini:/#<br><br>There is apparently something that goes wrong when "dup(2)" is used as in 2>&1<br><br>I did an strace of the two constructs:<br>This is the failing:<br><br>"/bin/sh -c 'make --version | gre&
quot;..., 8192) = 55<br>open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3<br>fcntl(1, F_DUPFD, 10) Â Â Â Â Â Â Â Â Â = 11<br>close(1) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0<br>fcntl(11, F_SETFD, FD_CLOEXEC) Â Â Â Â Â
= 0<br>dup2(3, 1) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 1<br>close(3) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0<br>fcntl(2, F_DUPFD, 10) Â Â Â Â Â Â Â Â Â = 12<br>close(2) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0<br>
fcntl(12, F_SETFD, FD_CLOEXEC) Â Â Â Â Â = 0<br>dup2(1, 2)<br><br>[pid 11678] read(0, "GNU Make 4.1\nBuilt for x86_64-pc"..., 32768) =<br>297<br>[pid 11678] splice(0, NULL, 1, NULL, 32768, SPLICE_F_MOVE) = -1<br>EINVAL <br>(Invalid argument)
<br><br><br>And this one works<br><br>read(0, Â /bin/sh -c 'make --version | grep GNU' > /dev/null<br>2>/dev/null<br>" /bin/sh -c 'make --version | gr"..., 8192) = 64<br>open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC,
0666) = 3<br>fcntl(1, F_DUPFD, 10) Â Â Â Â Â Â Â Â Â = 11<br>close(1) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0<br>fcntl(11, F_SETFD, FD_CLOEXEC) Â Â Â Â Â = 0<br>dup2(3, 1) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 1<br>close(3)
                = 0<br>open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3<br>fcntl(2, F_DUPFD, 10)          = 12<br>close(2)                 = 0<br>fcntl(12, F_
SETFD, FD_CLOEXEC) Â Â Â Â Â = 0<br>dup2(3, 2) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 2<br>close(3)<br><br>[pid 11689] read(0, "GNU Make 4.1\nBuilt for x86_64-pc"..., 32768) =<br>297<br>[pid 11689] splice(0, NULL, 1, NULL, 32768,
SPLICE_F_MOVE) = 0<br><br>This suggests that there is something with the "splice(2)" system call.<br><br>I tried with grep_2.25-6 wich was in Stretch before. It works as below:<br><br>[pid 11821] <... read resumed> "GNU Make 4.1\
nBuilt for x86_64-<br>pc"..., <br>32768) = 297<br>...<br>[pid 11821] read(0, "", 32768) Â Â Â Â Â = 0<br>[pid 11821] write(1, "GNU Make 4.1\nLicense GPLv3+: GNU"..., 91) = 91<br><br><br>It seems to work because it uses read(0,
...) and write(1,...) instead of splice().<br><br>I could temporarily downgrade grep to that version, but I fear that the problem may be of a more general nature.<br><br>yours,<br><br>Lars Bro<br></div>
--001a113d0ad4005fe8054536ac86--
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)