From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 808 invoked by alias); 19 Jan 2015 17:29:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 740 invoked by uid 48); 19 Jan 2015 17:29:15 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/64435] [5 Regression] Bootstrap failure in libsanitizer on AArch64 with Linux kernel <= 3.15 Date: Mon, 19 Jan 2015 17:29:00 -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: 5.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: major X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg01867.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64435 --- Comment #14 from Jakub Jelinek --- And the reason why at least in RHEL and Fedora asan doesn't work at all is: cat /proc/self/maps; ASAN_OPTIONS=verbosity=1 ./null-deref-1.exe 00400000-00410000 r-xp 00000000 fd:00 134631897 /usr/bin/cat 00410000-00420000 r--p 00000000 fd:00 134631897 /usr/bin/cat 00420000-00430000 rw-p 00010000 fd:00 134631897 /usr/bin/cat 142c0000-142f0000 rw-p 00000000 00:00 0 [heap] 3ff929d0000-3ff99270000 r--p 00000000 fd:00 4086 /usr/lib/locale/locale-archive 3ff99270000-3ff993d0000 r-xp 00000000 fd:00 203072141 /usr/lib64/libc-2.17.so 3ff993d0000-3ff993e0000 r--p 00150000 fd:00 203072141 /usr/lib64/libc-2.17.so 3ff993e0000-3ff993f0000 rw-p 00160000 fd:00 203072141 /usr/lib64/libc-2.17.so 3ff99410000-3ff99420000 r--p 00000000 00:00 0 [vvar] 3ff99420000-3ff99430000 r-xp 00000000 00:00 0 [vdso] 3ff99430000-3ff99450000 r-xp 00000000 fd:00 201341988 /usr/lib64/ld-2.17.so 3ff99450000-3ff99460000 r--p 00010000 fd:00 201341988 /usr/lib64/ld-2.17.so 3ff99460000-3ff99470000 rw-p 00020000 fd:00 201341988 /usr/lib64/ld-2.17.so 3fff0680000-3fff06b0000 rw-p 00000000 00:00 0 [stack] ==2862==Parsed ASAN_OPTIONS: verbosity=1 ==2862==AddressSanitizer: libc interceptors initialized || `[0x002000000000, 0x007fffffffff]` || HighMem || || `[0x001400000000, 0x001fffffffff]` || HighShadow || || `[0x001200000000, 0x0013ffffffff]` || ShadowGap || || `[0x001000000000, 0x0011ffffffff]` || LowShadow || || `[0x000000000000, 0x000fffffffff]` || LowMem || MemToShadow(shadow): 0x001200000000 0x00123fffffff 0x001280000000 0x0013ffffffff redzone=16 max_redzone=2048 quarantine_size=256M malloc_context_size=30 SHADOW_SCALE: 3 SHADOW_GRANULARITY: 8 SHADOW_OFFSET: 1000000000 ==2862==Installed the sigaction for signal 11 ==2862==AddressSanitizer CHECK failed: ../../../../libsanitizer/asan/asan_poisoning.cc:24 "((AddrIsInMem(addr))) != (0)" (0x0, 0x0) https://github.com/torvalds/linux/blob/master/arch/arm64/include/asm/memory.h https://github.com/torvalds/linux/blob/master/arch/arm64/Kconfig reveals that aarch64 can be on Linux configured to support 39, 42 or 48 bits virtual address space. The current libsanitizer/asan/ and gcc/config/aarch64/aarch64.c (aarch64_asan_shadow_offset) seems to be okay only for the 39 bits virtual address space, while Fedora/RHEL apparently use 42 bits VA. Wonder if aarch64 couldn't use a layout closer to what x86_64 uses for asan, with shadow offset low 0x7fff8000, which is flexible to different sizes of the virtual address space.