Created attachment 9368 [details]
The attached test case fails on a system with AVX512 support (both hardware and kernel) with the following error:
tst-minsigstksz: changed byte 1376 bytes below configured stack
As a possible fix, the kernel could refuse to save FPU state to the signal handler stack if the specified stack is not large enough.
I do not see a good way to fix this in glibc. Increasing MINSIGSTKSZ has potential impact on ABI.
I filed a kernel bug: https://bugzilla.kernel.org/show_bug.cgi?id=153531
Not surprisingly, this issue happens with 32-bit glibc builds, too.
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);
/* Minumum stack size for a signal handler. */
# undef MINSIGSTKSZ
# define MINSIGSTKSZ (getminsigstacksize ())
MINSIGSTKSZ is required to be a constant.
(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.