From patchwork Fri Aug 14 15:00:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 8206 Received: (qmail 79504 invoked by alias); 14 Aug 2015 15:00:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 79495 invoked by uid 89); 14 Aug 2015 15:00:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f52.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=M1CgGwHtx12zH0JGZLNypY/cdFQAEs7DeZli3Coi3EM=; b=brjr6BkqonA0IhwMI4Kpq7Btr4eT878QTXhTigVTPXlkM4x8ppJfyTw+36ayk8pRbP i//WCBdnHxGtJdjPPl/G3chIV2EPa3t6N8WupU681PIOKnFNm00PrhcB6T5/5xB+1gub +dq0g2e/QVNrF2/dWxL27p7gToV1ITME5vVv57xFUIR8o2283s99NOeqE2r08hy1xbX1 JdIHcFkeIdUoT4SLJrS3j+Skfryg3ILaZdeAMi1ocnlu+Kx2Lmm9+sgMS8liWELcy2mG aciCE+NYIibEZltiyxnjYbOtoXI6RAen4p4ggwo7KP5HGeL76YnbSTtoXz+tuAUMcn7K u1Aw== X-Gm-Message-State: ALoCoQmJPrpZdKXMC56dH4549EZl5punM6O+6dpndlx5eo4peePylJpMIIvnLO/zxdG7QpyytpmA X-Received: by 10.52.167.105 with SMTP id zn9mr54051912vdb.83.1439564448116; Fri, 14 Aug 2015 08:00:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <874mk2xr5g.fsf@igel.home> References: <874mk2xr5g.fsf@igel.home> From: Paul Pluzhnikov Date: Fri, 14 Aug 2015 08:00:18 -0700 Message-ID: Subject: Re: Fix a buglet in malloc/mtrace.pl To: Andreas Schwab Cc: GLIBC Devel On Fri, Aug 14, 2015 at 12:31 AM, Andreas Schwab wrote: > Paul Pluzhnikov writes: > >> - } else { >> + } elsif ($allocaddr != "(nil}") { > > Can this ever be false? Oops. You are almost right: the condition above is actually never false (my Perl is getting rusty, one does not simply compare strings with != in Perl!). The end result is that all leak detection is suppressed :-( Corrected patch attached. diff --git a/malloc/mtrace.pl b/malloc/mtrace.pl index 0737890..6227049 100644 --- a/malloc/mtrace.pl +++ b/malloc/mtrace.pl @@ -167,7 +167,7 @@ while () { printf ("+ %#0@XXX@x Alloc %d duplicate: %s %s\n", hex($allocaddr), $nr, &location($addrwas{$allocaddr}), $where); - } else { + } elsif ($allocaddr =~ /^0x/) { $allocated{$allocaddr}=$howmuch; $addrwas{$allocaddr}=$where; }