unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* What can a signal handler do with SIGSTKSZ?
@ 2019-01-11 17:44 Carlos O'Donell
  2019-01-11 19:02 ` Szabolcs Nagy
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Carlos O'Donell @ 2019-01-11 17:44 UTC (permalink / raw)
  To: GNU C Library

In the continuing series of "What can X do with Y?" [1]

I would like to get consensus on what a signal handler can do with
SIGSTKSZ amount of space.

I propose the following:
~~~
The implementation only guarantees that a signal handler can
manipulate a reasonable amount of local variables (no more than
2 KiB worth), and can read and write to memory, carry out atomic
operations, and call simple C library functions that do similar
memory and simple string operations e.g. memcpy, memset, strcmp,
strcpy. The amount of signal stack allocated for SIGSTKSZ is not
sufficient to call complex signal-safe functions e.g. fork, _exit,
abort, nor any that can be canceled (requires enough stack for
cancellation). Any other operations or function calls in the
signal handler should be evaluated for runtime stack usage and
additional stack beyond SIGSTKSZ should be allocated.
~~~

Thoughts?

-- 
Cheers,
Carlos.

[1] "What can a thread do with PTHREAD_STACK_MIN?"
https://sourceware.org/ml/libc-alpha/2017-12/msg00751.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-01-16 22:51 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 17:44 What can a signal handler do with SIGSTKSZ? Carlos O'Donell
2019-01-11 19:02 ` Szabolcs Nagy
2019-01-11 19:11   ` Carlos O'Donell
2019-01-11 20:23     ` Szabolcs Nagy
     [not found] ` <CAKCAbMiCaBst_ofjKkH3Ck1CoOV86wPKv3QSkC89XW_zu=1BLA@mail.gmail.com>
2019-01-11 19:34   ` Fwd: " Zack Weinberg
2019-01-11 20:00     ` Florian Weimer
2019-01-11 20:06       ` Christian Brauner
2019-01-11 20:14         ` Florian Weimer
2019-01-11 20:26           ` Christian Brauner
2019-01-14 16:15             ` Florian Weimer
2019-01-11 20:09       ` Zack Weinberg
2019-01-11 20:29         ` Florian Weimer
2019-01-11 23:59           ` Zack Weinberg
2019-01-14 11:18             ` Szabolcs Nagy
2019-01-14 11:29               ` Adhemerval Zanella
2019-01-14 16:34                 ` Zack Weinberg
2019-01-14 20:29                   ` Carlos O'Donell
2019-01-14 16:18               ` Florian Weimer
2019-01-14 16:22                 ` Carlos O'Donell
2019-01-14 16:31                   ` Florian Weimer
2019-01-14 16:34                   ` Szabolcs Nagy
2019-01-14 18:19                   ` Joseph Myers
2019-01-14 20:30                     ` Carlos O'Donell
2019-01-16 22:51             ` Christian Brauner
2019-01-11 19:40 ` Florian Weimer

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 read-only IMAP folder(s) and NNTP newsgroup(s).