On 2012-10-19 16:39:10 -0700, Mark Nudelman wrote:
> Hi Aníbal,
> Thank you for bringing this bug to my attention.  Unfortunately I have
> not been able to reproduce it on a Fedora system:

Note: I've just noticed that the file to view must not be empty
to reproduce the bug.

> Linux legolas-fedora 2.6.35.13-92.fc14.i686 #1 SMP Sat May 21 17:39:42
> UTC 2011 i686 i686 i386 GNU/Linux
> 
> I've tried a number of scenarios with different LESSOPEN variants but
> have never produced a zombie process.

Here's a script I've used to reproduce the bug here (there's also
a strace call to get strace output). It removes some environment
variables, in case they may have an influence.

#!/bin/sh

# Testcase for Debian bug 615031
#   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615031

prefix=less-test

# $SHELL may have an influence.
unset SHELL

for i in `env | sed -n 's/^\(LESS[^=]*\).*/\1/p'`; do unset "$i"; done

cat > $prefix-open.sh <<EOF
#!/bin/sh
cat "\$@"
EOF
chmod 755 $prefix-open.sh

echo blah > $prefix-file

export LESSOPEN="|`pwd`/$prefix-open.sh %s"
strace -f -t -o $prefix-strace less $prefix-file

rm $prefix-file $prefix-open.sh

And here's the strace output:

2253  12:55:07 execve("/usr/bin/less", ["less", "less-test-file"], [/* 100 vars 
*/]) = 0
2253  12:55:07 brk(0)                   = 0x1722000
2253  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 mmap(NULL, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f826b3b8000
2253  12:55:07 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/lib64/tls/x86_64/libtinfo.so.5", O_RDONLY) = -1 ENOENT 
(No such file or directory)
2253  12:55:07 stat("/lib64/tls/x86_64", 0x7fff9d73ac50) = -1 ENOENT (No such 
file or directory)
2253  12:55:07 open("/lib64/tls/libtinfo.so.5", O_RDONLY) = -1 ENOENT (No such 
file or directory)
2253  12:55:07 stat("/lib64/tls", 0x7fff9d73ac50) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/lib64/x86_64/libtinfo.so.5", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2253  12:55:07 stat("/lib64/x86_64", 0x7fff9d73ac50) = -1 ENOENT (No such file 
or directory)
2253  12:55:07 open("/lib64/libtinfo.so.5", O_RDONLY) = -1 ENOENT (No such file 
or directory)
2253  12:55:07 stat("/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2253  12:55:07 open("/home/vinc17/./lib/tls/x86_64/libtinfo.so.5", O_RDONLY) = 
-1 ENOENT (No such file or directory)
2253  12:55:07 stat("/home/vinc17/./lib/tls/x86_64", 0x7fff9d73ac50) = -1 
ENOENT (No such file or directory)
2253  12:55:07 open("/home/vinc17/./lib/tls/libtinfo.so.5", O_RDONLY) = -1 
ENOENT (No such file or directory)
2253  12:55:07 stat("/home/vinc17/./lib/tls", 0x7fff9d73ac50) = -1 ENOENT (No 
such file or directory)
2253  12:55:07 open("/home/vinc17/./lib/x86_64/libtinfo.so.5", O_RDONLY) = -1 
ENOENT (No such file or directory)
2253  12:55:07 stat("/home/vinc17/./lib/x86_64", 0x7fff9d73ac50) = -1 ENOENT 
(No such file or directory)
2253  12:55:07 open("/home/vinc17/./lib/libtinfo.so.5", O_RDONLY) = -1 ENOENT 
(No such file or directory)
2253  12:55:07 stat("/home/vinc17/./lib", {st_mode=S_IFDIR|0755, st_size=4096, 
...}) = 0
2253  12:55:07 open("/etc/ld.so.cache", O_RDONLY) = 3
2253  12:55:07 fstat(3, {st_mode=S_IFREG|0644, st_size=148038, ...}) = 0
2253  12:55:07 mmap(NULL, 148038, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f826b393000
2253  12:55:07 close(3)                 = 0
2253  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/lib/x86_64-linux-gnu/libtinfo.so.5", O_RDONLY) = 3
2253  12:55:07 read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\323\0\0\0\0\0\0"..., 832) = 
832
2253  12:55:07 fstat(3, {st_mode=S_IFREG|0644, st_size=167952, ...}) = 0
2253  12:55:07 mmap(NULL, 2264608, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f826af72000
2253  12:55:07 mprotect(0x7f826af97000, 2093056, PROT_NONE) = 0
2253  12:55:07 mmap(0x7f826b196000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7f826b196000
2253  12:55:07 close(3)                 = 0
2253  12:55:07 open("/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/home/vinc17/./lib/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2253  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
2253  12:55:07 read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 
832
2253  12:55:07 fstat(3, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0
2253  12:55:07 mmap(NULL, 3709016, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f826abe8000
2253  12:55:07 mprotect(0x7f826ad68000, 2097152, PROT_NONE) = 0
2253  12:55:07 mmap(0x7f826af68000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x7f826af68000
2253  12:55:07 mmap(0x7f826af6d000, 18520, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f826af6d000
2253  12:55:07 close(3)                 = 0
2253  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f826b392000
2253  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f826b391000
2253  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f826b390000
2253  12:55:07 arch_prctl(ARCH_SET_FS, 0x7f826b391700) = 0
2253  12:55:07 mprotect(0x7f826af68000, 16384, PROT_READ) = 0
2253  12:55:07 mprotect(0x7f826b196000, 16384, PROT_READ) = 0
2253  12:55:07 mprotect(0x620000, 4096, PROT_READ) = 0
2253  12:55:07 mprotect(0x7f826b3ba000, 4096, PROT_READ) = 0
2253  12:55:07 munmap(0x7f826b393000, 148038) = 0
2253  12:55:07 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:07 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:07 brk(0)                   = 0x1722000
2253  12:55:07 brk(0x1743000)           = 0x1743000
2253  12:55:07 stat("/home/vinc17/.terminfo", {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
2253  12:55:07 access("/home/vinc17/.terminfo/x/xterm-debian", R_OK) = 0
2253  12:55:07 open("/home/vinc17/.terminfo/x/xterm-debian", O_RDONLY) = 3
2253  12:55:07 fstat(3, {st_mode=S_IFREG|0644, st_size=2075, ...}) = 0
2253  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f826b3b7000
2253  12:55:07 read(3, "\32\0017\0\35\0\17\0i\1\313\4xterm-debian|Debian "..., 
4096) = 2075
2253  12:55:07 read(3, "", 4096)        = 0
2253  12:55:07 close(3)                 = 0
2253  12:55:07 munmap(0x7f826b3b7000, 4096) = 0
2253  12:55:07 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:07 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:07 ioctl(1, TIOCGWINSZ, {ws_row=60, ws_col=80, ws_xpixel=493, 
ws_ypixel=784}) = 0
2253  12:55:07 ioctl(2, TIOCGWINSZ, {ws_row=60, ws_col=80, ws_xpixel=493, 
ws_ypixel=784}) = 0
2253  12:55:07 open("/usr/bin/.sysless", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/etc/sysless", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2253  12:55:07 open("/home/vinc17/.less", O_RDONLY) = -1 ENOENT (No such file 
or directory)
2253  12:55:07 open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
2253  12:55:07 fstat(3, {st_mode=S_IFREG|0644, st_size=110939968, ...}) = 0
2253  12:55:07 mmap(NULL, 110939968, PROT_READ, MAP_PRIVATE, 3, 0) = 
0x7f826421b000
2253  12:55:07 close(3)                 = 0
2253  12:55:07 open("/home/vinc17/.lesshst", O_RDONLY) = 3
2253  12:55:07 fstat(3, {st_mode=S_IFREG|0600, st_size=947, ...}) = 0
2253  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f826b3b7000
2253  12:55:07 read(3, ".less-history-file:\n.search\n\"app"..., 4096) = 947
2253  12:55:07 read(3, "", 4096)        = 0
2253  12:55:07 close(3)                 = 0
2253  12:55:07 munmap(0x7f826b3b7000, 4096) = 0
2253  12:55:07 open("/dev/tty", O_RDONLY) = 3
2253  12:55:07 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:07 fsync(3)                 = -1 EINVAL (Invalid argument)
2253  12:55:07 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:07 ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon 
-echo ...}) = 0
2253  12:55:07 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
-icanon -echo ...}) = 0
2253  12:55:07 rt_sigaction(SIGINT, {0x414bc0, [INT], SA_RESTORER|SA_RESTART, 
0x7f826ac1a4f0}, {SIG_DFL, [], 0}, 8) = 0
2253  12:55:07 rt_sigaction(SIGTSTP, {0x414b40, [TSTP], SA_RESTORER|SA_RESTART, 
0x7f826ac1a4f0}, {SIG_DFL, [], 0}, 8) = 0
2253  12:55:07 rt_sigaction(SIGWINCH, {0x414b80, [WINCH], 
SA_RESTORER|SA_RESTART, 0x7f826ac1a4f0}, {SIG_DFL, [], 0}, 8) = 0
2253  12:55:07 rt_sigaction(SIGQUIT, {SIG_IGN, [QUIT], SA_RESTORER|SA_RESTART, 
0x7f826ac1a4f0}, {SIG_DFL, [], 0}, 8) = 0
2253  12:55:07 pipe2([4, 5], O_CLOEXEC) = 0
2253  12:55:07 clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f826b3919d0) = 2254
2254  12:55:07 close(4 <unfinished ...>
2253  12:55:07 close(5 <unfinished ...>
2254  12:55:07 <... close resumed> )    = 0
2253  12:55:07 <... close resumed> )    = 0
2254  12:55:07 dup2(5, 1 <unfinished ...>
2253  12:55:07 fcntl(4, F_SETFD, 0 <unfinished ...>
2254  12:55:07 <... dup2 resumed> )     = 1
2253  12:55:07 <... fcntl resumed> )    = 0
2254  12:55:07 close(5 <unfinished ...>
2253  12:55:07 read(4,  <unfinished ...>
2254  12:55:07 <... close resumed> )    = 0
2254  12:55:07 execve("/bin/sh", ["sh", "-c", 
"/home/vinc17/wd/bugs/less-test-o"...], [/* 100 vars */]) = 0
2254  12:55:07 brk(0)                   = 0x2457000
2254  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2254  12:55:07 mmap(NULL, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9b8d5fc000
2254  12:55:07 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or 
directory)
2254  12:55:07 open("/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2254  12:55:07 stat("/lib64/tls/x86_64", 0x7fff18736830) = -1 ENOENT (No such 
file or directory)
2254  12:55:07 open("/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file 
or directory)
2254  12:55:07 stat("/lib64/tls", 0x7fff18736830) = -1 ENOENT (No such file or 
directory)
2254  12:55:07 open("/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such 
file or directory)
2254  12:55:07 stat("/lib64/x86_64", 0x7fff18736830) = -1 ENOENT (No such file 
or directory)
2254  12:55:07 open("/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2254  12:55:07 stat("/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2254  12:55:07 open("/home/vinc17/./lib/tls/x86_64/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
2254  12:55:07 stat("/home/vinc17/./lib/tls/x86_64", 0x7fff18736830) = -1 
ENOENT (No such file or directory)
2254  12:55:07 open("/home/vinc17/./lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT 
(No such file or directory)
2254  12:55:07 stat("/home/vinc17/./lib/tls", 0x7fff18736830) = -1 ENOENT (No 
such file or directory)
2254  12:55:07 open("/home/vinc17/./lib/x86_64/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
2254  12:55:07 stat("/home/vinc17/./lib/x86_64", 0x7fff18736830) = -1 ENOENT 
(No such file or directory)
2254  12:55:07 open("/home/vinc17/./lib/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2254  12:55:07 stat("/home/vinc17/./lib", {st_mode=S_IFDIR|0755, st_size=4096, 
...}) = 0
2254  12:55:07 open("/etc/ld.so.cache", O_RDONLY) = 4
2254  12:55:07 fstat(4, {st_mode=S_IFREG|0644, st_size=148038, ...}) = 0
2254  12:55:07 mmap(NULL, 148038, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f9b8d5d7000
2254  12:55:07 close(4)                 = 0
2254  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2254  12:55:07 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 4
2254  12:55:07 read(4, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 
832
2254  12:55:07 fstat(4, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0
2254  12:55:07 mmap(NULL, 3709016, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7f9b8d055000
2254  12:55:07 mprotect(0x7f9b8d1d5000, 2097152, PROT_NONE) = 0
2254  12:55:07 mmap(0x7f9b8d3d5000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x180000) = 0x7f9b8d3d5000
2254  12:55:07 mmap(0x7f9b8d3da000, 18520, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f9b8d3da000
2254  12:55:07 close(4)                 = 0
2254  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9b8d5d6000
2254  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9b8d5d5000
2254  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9b8d5d4000
2254  12:55:07 arch_prctl(ARCH_SET_FS, 0x7f9b8d5d5700) = 0
2254  12:55:07 mprotect(0x7f9b8d3d5000, 16384, PROT_READ) = 0
2254  12:55:07 mprotect(0x7f9b8d5fe000, 4096, PROT_READ) = 0
2254  12:55:07 munmap(0x7f9b8d5d7000, 148038) = 0
2254  12:55:07 getpid()                 = 2254
2254  12:55:07 rt_sigaction(SIGCHLD, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 
0x7f9b8d0874f0}, NULL, 8) = 0
2254  12:55:07 geteuid()                = 1000
2254  12:55:07 brk(0)                   = 0x2457000
2254  12:55:07 brk(0x2478000)           = 0x2478000
2254  12:55:07 getppid()                = 2253
2254  12:55:07 stat("/home/vinc17/wd/bugs", {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
2254  12:55:07 stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2254  12:55:07 rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
2254  12:55:07 rt_sigaction(SIGINT, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 
0x7f9b8d0874f0}, NULL, 8) = 0
2254  12:55:07 rt_sigaction(SIGQUIT, NULL, {SIG_IGN, [], 0}, 8) = 0
2254  12:55:07 rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
2254  12:55:07 rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 
0x7f9b8d0874f0}, NULL, 8) = 0
2254  12:55:07 clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f9b8d5d59d0) = 2255
2255  12:55:07 execve("/home/vinc17/wd/bugs/less-test-open.sh", 
["/home/vinc17/wd/bugs/less-test-o"..., "less-test-file"], [/* 100 vars */] 
<unfinished ...>
2254  12:55:07 wait4(-1,  <unfinished ...>
2255  12:55:07 <... execve resumed> )   = 0
2255  12:55:07 brk(0)                   = 0x149d000
2255  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2255  12:55:07 mmap(NULL, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f11651af000
2255  12:55:07 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or 
directory)
2255  12:55:07 open("/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2255  12:55:07 stat("/lib64/tls/x86_64", 0x7fff8b6d2b00) = -1 ENOENT (No such 
file or directory)
2255  12:55:07 open("/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file 
or directory)
2255  12:55:07 stat("/lib64/tls", 0x7fff8b6d2b00) = -1 ENOENT (No such file or 
directory)
2255  12:55:07 open("/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such 
file or directory)
2255  12:55:07 stat("/lib64/x86_64", 0x7fff8b6d2b00) = -1 ENOENT (No such file 
or directory)
2255  12:55:07 open("/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2255  12:55:07 stat("/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2255  12:55:07 open("/home/vinc17/./lib/tls/x86_64/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
2255  12:55:07 stat("/home/vinc17/./lib/tls/x86_64", 0x7fff8b6d2b00) = -1 
ENOENT (No such file or directory)
2255  12:55:07 open("/home/vinc17/./lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT 
(No such file or directory)
2255  12:55:07 stat("/home/vinc17/./lib/tls", 0x7fff8b6d2b00) = -1 ENOENT (No 
such file or directory)
2255  12:55:07 open("/home/vinc17/./lib/x86_64/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
2255  12:55:07 stat("/home/vinc17/./lib/x86_64", 0x7fff8b6d2b00) = -1 ENOENT 
(No such file or directory)
2255  12:55:07 open("/home/vinc17/./lib/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2255  12:55:07 stat("/home/vinc17/./lib", {st_mode=S_IFDIR|0755, st_size=4096, 
...}) = 0
2255  12:55:07 open("/etc/ld.so.cache", O_RDONLY) = 4
2255  12:55:07 fstat(4, {st_mode=S_IFREG|0644, st_size=148038, ...}) = 0
2255  12:55:07 mmap(NULL, 148038, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f116518a000
2255  12:55:07 close(4)                 = 0
2255  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2255  12:55:07 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 4
2255  12:55:07 read(4, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 
832
2255  12:55:07 fstat(4, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0
2255  12:55:07 mmap(NULL, 3709016, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7f1164c08000
2255  12:55:07 mprotect(0x7f1164d88000, 2097152, PROT_NONE) = 0
2255  12:55:07 mmap(0x7f1164f88000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x180000) = 0x7f1164f88000
2255  12:55:07 mmap(0x7f1164f8d000, 18520, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1164f8d000
2255  12:55:07 close(4)                 = 0
2255  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1165189000
2255  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1165188000
2255  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1165187000
2255  12:55:07 arch_prctl(ARCH_SET_FS, 0x7f1165188700) = 0
2255  12:55:07 mprotect(0x7f1164f88000, 16384, PROT_READ) = 0
2255  12:55:07 mprotect(0x7f11651b1000, 4096, PROT_READ) = 0
2255  12:55:07 munmap(0x7f116518a000, 148038) = 0
2255  12:55:07 getpid()                 = 2255
2255  12:55:07 rt_sigaction(SIGCHLD, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 
0x7f1164c3a4f0}, NULL, 8) = 0
2255  12:55:07 geteuid()                = 1000
2255  12:55:07 brk(0)                   = 0x149d000
2255  12:55:07 brk(0x14be000)           = 0x14be000
2255  12:55:07 getppid()                = 2254
2255  12:55:07 stat("/home/vinc17/wd/bugs", {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
2255  12:55:07 stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2255  12:55:07 open("/home/vinc17/wd/bugs/less-test-open.sh", O_RDONLY) = 4
2255  12:55:07 fcntl(4, F_DUPFD, 10)    = 10
2255  12:55:07 close(4)                 = 0
2255  12:55:07 fcntl(10, F_SETFD, FD_CLOEXEC) = 0
2255  12:55:07 rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
2255  12:55:07 rt_sigaction(SIGINT, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 
0x7f1164c3a4f0}, NULL, 8) = 0
2255  12:55:07 rt_sigaction(SIGQUIT, NULL, {SIG_IGN, [], 0}, 8) = 0
2255  12:55:07 rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
2255  12:55:07 rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 
0x7f1164c3a4f0}, NULL, 8) = 0
2255  12:55:07 read(10, "#!/bin/sh\ncat \"$@\"\n", 8192) = 19
2255  12:55:07 stat("/home/vinc17/eftests/bin/cat", 0x7fff8b6d30d0) = -1 ENOENT 
(No such file or directory)
2255  12:55:07 stat("/home/vinc17/bin/cat", 0x7fff8b6d30d0) = -1 ENOENT (No 
such file or directory)
2255  12:55:07 stat("/home/vinc17/./bin/cat", 0x7fff8b6d30d0) = -1 ENOENT (No 
such file or directory)
2255  12:55:07 stat("/home/vinc17/perl5/bin/cat", 0x7fff8b6d30d0) = -1 ENOENT 
(No such file or directory)
2255  12:55:07 stat("/usr/local/bin/cat", 0x7fff8b6d30d0) = -1 ENOENT (No such 
file or directory)
2255  12:55:07 stat("/usr/bin/cat", 0x7fff8b6d30d0) = -1 ENOENT (No such file 
or directory)
2255  12:55:07 stat("/bin/cat", {st_mode=S_IFREG|0755, st_size=51856, ...}) = 0
2255  12:55:07 clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f11651889d0) = 2256
2256  12:55:07 close(10)                = 0
2255  12:55:07 wait4(-1,  <unfinished ...>
2256  12:55:07 execve("/bin/cat", ["cat", "less-test-file"], [/* 100 vars */]) 
= 0
2256  12:55:07 brk(0)                   = 0xe20000
2256  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2256  12:55:07 mmap(NULL, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1e5297000
2256  12:55:07 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or 
directory)
2256  12:55:07 open("/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2256  12:55:07 stat("/lib64/tls/x86_64", 0x7fffeb325000) = -1 ENOENT (No such 
file or directory)
2256  12:55:07 open("/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file 
or directory)
2256  12:55:07 stat("/lib64/tls", 0x7fffeb325000) = -1 ENOENT (No such file or 
directory)
2256  12:55:07 open("/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such 
file or directory)
2256  12:55:07 stat("/lib64/x86_64", 0x7fffeb325000) = -1 ENOENT (No such file 
or directory)
2256  12:55:07 open("/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2256  12:55:07 stat("/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2256  12:55:07 open("/home/vinc17/./lib/tls/x86_64/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
2256  12:55:07 stat("/home/vinc17/./lib/tls/x86_64", 0x7fffeb325000) = -1 
ENOENT (No such file or directory)
2256  12:55:07 open("/home/vinc17/./lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT 
(No such file or directory)
2256  12:55:07 stat("/home/vinc17/./lib/tls", 0x7fffeb325000) = -1 ENOENT (No 
such file or directory)
2256  12:55:07 open("/home/vinc17/./lib/x86_64/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
2256  12:55:07 stat("/home/vinc17/./lib/x86_64", 0x7fffeb325000) = -1 ENOENT 
(No such file or directory)
2256  12:55:07 open("/home/vinc17/./lib/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
2256  12:55:07 stat("/home/vinc17/./lib", {st_mode=S_IFDIR|0755, st_size=4096, 
...}) = 0
2256  12:55:07 open("/etc/ld.so.cache", O_RDONLY) = 4
2256  12:55:07 fstat(4, {st_mode=S_IFREG|0644, st_size=148038, ...}) = 0
2256  12:55:07 mmap(NULL, 148038, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7ff1e5272000
2256  12:55:07 close(4)                 = 0
2256  12:55:07 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
2256  12:55:07 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 4
2256  12:55:07 read(4, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 
832
2256  12:55:07 fstat(4, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0
2256  12:55:07 mmap(NULL, 3709016, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7ff1e4cf0000
2256  12:55:07 mprotect(0x7ff1e4e70000, 2097152, PROT_NONE) = 0
2256  12:55:07 mmap(0x7ff1e5070000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x180000) = 0x7ff1e5070000
2256  12:55:07 mmap(0x7ff1e5075000, 18520, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff1e5075000
2256  12:55:07 close(4)                 = 0
2256  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1e5271000
2256  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1e5270000
2256  12:55:07 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1e526f000
2256  12:55:07 arch_prctl(ARCH_SET_FS, 0x7ff1e5270700) = 0
2256  12:55:07 mprotect(0x7ff1e5070000, 16384, PROT_READ) = 0
2256  12:55:07 mprotect(0x60b000, 4096, PROT_READ) = 0
2256  12:55:07 mprotect(0x7ff1e5299000, 4096, PROT_READ) = 0
2256  12:55:07 munmap(0x7ff1e5272000, 148038) = 0
2256  12:55:07 open("/usr/lib/locale/locale-archive", O_RDONLY) = 4
2256  12:55:07 fstat(4, {st_mode=S_IFREG|0644, st_size=110939968, ...}) = 0
2256  12:55:07 mmap(NULL, 110939968, PROT_READ, MAP_PRIVATE, 4, 0) = 
0x7ff1de323000
2256  12:55:07 close(4)                 = 0
2256  12:55:07 brk(0)                   = 0xe20000
2256  12:55:07 brk(0xe41000)            = 0xe41000
2256  12:55:07 fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
2256  12:55:07 open("less-test-file", O_RDONLY) = 4
2256  12:55:07 fstat(4, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
2256  12:55:07 fadvise64(4, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
2256  12:55:07 read(4, "blah\n", 32768) = 5
2256  12:55:07 write(1, "blah\n", 5)    = 5
2253  12:55:07 <... read resumed> "b", 1) = 1
2256  12:55:07 read(4, "", 32768)       = 0
2253  12:55:07 stat("-",  <unfinished ...>
2256  12:55:07 close(4 <unfinished ...>
2253  12:55:07 <... stat resumed> 0x7fff9d73b3e0) = -1 ENOENT (No such file or 
directory)
2256  12:55:07 <... close resumed> )    = 0
2253  12:55:07 write(1, "\33[?1049h\33[?1h\33=\r", 16 <unfinished ...>
2256  12:55:07 close(1)                 = 0
2253  12:55:07 <... write resumed> )    = 16
2256  12:55:07 close(2 <unfinished ...>
2253  12:55:07 read(4,  <unfinished ...>
2256  12:55:07 <... close resumed> )    = 0
2253  12:55:07 <... read resumed> "lah\n", 8191) = 4
2256  12:55:07 exit_group(0)            = ?
2253  12:55:07 write(1, "blah\n", 5)    = 5
2253  12:55:07 read(4,  <unfinished ...>
2255  12:55:07 <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, 
NULL) = 2256
2255  12:55:07 --- SIGCHLD (Child exited) @ 0 (0) ---
2255  12:55:07 rt_sigreturn(0x11)       = 2256
2255  12:55:07 read(10, "", 8192)       = 0
2255  12:55:07 exit_group(0)            = ?
2254  12:55:07 <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, 
NULL) = 2255
2254  12:55:07 --- SIGCHLD (Child exited) @ 0 (0) ---
2254  12:55:07 rt_sigreturn(0x11)       = 2255
2254  12:55:07 exit_group(0)            = ?
2253  12:55:07 <... read resumed> "", 8187) = 0
2253  12:55:07 --- SIGCHLD (Child exited) @ 0 (0) ---
2253  12:55:07 write(1, "\33[7mless-test-file (END)\33[27m\33[K", 32) = 32
2253  12:55:07 read(3, "q", 1)          = 1
2253  12:55:11 close(4)                 = 0
2253  12:55:11 wait4(2254, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 
2254
2253  12:55:11 write(1, "\r\33[K\33[?1l\33>\33[?1049l", 19) = 19
2253  12:55:11 fsync(3)                 = -1 EINVAL (Invalid argument)
2253  12:55:11 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
-icanon -echo ...}) = 0
2253  12:55:11 ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon 
echo ...}) = 0
2253  12:55:11 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
2253  12:55:11 exit_group(0)            = ?

The problem is that the wait4 from process 2253 (less) is too late.

> Less creates the LESSOPEN process with popen and in all normal exit
> cases, less calls pclose at exit.  Is it possible there is a bug in
> pclose on the system you're testing?

If the child process has terminated earlier, less should call pclose
just after (in order to avoid the zombie until less is quit), not at
exit.

-- 
Vincent Lefèvre <[email protected]> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to