From owner-freebsd-hackers Tue Jun 5 4:17:53 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from dt051n37.san.rr.com (dt051n37.san.rr.com [204.210.32.55]) by hub.freebsd.org (Postfix) with ESMTP id B1A4637B403 for ; Tue, 5 Jun 2001 04:17:50 -0700 (PDT) (envelope-from DougB@DougBarton.net) Received: from DougBarton.net (master [10.0.0.2]) by dt051n37.san.rr.com (8.9.3/8.9.3) with ESMTP id EAA23454 for ; Tue, 5 Jun 2001 04:17:50 -0700 (PDT) (envelope-from DougB@DougBarton.net) Message-ID: <3B1CBFDE.A16162E5@DougBarton.net> Date: Tue, 05 Jun 2001 04:17:50 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: (Interesting?) malloc debugging project Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Since people are always saying that they want interesting projects, I thought I'd throw this one out there. The default malloc settings of AJ (man malloc for more details) have uncovered two bugs in one of my ports, xscreensaver. The port consists of a server that handles screen control, (auto)locking, random screensaver rotation, etc.; and a set of helper programs, including the preferences menu and the various seperate screensaver programs themselves. The bugs are in the preferences menu (the xscreensaver-demo binary) and the screensaver called interference. In the case of the former, the first time you start the menu it creates an .xscreensaver config file in your home directory. Usually you can run it the first time cleanly, however the second time I start it every time I click an option it cores. As far as I can tell it's overflowing one of the buffers used by the conf file parsing routine as its reading in the file, but I haven't been able to track it all the way down. The interference screensaver just dumps core as soon as it's run. It seems to be sending a bad variable to the drawrectangle function in one of the X libs, but I didn't get very far with this one either. I was able to verify that it was the J option to malloc that did the damage by doing 'ln -s j /etc/malloc.conf' then running them again. Unfortunately, I don't really have a lot of time to track these bugs down right now, so if someone wants to tackle this, I'll be grateful for the help. I have a good relationship with the author, and he's already included one of our patches into his distributed code, so I'm confident that if you find a genuine bug he'd be grateful as well. Please let me know what you find. If you want me to pass it to the author I'll be sure to give you credit, of course. You can install a debug version of the script by setting your CFLAGS in make.conf to -O -g -pipe, and doing 'make STRIP='' install' in the port directory. If you're on -stable and want to give this a try, you should be able to reproduce conditions close enough to -current by doing 'ln -s AJ /etc/malloc.conf'. Doug To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message