This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] aarch64: Increase MINSIGSTKSZ and SIGSTKSZ


On Thu, Apr 02, 2015 at 11:27:47AM +0100, Szabolcs Nagy wrote:
> On 02/04/15 10:59, Marcus Shawcroft wrote:
> > On 2 April 2015 at 09:30, Andreas Schwab <schwab@suse.de> wrote:
> >>         [BZ #16850]
> >>         * sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h: New file.
> >> ---
> >>  sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h | 54 +++++++++++++++++++++++++
> >>  1 file changed, 54 insertions(+)
> >>  create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
> > 
> > Hi.
> > 
> > Back in November,
> > https://sourceware.org/ml/libc-alpha/2014-11/msg00339.html, RenLin
> > proposed 8k for MINSTKSZ, a few days ago, off list, Szabolcs suggest
> > 6k.  The ucontext is 4560 bytes and my understanding is that MINSTKSZ
> > only needs to be sufficient for the kernel to deliver the signal frame
> > which suggests that your proposed 5k is sufficient.
> 
> the 5K min is enough for signal delivery by the kernel
> 
> but the way i read the standard, applications are expected to allocate
> MINSIGSTKSZ + their own usage and it seems to be a stretch to
> include all libc overhead, such as symbol relocation, in "own usage"
> (historically the min size is small on many archs so probably it's
> not an issue in practice)

The big detail to notice here is symbol relocation. If you do lazy
bindings, the resolver function needs space to backup any registers
that might ever be used as argument registers in case a
not-yet-resolved function is called from the signal handler. On an
implementation without lazy bindings, 6k (like we have on musl now) or
maybe even 5k is a suitable value for the minimum, but on glibc you
probably need at least 7k and maybe more, so 8k sounds like a good
choice to me.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]