From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99539 invoked by alias); 17 Nov 2016 16:08:50 -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 98538 invoked by uid 89); 17 Nov 2016 16:08:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=vma X-HELO: mail-ua0-f180.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=fj5TvK2Sjm2Rpku/ti/ZxEaZ0lV6hOohq7QWsbYvZLQ=; b=gAdJe9ByfnCDYM8sbddJuaJO4wsbEln4LE5QV6ehJ7OcsyuHmkuagvSg7VoV9R7er4 hoMqiGJsKyGsdgC8mYEZaGOFM+T/ppxsQD4yVZN+8C5RNDhh1q+7zc9uzoQ5Iug73EOZ 7O0aGco1cF6dyQSMvxpANNcSPHITR/t1ZFLjuM8nRfw83pckZC0YfPwvMxs2/0fOjHhF 6nVRmnOu3bu0GuJ/kRJfyH+IOu90L1S3fjBNb7qT5BsgPKDrjtZD7Q2BxzNX/keJgdKk DRbjbHSXTo8iDWhBJ5OBK0wK+w0Cb1+k/WwBv5Rn9aDxZ8ubxWX9JfQHEsUYH/oVg6Oq gAQw== X-Gm-Message-State: AKaTC01DgxfUwM/dtlB8678V85fb7JJUC8dja4Fcl+u3ien2DYOmSzg4d56yoQNkVgJJdcRl X-Received: by 10.159.55.142 with SMTP id q14mr2416231uaq.107.1479398918180; Thu, 17 Nov 2016 08:08:38 -0800 (PST) Subject: Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, To: libc-alpha@sourceware.org References: <20161026150218.3F1A4439942E0@oldenburg.str.redhat.com> <11f59117-e5a4-4c62-739c-e05e01ee43b3@redhat.com> <1a524603-2966-df5a-edd9-8045aa256837@redhat.com> From: Adhemerval Zanella Message-ID: <468c5aa5-8ce2-7fa3-fa35-d665069f4ed9@linaro.org> Date: Thu, 17 Nov 2016 16:08:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00630.txt.bz2 On 17/11/2016 12:50, Steve Vormwald wrote: > On 11/17/2016 08:00 AM, Florian Weimer wrote: >> 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 make use of mtrace extensively when debugging oomkills on Cray > systems. Traditional memory leaks are typically not as big a problem as > heap fragmentation. Special hardware needs require non-default > mallopt settings, notably severly restricting use of mmap, so fragmentation > is a much larger problem for us than for many others. In my experience, > mtrace is lightweight enough to not noticeably perturb the heap structure > over the course of the program, usually allowing me to pinpoint which allocations > are leading to fragmentation. Heavier instrumentation, such as valgrind, > messes with it far too much to isolate which allocations from the application > are actually causing fragmentation when the instrumentation is not present, > making them much less useful to me. > >> In my proposed NEWS entry, I forgot to mention Address Sanitizer (as was >> pointed out in the GDB discussion). It has leak detection capabilities >> as well: >> >> ==7440==ERROR: LeakSanitizer: detected memory leaks >> >> Direct leak of 32 byte(s) in 1 object(s) allocated from: >> #0 0x7fc52f77097a in malloc (/lib64/libasan.so.2+0x9897a) >> #1 0x400703 in main (/tmp/a.out+0x400703) >> #2 0x7fc52f33757f in __libc_start_main (/lib64/libc.so.6+0x2057f) >> >> And it runs significantly faster than valgrind. > > Does it have a noticeable impact on the layout of the heap compared to > non-instrumented runs? Yes, since it is built on ASAN it uses an interposed malloc implementation and it also uses more VMA (as shadow memory for internal error detection).