From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 28 19:37:29 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EADDC18 for ; Mon, 28 Jul 2014 19:37:29 +0000 (UTC) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [IPv6:2607:f8b0:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C57A282D for ; Mon, 28 Jul 2014 19:37:29 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id ij19so11968739vcb.39 for ; Mon, 28 Jul 2014 12:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xp8DqLT8afbpNpdJz/Lif95buajJ+dt1BpwhQzzc0f8=; b=P68nEk2ZcouScR1uQFaw9286JsXJQ78hWQEhFl9DeFgJ5blXfyEw1+pwax9lF1yUI0 gl606SgxKp3ASgg0IykiOS77lRi6Ew3bcma6H/TR45kz9zk+8hUPUC1fQxVx3CVNC1P0 ofefkJn33tINKIIfQ5/C7MBbO+M108ML9UmxDaP5flKDRJUKuwdBoLE6DIBrc94Uhj59 YzD3oTm61Cc5PYwQax1Lfy0sKspF9BWseD4xazIYwYPpE8WS6j8vrT/giWW3K+cftSTf B3IV9799dr5FZm1OlD1+QK+/LEnDletoRXh1cgjQGOb5m9g7CIr6Zi6gPy/7+dx9FO7P d+lQ== MIME-Version: 1.0 X-Received: by 10.52.1.39 with SMTP id 7mr3842837vdj.17.1406576248211; Mon, 28 Jul 2014 12:37:28 -0700 (PDT) Received: by 10.220.192.68 with HTTP; Mon, 28 Jul 2014 12:37:28 -0700 (PDT) In-Reply-To: <20140728191950.GA9781@dft-labs.eu> References: <20140728191950.GA9781@dft-labs.eu> Date: Mon, 28 Jul 2014 15:37:28 -0400 Message-ID: Subject: Re: Allocation/free history From: suresh gumpula To: Mateusz Guzik , suresh gumpula , "freebsd-hackers@freebsd.org" X-Mailman-Approved-At: Mon, 28 Jul 2014 20:04:54 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 19:37:29 -0000 Hi, I am aware of redone(9). I am talking about PC allocation history of objects. Do we have something like that ? Thanks Suresh On Mon, Jul 28, 2014 at 3:19 PM, Mateusz Guzik wrote: > On Mon, Jul 28, 2014 at 01:40:10PM -0400, suresh gumpula wrote: > > Hi, > > Knowing the PC of an allocation is very usefull in debugging. Having > the > > PC hash table and storing the pc hash either with an object itself( at > the > > end) or allocate an exra structure to hold the > > hash index help us find out who/where an object was allocated. We > > already have something like this in our own operating system and has > been a > > useful thing in debugging. > > BSD allocator uses power of 2, so storing at the end of an object might > be > > wasting lot of memory with large objects. > > > > It appears we don=E2=80=99t have something like this in current FBSD co= deline and > > would like to work on this ? Any comments please? > > > > > > It would be something like below. 8 bytes at the end of each object has > > fecepost which is usefull in finding overwrites and 2 hash indices to t= he > > PC table to track allocation history. > > (kgdb-amd64-7.4-87) x/40w 0xffffff153728b038 > > 0xffffff153728b038: 0xf6970a05 0x06cb7e0c 0x305a134a > > 0x831c18bb > > 0xc0000bed 0x134a2115 > > > > 0xffffff153728b050: 0x85687ef8 0xffffffff 0x00000001 > > 0x83192201 > > 0xc0000bed 0x1741143b > > > > See redzone(9). > > -- > Mateusz Guzik >