|
From: Tushar P. <pat...@gm...> - 2012-02-21 08:37:23
|
Hi, I am trying to test memory leak using valgrind. I tried valgrind to test memory leak in simple c++ program and able to test successfully. To test this I used the following command: valgrind --tool=memcheck --leak-check=yes ./myprog Now my problem is that how I can test memory leak using valgrind without running the program with valgrind command. The more description about my problem is as follows: I have written one sample application in c++ using fastcgi apache2 module and I want to test it for memory leak using valgrind. But my sample application was running under the apache2 server (means apache2 server itself create process for my fastcgi application) and it is not possible to attach this created process to valgrind, because we can't attach all-ready running process to valgrind as per valgrind documentation. So please let me know how I can test such type of application using valgrind or how I can make instrumental build with valgrind to test memory leak. Your help is greatly appreciated. Thanks & Regards, Tushar |
|
From: John R. <jr...@bi...> - 2012-02-21 14:05:56
|
> ... apache2 server itself create process for my fastcgi application > [which I want to run under valgrind] ... "Wrap" the fastcgi application inside a shell script which invokes valgrind on the app. Tell apache2 server to invoke that shell script instead of invoking the fastcgi app directly. -- |