[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#502311: testsuite failures in glibc



Aurelien Jarno wrote:
> Those two failures are due to the behavior of dash versus bash. The test
> tries to test that system() is cancellable. system() invokes /bin/sh 
> (and this is hard-coded, not changeable via any environment variable). 
> When doing /bin/bash -c "/bin/echo foo", bash is clever enough to invoke
> /bin/echo with execve() without forking. When system() kills the
> subprocess, it kills the intended subprocess. But dash forks a further
> subprocess and waits, so system() just kills dash, not dash's
> subprocess.
> 
> I don't know what is the best way (if there is a way) to fix this
> problem with dash.

I tried four commands in a shell:
A: bash -c "/bin/sleep 15"
B: dash -c "/bin/sleep 15"
C: bash -c "exec /bin/sleep 15"
D: dash -c "exec /bin/sleep 15"

In an other shell, while these commands where running, I run:
"ps axf | grep -B 3 sleep"

For A, C, and D, I got something similar (pid changed) to:
14277 pts/5    Ss     0:00  \_ bash
14573 pts/5    S+     0:00  |   \_ /bin/sleep 15
For B, I got:
14277 pts/5    Ss     0:00  \_ bash
14540 pts/5    S+     0:00  |   \_ dash -c /bin/sleep 15
14541 pts/5    S+     0:00  |       \_ /bin/sleep 15

So, perhaps using   /bin/bash -c "exec /bin/echo foo"   will solve your
problem

  Regards,
    Vincent

-- 
Vincent Danjean       GPG key ID 0x9D025E87         vdanjean@debian.org
GPG key fingerprint: FC95 08A6 854D DB48 4B9A  8A94 0BF7 7867 9D02 5E87
Unofficial pacakges: http://www-id.imag.fr/~danjean/deb.html#package
APT repo:  deb http://perso.debian.org/~vdanjean/debian unstable main




Reply to: