From: H.J. Lu Date: Tue, 19 Dec 2023 17:55:25 +0000 (-0800) Subject: tst-setcontext10.c: Undef _FORTIFY_SOURCE X-Git-Tag: glibc-2.39~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46432be2f1d4de962b51ca6b9f80fc37744be9f7;p=thirdparty%2Fglibc.git tst-setcontext10.c: Undef _FORTIFY_SOURCE When _FORTIFY_SOURCE is defined to 2, ____longjmp_chk is called, instead of longjmp. ____longjmp_chk compares the relative stack values to decide if it is called from a stack frame which called setjmp. If not, ____longjmp_chk assumes that an alternate signal stack is used. Since comparing the relative stack values isn't reliable with user context, when there is no signal, ____longjmp_chk will fail. Undefine _FORTIFY_SOURCE to avoid ____longjmp_chk in user context test. --- diff --git a/stdlib/tst-setcontext10.c b/stdlib/tst-setcontext10.c index 2926753cb13..d714563742b 100644 --- a/stdlib/tst-setcontext10.c +++ b/stdlib/tst-setcontext10.c @@ -16,6 +16,15 @@ License along with the GNU C Library; if not, see . */ +/* When _FORTIFY_SOURCE is defined to 2, ____longjmp_chk is called, + instead of longjmp. ____longjmp_chk compares the relative stack + values to decide if it is called from a stack frame which called + setjmp. If not, ____longjmp_chk assumes that an alternate signal + stack is used. Since comparing the relative stack values isn't + reliable with user context, when there is no signal, ____longjmp_chk + will fail. Undefine _FORTIFY_SOURCE to avoid ____longjmp_chk. */ +#undef _FORTIFY_SOURCE + #include #include #include