Bug 92154 - new glibc breaks arm bootstrap due to libsanitizer
Summary: new glibc breaks arm bootstrap due to libsanitizer
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: sanitizer (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: 8.4
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 93846 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-18 15:29 UTC by Tamar Christina
Modified: 2022-03-23 00:40 UTC (History)
3 users (show)

See Also:
Host:
Target: arm-none-linux-gnueabihf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-10-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tamar Christina 2019-10-18 15:29:32 UTC
Glibc has recently introduced changes to the mode field in ipc_perm in commit 2f959dfe849e0646e27403f2e4091536496ac0f0. For Arm this means that the mode field no longer has the same size.

This causes an assert failure against libsanitizer's internal copy of ipc_perm. Since this change can't be easily detected. I fixed this upstream in https://reviews.llvm.org/D69104.

Can the libsanitizer be synched with upstream?
Comment 1 Jakub Jelinek 2019-10-18 17:02:45 UTC
If it has landed upstream already, please post the backport of it to gcc-patches.
Comment 2 Tamar Christina 2019-10-22 14:26:09 UTC
Author: tnfchris
Date: Tue Oct 22 14:25:38 2019
New Revision: 277291

URL: https://gcc.gnu.org/viewcvs?rev=277291&root=gcc&view=rev
Log:
Arm: Fix arm libsanitizer bootstrap failure 

Glibc has recently introduced changed to the mode field in ipc_perm
in commit 2f959dfe849e0646e27403f2e4091536496ac0f0. For Arm this
means that the mode field no longer has the same size.

This causes an assert failure against libsanitizer's internal copy
of ipc_perm.  Since this change can't be easily detected I am adding
arm to the list of targets that are excluded from this check.  libsanitizer
doesn't use this field (and others, it in fact uses only 1 field) so this check
can be ignored.

Padding bits were used by glibc when the field was changed so sizeof and offsets
of the remaining fields should be the same.

libsanitizer/ChangeLog:

	PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.cpp (defined):
	Cherry-pick compiler-rt revision r375220.


Modified:
    trunk/libsanitizer/ChangeLog
    trunk/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
Comment 3 Tamar Christina 2019-10-28 11:44:30 UTC
Fixed on trunk. Should I backport the patch?
Comment 4 Jakub Jelinek 2019-10-30 07:01:28 UTC
Yes.
Comment 5 Jakub Jelinek 2019-11-08 18:53:49 UTC
Author: jakub
Date: Fri Nov  8 18:53:18 2019
New Revision: 277981

URL: https://gcc.gnu.org/viewcvs?rev=277981&root=gcc&view=rev
Log:
	Backported from mainline
	2019-10-22  Tamar Christina  <tamar.christina@arm.com>

	PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.cc:
	Cherry-pick compiler-rt revision r375220.

Modified:
    branches/gcc-9-branch/libsanitizer/ChangeLog
    branches/gcc-9-branch/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
Comment 6 Jakub Jelinek 2019-11-26 09:09:02 UTC
Author: jakub
Date: Tue Nov 26 09:08:31 2019
New Revision: 278722

URL: https://gcc.gnu.org/viewcvs?rev=278722&root=gcc&view=rev
Log:
	PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.

Modified:
    trunk/libsanitizer/ChangeLog
    trunk/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
    trunk/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
Comment 7 Jakub Jelinek 2019-12-20 16:59:06 UTC
Author: jakub
Date: Fri Dec 20 16:58:35 2019
New Revision: 279653

URL: https://gcc.gnu.org/viewcvs?rev=279653&root=gcc&view=rev
Log:
	Backported from mainline
	2019-11-26  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.

Modified:
    branches/gcc-9-branch/libsanitizer/ChangeLog
    branches/gcc-9-branch/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
    branches/gcc-9-branch/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
Comment 8 GCC Commits 2020-02-14 16:34:08 UTC
The releases/gcc-8 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:54d87ffe4b34052f159ac5b72b250129ce813b2a

commit r8-9981-g54d87ffe4b34052f159ac5b72b250129ce813b2a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 14 12:33:27 2020 +0100

    backport: re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
    
    	Backported from mainline
    	2019-10-22  Tamar Christina  <tamar.christina@arm.com>
    
    	PR sanitizer/92154
    	* sanitizer_common/sanitizer_platform_limits_posix.cc:
    	Cherry-pick compiler-rt revision r375220.
Comment 9 GCC Commits 2020-02-14 16:34:27 UTC
The releases/gcc-8 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:dbdf86838aaaef76620c00c53096cfe157d5af6e

commit r8-9984-gdbdf86838aaaef76620c00c53096cfe157d5af6e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 14 12:38:30 2020 +0100

    backport: re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
    
    	Backported from mainline
    	2019-11-26  Jakub Jelinek  <jakub@redhat.com>
    
    	PR sanitizer/92154
    	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
    	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
    	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
Comment 10 Jakub Jelinek 2020-02-14 17:21:18 UTC
Fixed for 8.4+ and 9.3+ too.
Comment 11 Martin Liška 2020-02-20 11:33:39 UTC
*** Bug 93846 has been marked as a duplicate of this bug. ***