|
From: Anoob S. <ano...@tu...> - 2004-03-30 13:41:50
|
Hi, I'm using Valgrind 2.0 to trace memory leakage of a UNIX daemon process. The parent daemon process exits and child daemon process listens to client's request and forks a new child for each incomming request. I ran Valgrind using command line: valgrind --leak-check=yes --trace-children=yes myserver My problem is that i've no way to trace child dameon and its childrens as both parent and valigring had already exited. Also I could not find any option to attach daemon process to valgrind. Is it possible to trace childrens of daemon without affecting daemon source code. Thanks for your help. regards Anoob |
|
From: Nicholas N. <nj...@ca...> - 2004-04-02 13:26:39
|
On Tue, 30 Mar 2004, Anoob Sadasivan wrote: > I'm using Valgrind 2.0 to trace memory leakage of a UNIX daemon process. The > parent daemon process exits and child daemon process listens to client's > request and forks a new child for each incomming request. I ran Valgrind > using command line: > > valgrind --leak-check=yes --trace-children=yes myserver > > My problem is that i've no way to trace child dameon and its childrens as > both parent and valigring had already exited. Also I could not find any > option to attach daemon process to valgrind. Is it possible to trace > childrens of daemon without affecting daemon source code. When a process is run "under" Valgrind, Valgrind becomes part of the process. With --trace-children=yes, Valgrind becomes part of all the children processes as well. So all the children processes should be getting traced; it won't matter if the parent finishes before the children do. All this applies equally to daemons as well as any other processes. I suspect the problem is that Valgrind sends its output by default to stderr. Is stderr of the children hooked up to the terminal or somewhere else sensible? If not, you can tell Valgrind to send its output elsewhere, with any of --logfile, --logfile=fd, --log-socket. N |