Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jun 2001 04:17:50 -0700
From:      Doug Barton <DougB@DougBarton.net>
To:        freebsd-hackers@freebsd.org
Subject:   (Interesting?) malloc debugging project
Message-ID:  <3B1CBFDE.A16162E5@DougBarton.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B1CBFDE.A16162E5>