From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D909E3858CDB; Mon, 12 Feb 2024 12:41:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D909E3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707741703; bh=yh5rnn7lvE5cRo/11vAPndMf+AfUnJzJ092jR5n+110=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iXqLfBOux/wPYiA/CjOYQhowNtnvFoTEmMD4IkqqpxE0GlVS/0DdQ/k5SoqGiypsi PEpiAFCHJoHObcxakAGQFXB0M4ANKjKodlyMpbIrwCmYR7Q+tEXg+YZte0EAPUXl+b VKd/BQsXD0t1XZn/SGxgcdn7znGsdKgxYzfTyHDQ= From: "ro at CeBiTec dot Uni-Bielefeld.DE" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/113785] c-c++-common/asan/swapcontext-test-1.c FAILs Date: Mon, 12 Feb 2024 12:41:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: ro at CeBiTec dot Uni-Bielefeld.DE X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113785 --- Comment #1 from ro at CeBiTec dot Uni-Bielefeld.DE --- I've found what's going on: as described in Solaris makecontext(3C), the function changed starting with Solaris 10: NOTES The semantics of the uc_stack member of the ucontext_t structure h= ave changed as they apply to inputs to makecontext(). Prior to Solaris = 10, the ss_sp member of the uc_stack structure represented the high mem= ory address of the area reserved for the stack. The ss_sp member now rep= re- sents the base (low memory address), in keeping with other uses= of ss_sp. This change in the meaning of ss_sp is now the default behavior. = The -D__MAKECONTEXT_V2_SOURCE compilation flag used in Solaris 9 upd= ate releases to access this behavior is obsolete. To preserve, binary compatiblity, the old behaviour of makecontext() has been retained, and the following snippet in ensures that a different function with the new behavious is called from user code instead: /* makecontext removed in SUSv4 (XPG7, UNIX V7) */ #if !defined(_XPG7) || defined(__EXTENSIONS__) #ifdef __sparc #ifdef __PRAGMA_REDEFINE_EXTNAME #pragma redefine_extname makecontext __makecontext_v2 #else #define makecontext __makecontext_v2 #endif #endif /* __sparc */ #endif /* !defined(_XPG7) || ... */ However, libasan knows nothing about this and just intercepts unadorned makecontext, but this interceptor is never called. I've got a patch (attached for reference) that changes the makecontext interceptor to call __makecontext_v2 instead on Solaris/SPARC. With this, the c-c++-common/asan/swapcontext-test-1.c test now PASSes on Solaris/SPARC. I'm going to submit it upstream soon.=