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: David Miller <davem@davemloft.net>
Date: Thu, 25 Oct 2012 16:50:28 -0400 (EDT)

> 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.

For reference, this is the dash fix:

http://git.kernel.org/?p=utils/dash/dash.git;a=commitdiff;h=ee5cbe9fd6bc02f31b4d955606288de36c3d4eab

Then debian, objected to updating to the latest dash code and thus
getting the fix, because it includes LINENO support and this breaks
some scripts that use LINENO presence to detect if they can do "bash
stuff"

So, trying to avoid this bug fix propagating forever, I added a
configuration option to dash to elide this support:

http://git.kernel.org/?p=utils/dash/dash.git;a=commitdiff;h=4da0e221ba2244921862d46cdeefbc8ab5808eed

But things are still stuck in red tape and still the debian folks,
for whatever reason, haven't updated their dash package.

This is a major debian problem, do not try to fix it in glibc.


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