Bug#502311: testsuite failures in glibc
On Thu, Feb 19, 2009 at 07:15:53PM +0100, Vincent Danjean wrote:
> 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
>
Great, that works. Thanks a lot.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
Reply to: