NetBSD Problem Report #54356

From martin@aprisoft.de  Sun Jul  7 12:19:20 2019
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id CDB8C7A0D9
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  7 Jul 2019 12:19:20 +0000 (UTC)
Message-Id: <20190707121910.8766E5CC80C@emmas.aprisoft.de>
Date: Sun,  7 Jul 2019 14:19:10 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: MKSANITIZER=yes binaries can not run from gdb
X-Send-Pr-Version: 3.95

>Number:         54356
>Category:       toolchain
>Synopsis:       MKSANITIZER=yes binaries can not run from gdb
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 07 12:20:00 +0000 2019
>Closed-Date:    Sat Sep 05 21:01:35 +0000 2020
>Last-Modified:  Sat Sep 05 21:01:35 +0000 2020
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.50
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD seven-days-to-the-wolves.aprisoft.de 8.99.50 NetBSD 8.99.50 (GENERIC) #285: Fri Jul 5 17:54:00 CEST 2019 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

After building a binary with MKSANITIZER=yes it can not be run from gdb.

Reading symbols from ./sysinst...
==5952==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==5952==ASan shadow was supposed to be located in the [0x00007fff7000-0x10007fff7fff] range.
==5952==Process memory map follows:
        0x000100a00000-0x000100a10000   /work/src/usr.sbin/sysinst/arch/amd64/sysinst
        0x000100a10000-0x000100b21000   /work/src/usr.sbin/sysinst/arch/amd64/sysinst
        0x000100d21000-0x000100d25000   /work/src/usr.sbin/sysinst/arch/amd64/sysinst
        0x000100d25000-0x000100d57000   /work/src/usr.sbin/sysinst/arch/amd64/sysinst
        0x000100d57000-0x000100d65000   
        0x728f17aae000-0x728f17e00000   
        0x728f17e00000-0x728f17e14000   /lib/libgcc_s.so.1.0
        0x728f17e14000-0x728f18014000   /lib/libgcc_s.so.1.0
        0x728f18014000-0x728f18015000   /lib/libgcc_s.so.1.0
        0x728f18015000-0x728f18016000   /lib/libgcc_s.so.1.0
        0x728f18200000-0x728f18202000   /usr/lib/librt.so.1.1
        0x728f18202000-0x728f18401000   /usr/lib/librt.so.1.1
        0x728f18401000-0x728f18402000   /usr/lib/librt.so.1.1
        0x728f18402000-0x728f18403000   /usr/lib/librt.so.1.1
        0x728f18600000-0x728f18611000   /usr/lib/libpthread.so.1.4
        0x728f18611000-0x728f18810000   /usr/lib/libpthread.so.1.4
        0x728f18810000-0x728f18811000   /usr/lib/libpthread.so.1.4
        0x728f18811000-0x728f18812000   /usr/lib/libpthread.so.1.4
        0x728f18812000-0x728f18813000   
        0x728f18a00000-0x728f18a60000   /lib/libc.so.12.213
        0x728f18a60000-0x728f18a70000   /lib/libc.so.12.213
        0x728f18a70000-0x728f18bee000   /lib/libc.so.12.213
        0x728f18bee000-0x728f18ded000   /lib/libc.so.12.213
        0x728f18ded000-0x728f18df9000   /lib/libc.so.12.213
        0x728f18df9000-0x728f18dff000   /lib/libc.so.12.213
        0x728f18dff000-0x728f18e20000   
        0x728f18e20000-0x728f19025000   
        0x728f19200000-0x728f19217000   /lib/libutil.so.7.24
        0x728f19217000-0x728f19416000   /lib/libutil.so.7.24
        0x728f19416000-0x728f19418000   /lib/libutil.so.7.24
        0x728f19418000-0x728f1941a000   /lib/libutil.so.7.24
        0x728f1941a000-0x728f1941c000   
        0x728f19600000-0x728f19611000   /lib/libprop.so.1.1
        0x728f19611000-0x728f19810000   /lib/libprop.so.1.1
        0x728f19810000-0x728f19811000   /lib/libprop.so.1.1
        0x728f19811000-0x728f19812000   /lib/libprop.so.1.1
        0x728f19a00000-0x728f19a0e000   /lib/libterminfo.so.1.0
        0x728f19a0e000-0x728f19c0d000   /lib/libterminfo.so.1.0
        0x728f19c0d000-0x728f19c0e000   /lib/libterminfo.so.1.0
        0x728f19c0e000-0x728f19c0f000   /lib/libterminfo.so.1.0
        0x728f19e00000-0x728f19e27000   /usr/lib/libcurses.so.8.2
        0x728f19e27000-0x728f1a026000   /usr/lib/libcurses.so.8.2
        0x728f1a026000-0x728f1a028000   /usr/lib/libcurses.so.8.2
        0x728f1a028000-0x728f1a029000   /usr/lib/libcurses.so.8.2
        0x728f1a029000-0x728f1a02b000   
        0x728f1a200000-0x728f1a2a7000   /usr/lib/libasan.so.4.0
        0x728f1a2a7000-0x728f1a4a6000   /usr/lib/libasan.so.4.0
        0x728f1a4a6000-0x728f1a4a8000   /usr/lib/libasan.so.4.0
        0x728f1a4a8000-0x728f1a4ab000   /usr/lib/libasan.so.4.0
        0x728f1a4ab000-0x728f1a4c0000   
        0x728f1a4c0000-0x728f1aeb0000   
        0x728f1aeb0000-0x728f1aed0000   
        0x728f1aed0000-0x728f1b10f000   
        0x728f1b1f7000-0x728f1b20f000   
        0x728f1b20f000-0x728f1b226000   
        0x728f1b22d000-0x728f1b23d000   
        0x728f1b23d000-0x728f1b254000   
        0x7f7f9f400000-0x7f7f9f412000   /libexec/ld.elf_so
        0x7f7f9f412000-0x7f7f9f611000   
        0x7f7f9f611000-0x7f7f9f612000   /libexec/ld.elf_so
        0x7f7f9f612000-0x7f7f9f613000   
        0x7f7ff7eff000-0x7f7fff168000   
        0x7f7fff168000-0x7f7fff560000   
        0x7f7fff560000-0x7f7fff568000   
==5952==End of process memory map.
[Inferior 1 (process 5952) exited with code 01]


>How-To-Repeat:
see above

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/54356: MKSANITIZER=yes binaries can not run from gdb
Date: Sun, 7 Jul 2019 14:20:45 +0200

 Actually the resulting binary does not run w/o gdb either.

 Martin

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/54356: MKSANITIZER=yes binaries can not run from gdb
Date: Sun, 7 Jul 2019 14:25:59 +0200

 On 07.07.2019 14:20, martin@NetBSD.org wrote:
 > Reading symbols from ./sysinst...
 > ==5952==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
 > ==5952==ASan shadow was supposed to be located in the [0x00007fff7000-0x10007fff7fff] range.
 > ==5952==Process memory map follows:


 Is PaX ASLR disabled?

 ASan is incompatible with it.

 Newer ASan will have a builtin detection of enabled ASLR and bail out
 with a verbose message.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/54356: MKSANITIZER=yes binaries can not run from gdb
Date: Sun, 7 Jul 2019 14:44:14 +0200

 On Sun, Jul 07, 2019 at 12:35:01PM +0000, Kamil Rytarowski wrote:
 >  Is PaX ASLR disabled?
 >  
 >  ASan is incompatible with it.

 No, and that likely is the problem. Can you document it in bsd.README ?

 Martin

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/54356: MKSANITIZER=yes binaries can not run from gdb
Date: Sun, 7 Jul 2019 15:59:14 +0200

 On 07.07.2019 14:45, Martin Husemann wrote:
 > The following reply was made to PR toolchain/54356; it has been noted by=
  GNATS.
 >
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: toolchain/54356: MKSANITIZER=3Dyes binaries can not run fro=
 m gdb
 > Date: Sun, 7 Jul 2019 14:44:14 +0200
 >
 >  On Sun, Jul 07, 2019 at 12:35:01PM +0000, Kamil Rytarowski wrote:
 >  >  Is PaX ASLR disabled?
 >  >
 >  >  ASan is incompatible with it.
 >
 >  No, and that likely is the problem. Can you document it in bsd.README ?
 >
 >  Martin
 >
 >

 Extra note is not bad so I will add it.

 I plan to add a call for paxctl(8) as proposed by Joerg and newer
 sanitizers will be more verbose about it.

 BTW. MKSANITIZER was used so far only with an external patched version
 of LLVM.. I'm waiting for an upgraded version of this toolchain in the
 base system to resume work on it.

State-Changed-From-To: open->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Sat, 05 Sep 2020 23:01:35 +0200
State-Changed-Why:
GCC-9 contains builtin CheckASLR() check to catch such scenarios easily.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.