]> git.ozlabs.org Git - ccan/commit
altstack: Increase signal stack size
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 15 Feb 2016 11:01:18 +0000 (22:01 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 15 Feb 2016 11:01:18 +0000 (22:01 +1100)
commita4e6f6cb0cf28d30173f340c2ae8790776914529
tree96adce79bf042d9e0a14f97ef838e0d806f7be42
parent141e582ead507103a5f8860a3ec8c0f237d2690a
altstack: Increase signal stack size

At present the altstack module uses a stack of size MINSIGSTKSZ for its
SIGSEGV handler.  Although MINSIGSTKSZ is defined to be large enough to
execute a signal handler, it doesn't guarantee that you can do anything
very much within it.

With certain libc versions, MINSIGSTKSZ is not enough to execute the
longjmp() used in altstack.  Specfically, with Ubuntu 12.04 (the default
install for Travis containers), the first time longjmp() is executed the
symbol must be resolved by the dynamic linker in a process which overruns
the MINSIGSTKSZ sized stack.  That then corrupts local variables in
altstack() itself causing a number of subsequent failures.

This patch addresses the problem by changing from MINSIGSTKSZ to SIGSTKSZ
which is supposed to cover "the usual requirements for an alternate signal
stack".

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/altstack/altstack.c