From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7303 invoked from network); 23 Jun 2021 03:52:17 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 23 Jun 2021 03:52:17 -0000 Received: (qmail 19626 invoked by uid 550); 23 Jun 2021 03:52:13 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 19606 invoked from network); 23 Jun 2021 03:52:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yWHJRijReGm0u0q6VD2KEDh1bdb6nkcJqnQcZUsSa+Q=; b=lx6jlMhZWSq3SGOexngOHtAc2AU5rSigoYXj1GG5k8MCr9cxu8Gk3rMLAqnmt/rLuB G4SnekHgbCs5Nqi1qyvfT+4WU226rpxM5Deajmd17orSvaXAg4cHv8pXQTmFATMcqSLr 2s2Z/Fjze9t2G61xN0DaW2/iwxnK/9TQQy7Asy3q9U6JmS7HvjlwXvMPODs5MC3hobZm 1jT5G0WJvbwF8dIPlZ6xk+TTIo8ke8I+6uvm9N3VO9fvCLiyDJHUbrx0MigZl+qLxGaN PWz1+U6htXYsgQ3EDJmdobrz9aQ9y1lq1HGAGrRlos7HU0QD+TS1pJGfszefVhRFVCbk LF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yWHJRijReGm0u0q6VD2KEDh1bdb6nkcJqnQcZUsSa+Q=; b=Ixmb+Ozyp9ay3+3tdVpQHV5XhQ0sgArbaotvaw2klr0SxsXFyXDTq6X+ixXOza86WO fLllGHP7oGEQ5bsHeocazR/0tQLNIKUFhULNcuOSOyVNmkQ4ehDhNQx8TVBwkhLZ/gra 8HNBgmbFHOQZj1/94/l1nbOs98rLRUraef8ZrJrECclPsi+v/XYyFQBi2wo3rCOg4dca uK9XGYNnEUZtTdG6VQRvqF8b6drUmSRRCBzC6SQqwsAe94HIOrJr2s+GlnrkDlDY+1Dk c6EGHDkL0haG+vqTCXI6BSsV8CBj9k1NcQHe+/vU9sG7KdAcaKTFF0X7kNh4vQKEp7MX LREA== X-Gm-Message-State: AOAM532fg7zzreyEONARx9YGqnugW1lHNNw7k0A9abIpG2cuIePeV7Nn xELsk0IT+EI84QvuYhRLenB8JprBtrTE48XYl6M= X-Google-Smtp-Source: ABdhPJwx/qoxz9YgrIJWFDKDFD6Ww/8fEJZOboSQvkxRvfxDJJdb0iaQfNqCWDvgj/aQx6b7/7zQmDqvKbPatVO0ppw= X-Received: by 2002:a25:df42:: with SMTP id w63mr9001238ybg.185.1624420320747; Tue, 22 Jun 2021 20:52:00 -0700 (PDT) MIME-Version: 1.0 References: <20210605155053.GF13220@brightrain.aerifal.cx> In-Reply-To: <20210605155053.GF13220@brightrain.aerifal.cx> From: Srinivasan J Date: Wed, 23 Jun 2021 09:21:49 +0530 Message-ID: To: Rich Felker Cc: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Dumping process heap from the core file Hi Rich, Thank you for replying. Unfortunately, I need to debug a core which used musl-libc version v1.1.24 to get details about size of allocations in the heap. I see that mal.heap is no longer valid since 2015 [commit e3bc22f1eff87b8f029a6ab31f1a269d69e4b053]. So as you said the only way to walk the heap would be using a patched libc.so? Please do share any pointers. Reference: https://patchwork.criu.org/patch/10472/ Regards, Srini On Sat, Jun 5, 2021 at 9:20 PM Rich Felker wrote: > > On Thu, Jun 03, 2021 at 07:39:54AM +0530, Srinivasan J wrote: > > Hi, > > Is there an easy way to dump the heap from the process core which > > is using musl-libc? The process is using musl-libc version v1.1.24. I > > see that there is a _dump_heap() function, but that's not up to date. > > I am thinking about using _dump_heap() as reference. But any other > > suggestions are welcome. > > The mallocng heap structures are actually more walkable. There is > intentionally no public interface for doing this, but I have some > debug code left over from development that you could link into > static-linked programs with a particular known musl/mallocng version > or patch into libc.so for debugging purposes. I'll dig it up and post > it. Ping me if I forget about it. > > Rich