Message ID | 20240409142435.1708867-1-hjl.tools@gmail.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 18DCF385840D for <patchwork@sourceware.org>; Tue, 9 Apr 2024 14:25:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 4F7DC385842C for <gcc-patches@gcc.gnu.org>; Tue, 9 Apr 2024 14:24:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F7DC385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F7DC385842C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712672679; cv=none; b=SLocnJiYDt/jLfZZlYO+hAxR5m928VM5kSTyodoGhbSasvDiQKf3V42uVObkB55HOK2MIlTN0brIpDz+5SAWjv6FY1s2qKVT0ZgAj78ry1XEZkcGNvLiVhhb09nN5pEPL5cpUJEwV3btlFlmnNBWJjDIyDvgYM4O0vSeFogPaqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712672679; c=relaxed/simple; bh=ZGkB0DelrkRja53457UIccCkvLRqY+wRcNWm/UvEprY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=R2xPZQchdGeP6WtbLlJHTBT1/oeWdQCU5h2xAekMmUeYaVKfamqlc8Ihv7XGnrRDGhfc3xrR6Dd47y8GRbuCso1dRHetjNKIXS8C2TGU+JrIKFcWYFpg43JYKuBQxd3aQZboo4s12nIK0fw3KdLmwE9zHsJSxN/tmrcI3NOlaa8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6eaf1005fcaso3853063b3a.3 for <gcc-patches@gcc.gnu.org>; Tue, 09 Apr 2024 07:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712672677; x=1713277477; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1pFfa/IKh27ShTTFcftOFE1O1aWj+Y95EHn9qX4YYD0=; b=jr9hIIuzvUpYc4k4TdxgTKhUgkrTZ7salZ/FK9sN9kELMRTpMqmV4bAojMz/QpXYon Yck48uQrkEUHgte46d6t+2O7I9mCuczeaRRLoCIJyuHWNLWK35cl/4Cwet8yUeRJoTEK /pYY+FGCrJNcU1k5/E3cs87kY/WQ0OWe8NGtIBrBQHZ5k0EZQmK9tdZ5UBE266SXyXV0 8TLAhVhNv6cRtGC7gM1z8ntkId3pTkE7iybhyJGSVCQHy1fGrCMsuqw0KWZ3GzyRk62k WIWcB+pD6gnUD+Qi71u6Tz0aj+nBwhAw5jamololW6YTYOxM26T/6/62f0NXaargB15U hdEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712672677; x=1713277477; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1pFfa/IKh27ShTTFcftOFE1O1aWj+Y95EHn9qX4YYD0=; b=HrkeGDpDjsufRt9gWm/toegPCiHzKM7PoDERZqNBEsUzrQckhl8Mgkh5A07wBhc1Vo 1H2aewG/+/G8kCnhEl8clhqCTshWsiWljoHfVfi/sh+H/NwgjmQTX0aF1X7aF7yZv1pf nuhuQ0+9YuLrVh5/llB8Yz4IF+5ygxWQDRx+fi3z4LEJNL/ej6xWvOHz4OXdM3mJzt/x o6dyi4PrwuxvuxuLhXAduh1ZAtVOKwozJ8L6P+oUzLz3jVG6HAXlHhQe/HL56zdP/MlH eX1pedgEOaTBEROgZX4JMoiKNDbw+ludB4lPxF7+7u/m+cKP34l2qwg5NqMZNv7Lt4uI cCWQ== X-Forwarded-Encrypted: i=1; AJvYcCWhmg1XQYzCKDVo4fq++bmMKsfwADpMDDyxd1YkqAu07m9i7el4pw0Wc0gorpaDQKweE+vzox/9+CeMEIoNF+C+of1sj5CEAw== X-Gm-Message-State: AOJu0YzeWu11XJ9uXZBS73cNbKQ/6lcPrqq4tEZDykNOeh/I6Wh7lhZL YGKyIjdQGxffmbPgB54mSqtHT+zi99PaFioUjXWYROfFaDxwy0vIqfi3APUe X-Google-Smtp-Source: AGHT+IFdcOapxPlkZw75fzbw62W/CdxvW3XN79a88pndsySNDAaEeh0kwAXRJ+3wA49JFRpk28R/zg== X-Received: by 2002:a05:6a00:2d87:b0:6ea:df6a:39e7 with SMTP id fb7-20020a056a002d8700b006eadf6a39e7mr11724414pfb.13.1712672676846; Tue, 09 Apr 2024 07:24:36 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.56.169.48]) by smtp.gmail.com with ESMTPSA id fj8-20020a056a003a0800b006ea8af1569asm8345108pfb.73.2024.04.09.07.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:24:36 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 62C92740097; Tue, 9 Apr 2024 07:24:35 -0700 (PDT) From: "H.J. Lu" <hjl.tools@gmail.com> To: binutils@sourceware.org Cc: amodra@gmail.com, gcc-patches@gcc.gnu.org Subject: [PATCH 0/2] mmap: Avoid the sanitizer configure check failure Date: Tue, 9 Apr 2024 07:24:33 -0700 Message-ID: <20240409142435.1708867-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3012.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org |
Series |
mmap: Avoid the sanitizer configure check failure
|
|
Message
H.J. Lu
April 9, 2024, 2:24 p.m. UTC
When -fsanitize=address,undefined is used to build, the mmap configure check failed with ================================================================= ==231796==ERROR: LeakSanitizer: detected memory leaks Direct leak of 4096 byte(s) in 1 object(s) allocated from: #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x5750c7f6d72b in main /home/alan/build/gas-san/all/bfd/conftest.c:239 Direct leak of 4096 byte(s) in 1 object(s) allocated from: #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x5750c7f6d2e1 in main /home/alan/build/gas-san/all/bfd/conftest.c:190 SUMMARY: AddressSanitizer: 8192 byte(s) leaked in 2 allocation(s). Define GCC_AC_FUNC_MMAP with export ASAN_OPTIONS=detect_leaks=0 to avoid the sanitizer configure check failure. H.J. Lu (2): mmap: Avoid the sanitizer configure check failure mmap: Avoid the sanitizer configure check failure bfd/Makefile.in | 2 +- bfd/aclocal.m4 | 1 + bfd/configure | 5 +++++ bfd/configure.ac | 2 +- binutils/Makefile.in | 2 +- binutils/aclocal.m4 | 1 + binutils/configure | 5 +++++ binutils/configure.ac | 2 +- config/mmap.m4 | 12 ++++++++++++ config/no-executables.m4 | 4 ++-- ld/Makefile.in | 2 +- ld/aclocal.m4 | 1 + ld/configure | 5 +++++ ld/configure.ac | 2 +- libctf/Makefile.in | 2 +- libctf/aclocal.m4 | 1 + libctf/configure | 5 +++++ libctf/configure.ac | 2 +- libiberty/Makefile.in | 1 + libiberty/acinclude.m4 | 2 +- libiberty/aclocal.m4 | 1 + libiberty/configure | 5 +++++ libsframe/Makefile.in | 1 + libsframe/aclocal.m4 | 1 + libsframe/configure | 5 +++++ libsframe/configure.ac | 2 +- zlib/Makefile.in | 2 +- zlib/acinclude.m4 | 1 + zlib/configure | 7 ------- 29 files changed, 64 insertions(+), 20 deletions(-)
Comments
"H.J. Lu" <hjl.tools@gmail.com> writes: > When -fsanitize=address,undefined is used to build, the mmap configure > check failed with I think Paul fixed this in autoconf commit 09b6e78d1592ce10fdc975025d699ee41444aa3f, so we should add a comment about that so we can clean this up in future. > > ================================================================= > ==231796==ERROR: LeakSanitizer: detected memory leaks > > Direct leak of 4096 byte(s) in 1 object(s) allocated from: > #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 > #1 0x5750c7f6d72b in main /home/alan/build/gas-san/all/bfd/conftest.c:239 > > Direct leak of 4096 byte(s) in 1 object(s) allocated from: > #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 > #1 0x5750c7f6d2e1 in main /home/alan/build/gas-san/all/bfd/conftest.c:190 > > SUMMARY: AddressSanitizer: 8192 byte(s) leaked in 2 allocation(s). > > Define GCC_AC_FUNC_MMAP with export ASAN_OPTIONS=detect_leaks=0 to avoid > the sanitizer configure check failure. > > H.J. Lu (2): > mmap: Avoid the sanitizer configure check failure > mmap: Avoid the sanitizer configure check failure > > bfd/Makefile.in | 2 +- > bfd/aclocal.m4 | 1 + > bfd/configure | 5 +++++ > bfd/configure.ac | 2 +- > binutils/Makefile.in | 2 +- > binutils/aclocal.m4 | 1 + > binutils/configure | 5 +++++ > binutils/configure.ac | 2 +- > config/mmap.m4 | 12 ++++++++++++ > config/no-executables.m4 | 4 ++-- > ld/Makefile.in | 2 +- > ld/aclocal.m4 | 1 + > ld/configure | 5 +++++ > ld/configure.ac | 2 +- > libctf/Makefile.in | 2 +- > libctf/aclocal.m4 | 1 + > libctf/configure | 5 +++++ > libctf/configure.ac | 2 +- > libiberty/Makefile.in | 1 + > libiberty/acinclude.m4 | 2 +- > libiberty/aclocal.m4 | 1 + > libiberty/configure | 5 +++++ > libsframe/Makefile.in | 1 + > libsframe/aclocal.m4 | 1 + > libsframe/configure | 5 +++++ > libsframe/configure.ac | 2 +- > zlib/Makefile.in | 2 +- > zlib/acinclude.m4 | 1 + > zlib/configure | 7 ------- > 29 files changed, 64 insertions(+), 20 deletions(-)
On Tue, Apr 9, 2024 at 4:08 PM Sam James <sam@gentoo.org> wrote: > > "H.J. Lu" <hjl.tools@gmail.com> writes: > > > When -fsanitize=address,undefined is used to build, the mmap configure > > check failed with > > I think Paul fixed this in autoconf commit > 09b6e78d1592ce10fdc975025d699ee41444aa3f, so we should add a comment > about that so we can clean this up in future. Sure . That was in 2016. > > > > ================================================================= > > ==231796==ERROR: LeakSanitizer: detected memory leaks > > > > Direct leak of 4096 byte(s) in 1 object(s) allocated from: > > #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 > > #1 0x5750c7f6d72b in main /home/alan/build/gas-san/all/bfd/conftest.c:239 > > > > Direct leak of 4096 byte(s) in 1 object(s) allocated from: > > #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 > > #1 0x5750c7f6d2e1 in main /home/alan/build/gas-san/all/bfd/conftest.c:190 > > > > SUMMARY: AddressSanitizer: 8192 byte(s) leaked in 2 allocation(s). > > > > Define GCC_AC_FUNC_MMAP with export ASAN_OPTIONS=detect_leaks=0 to avoid > > the sanitizer configure check failure. > > > > H.J. Lu (2): > > mmap: Avoid the sanitizer configure check failure > > mmap: Avoid the sanitizer configure check failure > > > > bfd/Makefile.in | 2 +- > > bfd/aclocal.m4 | 1 + > > bfd/configure | 5 +++++ > > bfd/configure.ac | 2 +- > > binutils/Makefile.in | 2 +- > > binutils/aclocal.m4 | 1 + > > binutils/configure | 5 +++++ > > binutils/configure.ac | 2 +- > > config/mmap.m4 | 12 ++++++++++++ > > config/no-executables.m4 | 4 ++-- > > ld/Makefile.in | 2 +- > > ld/aclocal.m4 | 1 + > > ld/configure | 5 +++++ > > ld/configure.ac | 2 +- > > libctf/Makefile.in | 2 +- > > libctf/aclocal.m4 | 1 + > > libctf/configure | 5 +++++ > > libctf/configure.ac | 2 +- > > libiberty/Makefile.in | 1 + > > libiberty/acinclude.m4 | 2 +- > > libiberty/aclocal.m4 | 1 + > > libiberty/configure | 5 +++++ > > libsframe/Makefile.in | 1 + > > libsframe/aclocal.m4 | 1 + > > libsframe/configure | 5 +++++ > > libsframe/configure.ac | 2 +- > > zlib/Makefile.in | 2 +- > > zlib/acinclude.m4 | 1 + > > zlib/configure | 7 ------- > > 29 files changed, 64 insertions(+), 20 deletions(-)
On Tue, Apr 09, 2024 at 07:24:33AM -0700, H.J. Lu wrote: > Define GCC_AC_FUNC_MMAP with export ASAN_OPTIONS=detect_leaks=0 to avoid > the sanitizer configure check failure. OK for binutils. (I just fixed my local copy of autoconf so I wouldn't run into this again.) The proper fix of course is to update autotools to something more recent.
On Tue, Apr 9, 2024 at 10:39 PM Alan Modra <amodra@gmail.com> wrote: > > On Tue, Apr 09, 2024 at 07:24:33AM -0700, H.J. Lu wrote: > > Define GCC_AC_FUNC_MMAP with export ASAN_OPTIONS=detect_leaks=0 to avoid > > the sanitizer configure check failure. > > OK for binutils. (I just fixed my local copy of autoconf so I > wouldn't run into this again.) The proper fix of course is to update > autotools to something more recent. > This is what I am checking in with: dnl dnl Avoid the sanitizer run-time memory leak failure in the mmap configure dnl test. This should be removed when autoconf with commit: dnl dnl commit 09b6e78d1592ce10fdc975025d699ee41444aa3f dnl Author: Paul Eggert <eggert@cs.ucla.edu> dnl Date: Fri Feb 5 21:06:20 2016 -0800 dnl Fix memory leak in AC_FUNC_MMAP dnl dnl * lib/autoconf/functions.m4 (AC_FUNC_MMAP): Fix memory leak dnl in test case, found by configuring with gcc -fsanitize=address. dnl dnl is in use. dnl Thanks.