This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix nptl/tst-cancel7 for non-bash shells


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]