Search code examples
c++memorysolarislibumem

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


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.


Solution

  • 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.