From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 10 17:30:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4803B16A4CE for ; Sat, 10 Apr 2004 17:30:57 -0700 (PDT) Received: from smtp3.Stanford.EDU (smtp3.Stanford.EDU [171.67.16.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 201D443D39 for ; Sat, 10 Apr 2004 17:30:57 -0700 (PDT) (envelope-from tedu@stanford.edu) Received: from elaine29.Stanford.EDU (elaine29.Stanford.EDU [171.64.15.104]) by smtp3.Stanford.EDU (8.12.11/8.12.11) with ESMTP id i3B0Uqmp019614; Sat, 10 Apr 2004 17:30:53 -0700 Date: Sat, 10 Apr 2004 17:30:52 -0700 (PDT) From: Ted Unangst To: Brandon Erhart In-Reply-To: <6.0.2.0.2.20040409230629.01cc1ec0@mx1.erhartgroup.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD and Debugging? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2004 00:30:57 -0000 On Fri, 9 Apr 2004, Brandon Erhart wrote: > Are there any debuggers out there for BSD that will detect the heap/stack > corruption!? [standard disclaimer and note about self-promotion goes here :)] valgrind and electric fence are very good suggestions. my own personal pet project was adding guard pages to the system malloc. then linking malloc.conf -> AFGJ or setenv MALLOC_OPTIONS and you can find bugs in all the software you run. it's less complete than a dedicated heap checker, but lightweight enough (well, 20% penalty may not be light for some) that i run with it full time. we've had a fairly significant amount of success with it finding bugs in software that just happened to work. http://www.zeitbombe.org/patches/malloc_guard.diff should apply pretty cleanly to freebsd's malloc.c --