How to use libumem to find heap corruption, without relying on a 'core' file?

1.8k Views Asked by At

I want to know how to use libumem on solaris. If I follow http://www.unix.com/man-page/OpenSolaris/3malloc/umem_debug/ and start the process with all the options, how will I get the output?

Can I get a text file of the results?

I have used wdb on HP-UX for the same. This generates a text file after the program exits, that I can analyze later. Can I do that same for libumem?

Note: This is a remote debugging, I will not have access to the system until afterwards.

2

There are 2 best solutions below

3
On BEST ANSWER

You can create a core file of the process before it exits and examine the code with mdb later. One way to generate that core file at the right moment could be a dtrace script that will trigger the gcore just when exit is called.

0
On

I think libumem will generate a core when things goes wrong , you can analyze this core using mdb , certain commands like ::umem_status , umem_verify will help you in finding the corruption