[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34
From: |
Bruno Haible |
Subject: |
Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34 |
Date: |
Mon, 24 May 2021 12:37:12 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) |
Paul Eggert wrote:
> Thanks, that looks good except please change "create nested functions"
> to "create and then use nested functions", as it's OK to for a
> stack-overflow handler to create a nested function without using it.
Yup. I had a thinko there.
> Should a similar restriction be documented for libsigsegv, or is that
> library immune to this problem?
Right, it will need to be documented for libsigsegv as well.
2021-05-24 Bruno Haible <bruno@clisp.org>
c-stack: Document another restriction.
Triggered by a discussion with Paul Eggert.
* lib/c-stack.h: Mention that ACTION should not use nested functions.
diff --git a/lib/c-stack.h b/lib/c-stack.h
index 56d74f1..a9a8b13 100644
--- a/lib/c-stack.h
+++ b/lib/c-stack.h
@@ -33,10 +33,15 @@
A null ACTION acts like an action that does nothing.
- ACTION must be async-signal-safe. ACTION together with its callees
- must not require more than 64 KiB of stack space. Also,
- ACTION should not call longjmp, because this implementation does
- not guarantee that it is safe to return to the original stack.
+ Restrictions:
+ - ACTION must be async-signal-safe.
+ - ACTION together with its callees must not require more than 64 KiB of
+ stack space.
+ - ACTION must not create and then invoke nested functions
+ <https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html>, because
+ this implementation does not guarantee an executable stack.
+ - ACTION should not call longjmp, because this implementation does not
+ guarantee that it is safe to return to the original stack.
This function may install a handler for the SIGSEGV signal or for the SIGBUS
signal or exercise other system dependent exception handling APIs. */
- sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Bruno Haible, 2021/05/16
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Paul Eggert, 2021/05/16
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Bruno Haible, 2021/05/18
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Paul Eggert, 2021/05/21
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Bruno Haible, 2021/05/22
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Paul Eggert, 2021/05/23
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Bruno Haible, 2021/05/23
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34, Paul Eggert, 2021/05/23
- Re: sigsegv, c-stack: Avoid compilation error with glibc >= 2.34,
Bruno Haible <=
- Re: sigsegv.h interface, Bruno Haible, 2021/05/22
- Re: sigsegv.h interface, Paul Eggert, 2021/05/23