From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 81B75385840D; Tue, 19 Dec 2023 21:40:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81B75385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703022001; bh=xxJ+0XPqFY23MhylcIklcEH6FxahBcCKGBywDHMU4eE=; h=From:To:Subject:Date:From; b=p5shYmdvirCU1g4Y7RBD5y3QY6v44rVtWieToHl1d6KYywwkRErQ3kHYWY/VbQzDn RmjArtPJG5COTPPmkeayIGW9sQQwjAijdZ7cyYo6Y1y11sYzCDQe2B3MDGZ8H54+Cr obmIs2Luq3xmFxbDqjYjNnNLVMS9h9JIQxrblUI8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: H.J. Lu To: glibc-cvs@sourceware.org Subject: [glibc] tst-setcontext10.c: Undef _FORTIFY_SOURCE X-Act-Checkin: glibc X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: cad5703e4f80841b7f7e3fe57127bd0df7ddb86e X-Git-Newrev: 46432be2f1d4de962b51ca6b9f80fc37744be9f7 Message-Id: <20231219214001.81B75385840D@sourceware.org> Date: Tue, 19 Dec 2023 21:40:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=46432be2f1d4de962b51ca6b9f80fc37744be9f7 commit 46432be2f1d4de962b51ca6b9f80fc37744be9f7 Author: H.J. Lu Date: Tue Dec 19 09:55:25 2023 -0800 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: --- stdlib/tst-setcontext10.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stdlib/tst-setcontext10.c b/stdlib/tst-setcontext10.c index 2926753cb1..d714563742 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