@@ -45,6 +45,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
typedef RETSIGTYPE (*sighandler_t) (int);
#endif
+#define SIG_STACK_SIZE 0x100000
+
int verbose;
int num_errors;
@@ -226,10 +228,10 @@ main (int argc, char **argv)
if (verbose)
printf ("\nBacktrace across signal handler on alternate stack:\n");
- stk.ss_sp = malloc (SIGSTKSZ);
+ stk.ss_sp = malloc (SIG_STACK_SIZE);
if (!stk.ss_sp)
- panic ("failed to allocate SIGSTKSZ (%u) bytes\n", SIGSTKSZ);
- stk.ss_size = SIGSTKSZ;
+ panic ("failed to allocate %u bytes\n", SIG_STACK_SIZE);
+ stk.ss_size = SIG_STACK_SIZE;
stk.ss_flags = 0;
if (sigaltstack (&stk, NULL) < 0)
panic ("sigaltstack: %s\n", strerror (errno));
@@ -44,6 +44,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
typedef RETSIGTYPE (*sighandler_t) (int);
#endif
+#define SIG_STACK_SIZE 0x100000
+
int verbose;
int num_errors;
@@ -240,10 +242,10 @@ main (int argc, char **argv)
if (verbose)
printf ("\nBacktrace across signal handler on alternate stack:\n");
- stk.ss_sp = malloc (SIGSTKSZ);
+ stk.ss_sp = malloc (SIG_STACK_SIZE);
if (!stk.ss_sp)
- panic ("failed to allocate SIGSTKSZ (%u) bytes\n", SIGSTKSZ);
- stk.ss_size = SIGSTKSZ;
+ panic ("failed to allocate %u bytes\n", SIG_STACK_SIZE);
+ stk.ss_size = SIG_STACK_SIZE;
stk.ss_flags = 0;
if (sigaltstack (&stk, NULL) < 0)
panic ("sigaltstack: %s\n", strerror (errno));
Creating an alternate signal stack with a size of SIGSTKSZ (usually 8k) is not enough on some targets because unw_cursor_t is bigger than that already. Since the size of unw_cursor_t is part of the ABI the UNW_TDEP_CURSOR_LEN can't be changed without breaking existent code. Therefore size of the alternate signal stack has been increased to 1 MiB. Signed-off-by: Ken Werner <ken.werner@linaro.org> --- tests/Gtest-bt.c | 8 +++++--- tests/Gtest-trace.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-)