From owner-freebsd-bugs@freebsd.org Wed Aug 16 12:41:58 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15F08DD9CA1 for ; Wed, 16 Aug 2017 12:41:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 039DB81ABD for ; Wed, 16 Aug 2017 12:41:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v7GCfvec087323 for ; Wed, 16 Aug 2017 12:41:57 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 221337] -fsanitize=address (asan) fails on i386 Date: Wed, 16 Aug 2017 12:41:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2017 12:41:58 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221337 --- Comment #3 from Ed Maste --- Looking at libclang_rt.asan-i386.so it does have PT_TLS with 4-byte alignme= nt, and perhaps that should be changed on general principle: % readelf -l /usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-i386.so Elf file type is DYN (Shared object file) Entry point 0xbb80 There are 6 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0xc21c4 0xc21c4 R E 0x1000 LOAD 0x0c21c4 0x000c31c4 0x000c31c4 0x02f08 0x49a58c RW 0x1000 DYNAMIC 0x0c2470 0x000c3470 0x000c3470 0x000f8 0x000f8 RW 0x4 TLS 0x0c21c4 0x000c31c4 0x000c31c4 0x00000 0x00018 R 0x4 GNU_EH_FRAME 0x0b5a50 0x000b5a50 0x000b5a50 0x02934 0x02934 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4 Section to Segment mapping: Segment Sections... 00 .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.= dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame .comment .gnu_debuglink .shstrtab=20 01 .tbss .ctors .dtors .jcr .data.rel.ro .dynamic .got .got.plt .data .bss=20 02 .dynamic=20 03 .tbss .ctors=20 04 .eh_frame_hdr=20 05=20=20=20=20=20 ref12-i386%=20 but note that asan is not asserting that one of its symbols is not 8-byte aligned but rather (some #ifdefs trimmed, showing only the FreeBSD/i386 pat= h): static void **ThreadSelfSegbase() { void **segbase =3D 0; // sysarch(I386_GET_GSBASE, segbase); __asm __volatile("mov %%gs:0, %0" : "=3Dr" (segbase)); return segbase; } uptr ThreadSelf() { return (uptr)ThreadSelfSegbase()[2]; } static void GetTls(uptr *addr, uptr *size) { void** segbase =3D ThreadSelfSegbase(); *addr =3D 0; *size =3D 0; if (segbase !=3D 0) { // tcbalign =3D 16 // tls_size =3D round(tls_static_space, tcbalign); // dtv =3D segbase[1]; // dtv[2] =3D segbase - tls_static_space; void **dtv =3D (void**) segbase[1]; *addr =3D (uptr) dtv[2]; *size =3D (*addr =3D=3D 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]); } } and later asserts that the addr returned from GetTls is 8-byte aligned --=20 You are receiving this mail because: You are the assignee for the bug.=