FreeBSD and Debugging?

Brandon Erhart berhart at ErhartGroup.COM
Fri Apr 9 22:11:48 PDT 2004


Hi,

I've been writing an application for some time now, and I seem to have 
introduced some kind of bug that is smashing the stack or the heap 
*somewhere*. One of my variables (or more) are being changed, and the 
program relies on this being set to the last time data was read from a 
socket. It's getting reset to 0 for some odd, odd reason. But enough of my 
whining. My code, my problems.

What isn't my problem, though, and is probably a lot of people's problem, 
is the lack of a *good* debugger for BSD. I know gdb is pretty good, and it 
does help me often, but I can't seem to find a debugger that will detect 
under/over reads/writes in the heap and/or stack (bounds checking).

I had downloaded the bounds checking gcc, it compiled fine, but I get an 
error that doesn't allow it to run on FreeBSD 4.9 (w/ gcc-2.95.2) -- 
something about ulimit not being found. I checked Google, and of course, 
found nothing. I didn't bother enough to look any deeper than that.

For Linux, I've seen valgrind (probably one of the best) as well as several 
others. In the commercial arena, Rational's PURIFY and Parasoft's INSURE++ 
work on every OS *but* BSD. Any particular reason for this?

Are there any debuggers out there for BSD that will detect the heap/stack 
corruption!?

Thanks in advance for you support,

Brandon



More information about the freebsd-hackers mailing list