From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 28 19:20:25 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 A1E764EC for ; Mon, 28 Jul 2014 19:20:25 +0000 (UTC) Received: from mail-qa0-x232.google.com (mail-qa0-x232.google.com [IPv6:2607:f8b0:400d:c00::232]) (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 62DAC265E for ; Mon, 28 Jul 2014 19:20:25 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id s7so8343475qap.37 for ; Mon, 28 Jul 2014 12:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=MXRftp7KiG7FZIbshw+B84EBbgvQbUV3jp7YIAu73Pk=; b=E/fHS7Sx9j63vFmXJOZTo/pVoQU9lneTgdJ0uHpMHV2hjswlf69DmHXI/QOdmljeWT H/SXTIntAxFkyUVvwonQKUE2oIN0PJMnuWBpODsLtqpEb/QDAgPH0ZDQTmCXJVVbOHk1 xHIlGmYgVVejnn5/KqoBUdBK4osGY3Fesn5pvO/NI8uABR+p8XrerrOMdVhZpVsG7dBb oBWCUI67c28ArmNWbI0zsiSNp0bLlHhhghCgEq4fs+20FhG5Avbik0pe+G929SDTqA24 gfHLE2UWUZ4Q2k03YRlcOk/u5yayc9ZXpmDlhT7PqR/d+B5BCZq5fNEe0dqoPkNPLOPp ZNug== MIME-Version: 1.0 X-Received: by 10.224.71.198 with SMTP id i6mr63568561qaj.76.1406575224489; Mon, 28 Jul 2014 12:20:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Mon, 28 Jul 2014 12:20:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Jul 2014 12:20:24 -0700 X-Google-Sender-Auth: D-WwL3xhjUncZw2VLrajKMQV2mc Message-ID: Subject: Re: Allocation/free history From: Adrian Chadd To: suresh gumpula Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" 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:20:25 -0000 Hi! Are you talking about userland? kernel? both? -a On 28 July 2014 10:40, suresh gumpula wrote: > Hi, > Knowing the PC of an allocation is very usefull in debugging. Having t= he > PC hash table and storing the pc hash either with an object itself( at t= he > 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 b= e > wasting lot of memory with large objects. > > It appears we don=E2=80=99t have something like this in current FBSD code= line 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 the > 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 > > Thanks > Suresh > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= "