From patchwork Mon Apr 4 14:11:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Werner X-Patchwork-Id: 893 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:47:08 -0000 Delivered-To: patches@linaro.org Received: by 10.68.42.132 with SMTP id o4cs28035pbl; Mon, 4 Apr 2011 07:11:20 -0700 (PDT) Received: by 10.227.153.71 with SMTP id j7mr7500028wbw.86.1301926277819; Mon, 04 Apr 2011 07:11:17 -0700 (PDT) Received: from mtagate1.uk.ibm.com (mtagate1.uk.ibm.com [194.196.100.161]) by mx.google.com with ESMTPS id u16si10126765wbd.59.2011.04.04.07.11.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Apr 2011 07:11:17 -0700 (PDT) Received-SPF: neutral (google.com: 194.196.100.161 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) client-ip=194.196.100.161; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.196.100.161 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) smtp.mail=ken.werner@linaro.org Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p34EBGXl011136 for ; Mon, 4 Apr 2011 14:11:16 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p34EBuvH1843328 for ; Mon, 4 Apr 2011 15:11:56 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p34EBFiK024235 for ; Mon, 4 Apr 2011 08:11:15 -0600 Received: from localhost.localdomain (dyn-9-152-224-51.boeblingen.de.ibm.com [9.152.224.51]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p34EBFOK024193; Mon, 4 Apr 2011 08:11:15 -0600 From: Ken Werner To: libunwind-devel@nongnu.org Subject: [PATCH 2/3] Increase alternate signal stack size. Date: Mon, 4 Apr 2011 16:11:03 +0200 Message-Id: <1301926264-13393-3-git-send-email-ken.werner@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1301926264-13393-1-git-send-email-ken.werner@linaro.org> References: <1301926264-13393-1-git-send-email-ken.werner@linaro.org> 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 --- tests/Gtest-bt.c | 8 +++++--- tests/Gtest-trace.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c index 152e2af..1a40496 100644 --- a/tests/Gtest-bt.c +++ b/tests/Gtest-bt.c @@ -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)); diff --git a/tests/Gtest-trace.c b/tests/Gtest-trace.c index 1e966b2..311848f 100644 --- a/tests/Gtest-trace.c +++ b/tests/Gtest-trace.c @@ -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));