From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68437 invoked by alias); 17 Nov 2016 14:27:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 68408 invoked by uid 89); 17 Nov 2016 14:27:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Thu, 17 Nov 2016 14:27:00 -0000 From: Joseph Myers To: Florian Weimer CC: Subject: Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, In-Reply-To: <1a524603-2966-df5a-edd9-8045aa256837@redhat.com> Message-ID: References: <20161026150218.3F1A4439942E0@oldenburg.str.redhat.com> <11f59117-e5a4-4c62-739c-e05e01ee43b3@redhat.com> <1a524603-2966-df5a-edd9-8045aa256837@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-11/txt/msg00623.txt.bz2 On Thu, 17 Nov 2016, Florian Weimer wrote: > > Well, I think mtrace (meaning the ability to run with tracing then run the > > mtrace script to process the results, more than the functions to turn > > tracing on and off) is similarly useful externally as a lightweight system > > for tracing allocations and detecting leaks. And it is of course > > documented in the manual. > > In my experience, it is not useful at all for finding the cause of leaks > because you only get the address of the immediate caller of malloc, which is > often a wrapper. The address is subject to ASLR as well. > > Based on the comments in this thread, I'm not sure if people find mtrace > theoretically useful, or actually use it. :) I use it for similar purposes to the glibc testsuite use: compile code once then possibly run it with tracing to check for leaks. (Where the expectation is that the cause of the leak is in the code you just added/changed that resulted in the check for leaks starting to fail.) I'd be fine with extending the trace format to allow listing more of a backtrace (using glibc's backtrace functions in the preloadable tracing malloc implementation). -- Joseph S. Myers joseph@codesourcery.com