posix: Add SIGSEGV on the trap list for globtest.sh
Commit Message
This patch prevents lingering files for SIGSEGV failutes. Checked
on x86_64.
* posix/globtest.sh: Add SIGSEGV for the signal to act on a trap.
---
ChangeLog | 4 ++++
posix/globtest.sh | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
Comments
On 04/11/2017 08:09 PM, Adhemerval Zanella wrote:
> -trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
> +trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' HUP INT QUIT SEGV TERM
Does the shell really receive the signal? Why not use “0”?
Thanks,
Florian
On 11/04/2017 15:22, Florian Weimer wrote:
> On 04/11/2017 08:09 PM, Adhemerval Zanella wrote:
>> -trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
>> +trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' HUP INT QUIT SEGV TERM
>
> Does the shell really receive the signal? Why not use “0”?
It does not off course since it is not the shell that is actually generating
the segfault. I will rewrite the patch.
>
> Thanks,
> Florian
On 04/11/2017 09:59 PM, Adhemerval Zanella wrote:
>
>
> On 11/04/2017 15:22, Florian Weimer wrote:
>> On 04/11/2017 08:09 PM, Adhemerval Zanella wrote:
>>> -trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
>>> +trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' HUP INT QUIT SEGV TERM
>>
>> Does the shell really receive the signal? Why not use “0”?
>
> It does not off course since it is not the shell that is actually generating
> the segfault.
Well, the shell uses globbing, too, so who knows. :)
> I will rewrite the patch.
Thanks. Using 0 is probably the correct choice, then.
Florian
@@ -47,7 +47,7 @@ testout=${common_objpfx}posix/globtest-out
rm -rf $testdir $testout
mkdir $testdir
-trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
+trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' HUP INT QUIT SEGV TERM
echo 1 > $testdir/file1
echo 2 > $testdir/file2