This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix nptl/tst-cancel7 for non-bash shells
- From: David Miller <davem at davemloft dot net>
- To: joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 25 Oct 2012 16:50:28 -0400 (EDT)
- Subject: Re: Fix nptl/tst-cancel7 for non-bash shells
- References: <Pine.LNX.4.64.1210252047250.30538@digraph.polyomino.org.uk>
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Thu, 25 Oct 2012 20:48:33 +0000
> This patch, again something that was entangled in the first version of
> the cross-testing changes I sent but then separated out because it
> didn't belong there, fixes an issue with nptl/tst-cancel7 when /bin/sh
> isn't bash. To quote Aurelien's explanation from 2009:
>
> tst-cancel7 tests 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 it kills the intended subprocess. But dash forks
> a further subprocess and waits, so system() just kills dash, not
> dash's subprocess. Prefixing the command with "exec" ensure that the
> used shell does not fork.
>
> Tested x86_64.
This is a bad change.
If you see this problem under debian, it's a bug in dash which has
been fixed for years, but debian simply hasn't merged in the fix yet.
Do not merge this patch, it's wrong.