Saturday, May 27, 2006

Solaris dbx debugger - is it a bug ?

Today we were trying to attach a process to dbx debugger to check memory leaks and corruption. It was very difficult to figure out what was going on with dbx, most of the times dbx would complain "check -leaks not turned on" though it was turned on or would crash with SIGSEGV.

Tools Version: Studio 09
OS : Solaris 10

To reproduce the problem

setenv LD_AUDIT /rtcaudit.so
RUN THE APPLICATION
unsetenv LD_AUDIT

dbx a.out
dbx> check -all
dbx> attach
dbx> showleaks

However the following steps fixed the problem

setenv LD_AUDIT /rtcaudit.so
RUN THE APPLICATION
unsetenv LD_AUDIT

dbx - PID
dbx> check -all
dbx> cont
dbx> Ctrl-C
dbx> showleaks

In either ways its difficult to set LD_AUDIT because some of the application we debug may crash. So the better solution would be to prelink libumem.a which is a slab based alocator with REDZONEs. These REDZONEs make it easy for the detection of memory corruption. For a detailed usage of libumem to determine memory related issues please see the following URL

http://access1.sun.com/techarticles/libumem.html

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home