summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-06-15 10:51:37 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-06-22 22:22:51 +0000
commit741a7aef585b07f3510dc5566b390c6124640e65 (patch)
tree2accd0f6666b2b9119da411ffee4b9271d0e50ba /src/testlib
parent706af26acc5deeeab17ac135daa23876a69c78dc (diff)
QtTest: Increase the size of the alternate stack
The default (8kB) isn't enough for modern Linux on x86-64. I can't exactly account for it, as the size of the xsave area is 0x340 bytes, plus the regular area it's still less than ~1.5 kB. But empirically we can see that 8kB causes a SIGSEGV when a signal is delivered, while 16 kB works. Since we're increasing the size, let's make sure it ends up in a separate page from the rest of the .bss data. Change-Id: I5d1e6f7607404caa96e4ffff13e84c87c33723c7 Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 453288ee82..c96b72bef7 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2453,7 +2453,12 @@ FatalSignalHandler::FatalSignalHandler()
#ifdef SA_ONSTACK
// Let the signal handlers use an alternate stack
// This is necessary if SIGSEGV is to catch a stack overflow
- static char alternate_stack[SIGSTKSZ];
+# if defined(Q_CC_GNU) && defined(Q_OF_ELF)
+ // Put the alternate stack in the .lbss (large BSS) section so that it doesn't
+ // interfere with normal .bss symbols
+ __attribute__((section(".lbss.altstack"), aligned(4096)))
+# endif
+ static char alternate_stack[16 * 1024];
stack_t stack;
stack.ss_flags = 0;
stack.ss_size = sizeof alternate_stack;