简体   繁体   中英

Running valgrind on a C++ module hosted on apache

I have a C++ library (sort of server) hosted on Apache server. I want to run valgrind on it. So please guide on me how can I do so.

I have tried below command. Does this looks fine because I can't see valgrind checking my C++ module hosted on apache. Please be noted that all the required module name details are already provided and below command is what i am using to run valgrind while starting apache server.

valgrind --leak-check=full --show-reachable=yes --tool=memcheck --log-file=val.log /etc/init.d/httpd24-httpd start

valgrind --leak-check=full --show-reachable=yes --tool=memcheck --log-file=val.log /etc/init.d/httpd24-httpd start

Valgrind must be executed with a binary file to inspect. `httpd24-httpd' here is simply a wrapper which starts Apache in the background mode. That's why the way you start valgrind will show you nothing.

For being able to achieve your task, you should start Apache in a foreground. I am not familiar with Apache well but seems your command line should look smth like this:

valgrind --leak-check=full --show-reachable=yes --tool=memcheck --log-file=val.log /usr/sbin/httpd -DFOREGROUND

Here `/usr/sbin/httpd' is a binary of Apache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM