* SIGSTKSZ/MINSIGSTKSZ too small on 64bit
@ 2013-07-26 2:23 Anton Blanchard
2013-07-26 5:05 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2013-07-26 2:23 UTC (permalink / raw)
To: Michael Neuling, Alan Modra, Ryan Arnold; +Cc: linuxppc-dev
Hi,
Alan has been looking at a glibc test fail. His analysis shows SEGVs
in signal handlers using sigaltstack, and that MINSIGSTKSZ and SIGSTKSZ
are too small.
We increased the size of rt_sigframe in commit 2b0a576d15e0
(powerpc: Add new transactional memory state to the signal context) but
didn't bump either SIGSTKSZ and MINSIGSTKSZ. We need to do that in both
the kernel and glibc, but I'm a bit worried we could have broken
existing applications that use sigaltstack.
Anton
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SIGSTKSZ/MINSIGSTKSZ too small on 64bit
2013-07-26 2:23 SIGSTKSZ/MINSIGSTKSZ too small on 64bit Anton Blanchard
@ 2013-07-26 5:05 ` Alan Modra
2013-07-26 21:31 ` Ryan Arnold
0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2013-07-26 5:05 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Michael Neuling, linuxppc-dev, Ryan Arnold
On Fri, Jul 26, 2013 at 12:23:25PM +1000, Anton Blanchard wrote:
>
> Hi,
>
> Alan has been looking at a glibc test fail. His analysis shows SEGVs
> in signal handlers using sigaltstack, and that MINSIGSTKSZ and SIGSTKSZ
> are too small.
>
> We increased the size of rt_sigframe in commit 2b0a576d15e0
> (powerpc: Add new transactional memory state to the signal context) but
> didn't bump either SIGSTKSZ and MINSIGSTKSZ. We need to do that in both
> the kernel and glibc, but I'm a bit worried we could have broken
> existing applications that use sigaltstack.
Before VSX changes, struct rt_sigframe size was 1920 plus 128 for
__SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of
2048.
After VSX, ucontext increased by 256 bytes. Oops, we're over
MINSIGSTKSZ. Add another ucontext for TM and rt_sigframe is now at
3872, giving actual MINSIGSTKSZ of 4000.
The glibc testcase that I was looking at was tst-cancel21, which
allocates 2*SIGSTKSZ (not because the test is trying to be
conservative, but because the test actually has nested signal stack
frames). We blew the allocation by 48 bytes when using current
mainline gcc to compile glibc (le ppc64).
The required stack depth in _dl_lookup_symbol_x from the top of the
next signal frame was 10944 bytes. I guess you'd want to add 288 to
that, implying an actual SIGSTKSZ of 11232.
I think we want
#define MINSIGSTKSZ 4096
#define SIGSTKSZ 16384
frame size r1
#0 0x00000000295cdaec in _dl_lookup_symbol_x(memset) 190
#1 0x00000000295d3c4c in _dl_fixup() b0 10003310160
#2 0x00000000295dc818 in _dl_runtime_resolve() b0 10003310210
#3 0x00001fffff59ea8c in uw_init_context_1() a30 100033102c0
#4 0x00001fffff59f560 in libc:_Unwind_ForcedUnwind() c90 10003310cf0
#5 0x00001ffffffb9538 in pt:_Unwind_ForcedUnwind() 90 10003311980
#6 0x00001ffffffb6418 in __pthread_unwind() 70 10003311a10
#7 0x00001ffffffaaeb0 in sigcancel_handler() 70 10003311a80
#8 <signal handler called> 1ffffffe0448 tramp fa0 10003311af0
10003311b70 rt_sigframe
10003311c58 sigcontext.gp_regs
10003311dd8 sigcontext.fp_regs
10003311ee0 sigcontext.v_regs
10003311ef0 sigcontext.vmx
100033128d8 rt_sigframe.pinfo offset d68
10003312968 rt_sigframe.abigap
10003312a88 end + 8 alignment
#9 0x00001ffffffb6f9c in 80 10003312a90
#10 0x00001ffffffb6f84 in 10003312b10
#11 0x00000000100020f4 in delete_temp_files() 80 10003312dc0
#12 0x0000000010002198 in 10003313070
#13 <signal handler called>
#14 0x00001ffffffb6f9c in ?? ()
#15 0x00001ffffffb6f84 in ?? ()
#16 0x0000000010002274 in ?? ()
#17 0x0000000010002430 in ?? ()
#18 0x0000000010002644 in ?? ()
#19 0x0000000010001a1c in ?? ()
#20 0x00001fffffe17f0c in ?? ()
#21 0x00001fffffe18134 in ?? ()
#22 0x0000000000000000 in ?? ()
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SIGSTKSZ/MINSIGSTKSZ too small on 64bit
2013-07-26 5:05 ` Alan Modra
@ 2013-07-26 21:31 ` Ryan Arnold
2013-07-27 1:19 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Ryan Arnold @ 2013-07-26 21:31 UTC (permalink / raw)
To: Alan Modra; +Cc: Michael Neuling, azanella, linuxppc-dev, Anton Blanchard, rsa
[-- Attachment #1: Type: text/plain, Size: 3767 bytes --]
Alan Modra <amodra@gmail.com> wrote on 07/26/2013 12:05:28 AM:
> Alan Modra <amodra@gmail.com>
> 07/26/2013 12:05 AM
>
> To
>
> Anton Blanchard <anton@samba.org>,
>
> cc
>
> Michael Neuling <mikey@neuling.org>, Ryan Arnold/Rochester/
> IBM@IBMUS, linuxppc-dev@lists.ozlabs.org
>
> Subject
>
> Re: SIGSTKSZ/MINSIGSTKSZ too small on 64bit
>
> On Fri, Jul 26, 2013 at 12:23:25PM +1000, Anton Blanchard wrote:
> >
> > Hi,
> >
> > Alan has been looking at a glibc test fail. His analysis shows SEGVs
> > in signal handlers using sigaltstack, and that MINSIGSTKSZ and SIGSTKSZ
> > are too small.
> >
> > We increased the size of rt_sigframe in commit 2b0a576d15e0
> > (powerpc: Add new transactional memory state to the signal context) but
> > didn't bump either SIGSTKSZ and MINSIGSTKSZ. We need to do that in both
> > the kernel and glibc, but I'm a bit worried we could have broken
> > existing applications that use sigaltstack.
>
> Before VSX changes, struct rt_sigframe size was 1920 plus 128 for
> __SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of
> 2048.
>
> After VSX, ucontext increased by 256 bytes. Oops, we're over
> MINSIGSTKSZ. Add another ucontext for TM and rt_sigframe is now at
> 3872, giving actual MINSIGSTKSZ of 4000.
>
> The glibc testcase that I was looking at was tst-cancel21, which
> allocates 2*SIGSTKSZ (not because the test is trying to be
> conservative, but because the test actually has nested signal stack
> frames). We blew the allocation by 48 bytes when using current
> mainline gcc to compile glibc (le ppc64).
>
> The required stack depth in _dl_lookup_symbol_x from the top of the
> next signal frame was 10944 bytes. I guess you'd want to add 288 to
> that, implying an actual SIGSTKSZ of 11232.
>
> I think we want
> #define MINSIGSTKSZ 4096
> #define SIGSTKSZ 16384
>
> frame size r1
> #0 0x00000000295cdaec in _dl_lookup_symbol_x(memset) 190
> #1 0x00000000295d3c4c in _dl_fixup() b0 10003310160
> #2 0x00000000295dc818 in _dl_runtime_resolve() b0 10003310210
> #3 0x00001fffff59ea8c in uw_init_context_1() a30 100033102c0
> #4 0x00001fffff59f560 in libc:_Unwind_ForcedUnwind() c90 10003310cf0
> #5 0x00001ffffffb9538 in pt:_Unwind_ForcedUnwind() 90 10003311980
> #6 0x00001ffffffb6418 in __pthread_unwind() 70 10003311a10
> #7 0x00001ffffffaaeb0 in sigcancel_handler() 70 10003311a80
> #8 <signal handler called> 1ffffffe0448 tramp fa0 10003311af0
> 10003311b70 rt_sigframe
> 10003311c58 sigcontext.gp_regs
> 10003311dd8 sigcontext.fp_regs
> 10003311ee0 sigcontext.v_regs
> 10003311ef0 sigcontext.vmx
> 100033128d8 rt_sigframe.pinfo offset d68
> 10003312968 rt_sigframe.abigap
> 10003312a88 end + 8 alignment
> #9 0x00001ffffffb6f9c in 80 10003312a90
> #10 0x00001ffffffb6f84 in 10003312b10
> #11 0x00000000100020f4 in delete_temp_files() 80 10003312dc0
> #12 0x0000000010002198 in 10003313070
> #13 <signal handler called>
> #14 0x00001ffffffb6f9c in ?? ()
> #15 0x00001ffffffb6f84 in ?? ()
> #16 0x0000000010002274 in ?? ()
> #17 0x0000000010002430 in ?? ()
> #18 0x0000000010002644 in ?? ()
> #19 0x0000000010001a1c in ?? ()
> #20 0x00001fffffe17f0c in ?? ()
> #21 0x00001fffffe18134 in ?? ()
> #22 0x0000000000000000 in ?? ()
Adhemerval and I were just looking at the signal stack frames and I'd
noticed the increase in size due to the addition of the HTM bits so this is
great timing.
I tried a sigstack.h patch that increased the values as you indicated and
it cleaned up the failing tst-cancel21* testcases on POWER8. I didn't try
it on POWER7 yet.
Ryan S. Arnold
[-- Attachment #2: Type: text/html, Size: 5545 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SIGSTKSZ/MINSIGSTKSZ too small on 64bit
2013-07-26 21:31 ` Ryan Arnold
@ 2013-07-27 1:19 ` Alan Modra
0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2013-07-27 1:19 UTC (permalink / raw)
To: Ryan Arnold; +Cc: Michael Neuling, azanella, linuxppc-dev, Anton Blanchard, rsa
On Fri, Jul 26, 2013 at 04:31:34PM -0500, Ryan Arnold wrote:
> Adhemerval and I were just looking at the signal stack frames and I'd
> noticed the increase in size due to the addition of the HTM bits so this is
> great timing.
>
> I tried a sigstack.h patch that increased the values as you indicated and
> it cleaned up the failing tst-cancel21* testcases on POWER8. I didn't try
> it on POWER7 yet.
I've tested on power7 using a copy of
sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
as
sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-27 1:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26 2:23 SIGSTKSZ/MINSIGSTKSZ too small on 64bit Anton Blanchard
2013-07-26 5:05 ` Alan Modra
2013-07-26 21:31 ` Ryan Arnold
2013-07-27 1:19 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).