1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-26 03:11:44 +02:00

Increase alternate signal stack size.

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>
This commit is contained in:
Ken Werner 2011-04-01 18:42:20 +02:00 committed by Arun Sharma
parent fd21d07fe4
commit e4593e2493
2 changed files with 10 additions and 6 deletions

View file

@ -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));

View file

@ -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));