public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
@ 2020-06-23 13:15 ` fweimer at redhat dot com
  2020-09-25 22:51 ` hjl.tools at gmail dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: fweimer at redhat dot com @ 2020-06-23 13:15 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64                      |x86_64, i686
            Summary|x86_64: MINSIGSTKSZ too     |x86: MINSIGSTKSZ too small
                   |small for AVX-512F support  |for AVX-512F support
                 CC|                            |fweimer at redhat dot com

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
Not surprisingly, this issue happens with 32-bit glibc builds, too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
  2020-06-23 13:15 ` [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support fweimer at redhat dot com
@ 2020-09-25 22:51 ` hjl.tools at gmail dot com
  2020-09-26  6:18 ` schwab@linux-m68k.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2020-09-25 22:51 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|MOVED                       |---
   Target Milestone|---                         |2.33

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
MINSIGSTKSZ is defined in <bits/sigstack.h>.  Changing it in the kernel
doesn't help.  However, for AT_MINSIGSTKSZ kernel, we can do

extern int getminsigstacksize (void);

#ifdef __USE_GNU
/* Minumum stack size for a signal handler.  */
# undef MINSIGSTKSZ
# define MINSIGSTKSZ (getminsigstacksize ())
#endif

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
  2020-06-23 13:15 ` [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support fweimer at redhat dot com
  2020-09-25 22:51 ` hjl.tools at gmail dot com
@ 2020-09-26  6:18 ` schwab@linux-m68k.org
  2020-09-26 12:40 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: schwab@linux-m68k.org @ 2020-09-26  6:18 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> ---
MINSIGSTKSZ is required to be a constant.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-09-26  6:18 ` schwab@linux-m68k.org
@ 2020-09-26 12:40 ` hjl.tools at gmail dot com
  2021-03-06 19:22 ` bruno at clisp dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2020-09-26 12:40 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Andreas Schwab from comment #5)
> MINSIGSTKSZ is required to be a constant.

True.  But this requirement is very old at the time a fixed signal stack
size was sufficient. We can define MINSIGSTKSZ as a function return
under -D_GNU_SOURCE or other macro.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-09-26 12:40 ` hjl.tools at gmail dot com
@ 2021-03-06 19:22 ` bruno at clisp dot org
  2021-03-06 20:13 ` schwab@linux-m68k.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bruno at clisp dot org @ 2021-03-06 19:22 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org

--- Comment #7 from Bruno Haible <bruno at clisp dot org> ---
"#define SIGSTKSZ sysconf (_SC_SIGSTKSZ)" is a bad idea for several reasons:

1) It's not POSIX compliant. POSIX:2018
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html defines
two lists of macros:

  * "The <signal.h> header shall define the following macros which shall expand
to integer constant expressions that need not be usable in #if preprocessing
directives:"

  * "The <signal.h> header shall also define the following symbolic constants:"

SIGSTKSZ is in the second list. This implies that it must expand to a constant
and that it must be usable in #if preprocessing directives.

2) Even if you evade reason 1 by activating the definition only if _GNU_SOURCE
is defined, the problem is that such a definition breaks the majority of the
uses of sigaltstack(). Most programs allocate the alternate stack either inside
the stack of an existing thread or as a global array, making use of the POSIX
assertion that it is a constant. For example:
https://git.savannah.gnu.org/gitweb/?p=libsigsegv.git;a=blob;f=tests/altstack.h
A typical bug report where the change causes a compilation error is here:
https://lists.gnu.org/archive/html/bug-m4/2021-03/msg00000.html

3) The alternate signal stack needs to be dimensioned according to the CPU and
ABI that is in use. For example, SPARC processors tend to use much more stack
space than x86 per function invocation. Similarly, 64-bit execution on a
bi-arch CPU tends to use more stack space than 32-bit execution, because return
addresses and other pointers are 64-bit vs. 32-bit large. But once you have
fixed the CPU and the ABI, there is no ambiguity any more. If you have a
processor which requires a smaller or a larger initial stack frame, depending
on the "mode" of the processor, just take the maximum.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-03-06 19:22 ` bruno at clisp dot org
@ 2021-03-06 20:13 ` schwab@linux-m68k.org
  2021-03-06 20:19 ` bruno at clisp dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: schwab@linux-m68k.org @ 2021-03-06 20:13 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

--- Comment #8 from Andreas Schwab <schwab@linux-m68k.org> ---
A symbolic constant need _not_ be usable in #if, see 3.380.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-03-06 20:13 ` schwab@linux-m68k.org
@ 2021-03-06 20:19 ` bruno at clisp dot org
  2021-03-09 15:55 ` psmith at gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bruno at clisp dot org @ 2021-03-06 20:19 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

--- Comment #9 from Bruno Haible <bruno at clisp dot org> ---
(In reply to Andreas Schwab from comment #8)
> A symbolic constant need _not_ be usable in #if, see 3.380.

But you do agree that 'sysconf (_SC_SIGSTKSZ)' is not a symbolic constant?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-03-06 20:19 ` bruno at clisp dot org
@ 2021-03-09 15:55 ` psmith at gnu dot org
  2021-03-09 16:17 ` eblake at redhat dot com
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: psmith at gnu dot org @ 2021-03-09 15:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

psmith at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |psmith at gnu dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-03-09 15:55 ` psmith at gnu dot org
@ 2021-03-09 16:17 ` eblake at redhat dot com
  2021-03-23 17:07 ` ernestas at baltic dot engineering
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: eblake at redhat dot com @ 2021-03-09 16:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

Eric Blake <eblake at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eblake at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2021-03-09 16:17 ` eblake at redhat dot com
@ 2021-03-23 17:07 ` ernestas at baltic dot engineering
  2021-09-03 13:11 ` luis.machado at linaro dot org
  2022-01-06 14:31 ` carlos at redhat dot com
  11 siblings, 0 replies; 12+ messages in thread
From: ernestas at baltic dot engineering @ 2021-03-23 17:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

Ernestas Kulik <ernestas at baltic dot engineering> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ernestas at baltic dot engineering

--- Comment #10 from Ernestas Kulik <ernestas at baltic dot engineering> ---
(In reply to Andreas Schwab from comment #8)
> A symbolic constant need _not_ be usable in #if, see 3.380.

I think we’re focusing on irrelevant details, because sysconf() is hardly a
symbolic constant. Symbolic, maybe, but not constant.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2021-03-23 17:07 ` ernestas at baltic dot engineering
@ 2021-09-03 13:11 ` luis.machado at linaro dot org
  2022-01-06 14:31 ` carlos at redhat dot com
  11 siblings, 0 replies; 12+ messages in thread
From: luis.machado at linaro dot org @ 2021-09-03 13:11 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis.machado at linaro dot org

--- Comment #11 from Luis Machado <luis.machado at linaro dot org> ---
Build failure possibly related to the refactoring of these constants.

https://sourceware.org/bugzilla/show_bug.cgi?id=28302

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support
       [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2021-09-03 13:11 ` luis.machado at linaro dot org
@ 2022-01-06 14:31 ` carlos at redhat dot com
  11 siblings, 0 replies; 12+ messages in thread
From: carlos at redhat dot com @ 2022-01-06 14:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=20305

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com
         Resolution|---                         |FIXED
   Target Milestone|2.33                        |2.34
             Status|REOPENED                    |RESOLVED

--- Comment #12 from Carlos O'Donell <carlos at redhat dot com> ---
This was fixed with this commit in glibc 2.34 (2021-08-02):

commit 28d07380c2ae5786e242be336ccc1c9e3111f3fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 9 14:17:04 2021 -0700

    support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ)

    Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) since the constant
    MINSIGSTKSZ used in glibc build may be too small.

    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

Where we now resolve MINSIGSTKSZ dynamically to use AT_MINSIGSTKSZ or an
emulated value based on the hardware features.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-01-06 14:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-20305-131@http.sourceware.org/bugzilla/>
2020-06-23 13:15 ` [Bug libc/20305] x86: MINSIGSTKSZ too small for AVX-512F support fweimer at redhat dot com
2020-09-25 22:51 ` hjl.tools at gmail dot com
2020-09-26  6:18 ` schwab@linux-m68k.org
2020-09-26 12:40 ` hjl.tools at gmail dot com
2021-03-06 19:22 ` bruno at clisp dot org
2021-03-06 20:13 ` schwab@linux-m68k.org
2021-03-06 20:19 ` bruno at clisp dot org
2021-03-09 15:55 ` psmith at gnu dot org
2021-03-09 16:17 ` eblake at redhat dot com
2021-03-23 17:07 ` ernestas at baltic dot engineering
2021-09-03 13:11 ` luis.machado at linaro dot org
2022-01-06 14:31 ` carlos at redhat dot com

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).