[PATCH] debug/tst-longjmp_chk2: Make signal handler more conservative [BZ #20248]

Carlos O'Donell carlos@redhat.com
Mon Jun 13 14:33:00 GMT 2016


On 06/13/2016 07:11 AM, Florian Weimer wrote:
> Currently, printf needs more stack space than what is available with
> SIGSTKSZ.  This commit use the the write system call directly instead.
> 
> Also use sig_atomic_t for the “pass” variable (for general
> correctness), and restore signal handlers to their defaults, to avoid
> masking crashes.
> 
> 2016-06-13  Florian Weimer  <fweimer@redhat.com>
> 
> 	[BZ #20248]
> 	* debug/tst-longjmp_chk2.c (pass): Use volatile sig_atomic_t.
> 	(write_message): New function.
> 	(stackoverflow_handler): Call it instead of printf, to avoid
> 	excessive stack usage by printf.
> 	(do_test): Restore SIGSEGV, SIGBUS default handlers.

Looks good to me.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list