|
From: Pallavi S. <shi...@gm...> - 2019-08-30 10:57:58
|
Hi, I need to run valgrind for ndmpd I followed below steps: 1. service ndmpd stop 2. service ndmpd start 3. valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log --leak-check=full /usr/local/ndmp/ndmpd echo $? Returns 1 after the 3rd command. The ps –ef output does not show the valgrind process listed. Questions: 1. Are these correct steps to follow? 2. How to verify that valgrind is running for ndmpd apart from logs? Is there any steps to verify it e.g matching PIDs etc ? System specification : CentOS 7.2.15.11 x86_64 Valgrind 3.10.0 NDMP 2.9.29. Thanks & Regards Pallavi Shinde |
|
From: John R. <jr...@bi...> - 2019-08-30 14:48:42
|
> 1. service ndmpd stop > 2. service ndmpd start > 3. valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log --leak-check=full /usr/local/ndmp/ndmpd > > echo $? Returns 1 after the 3rd command. Does running ndmpd "by hand" work as the third step? 3. /usr/local/ndmp/ndmpd & # start in background, note the PID 4. ps -ef # does ndmpd show with the same PID as given by the shell? If "service ndmpd start" does anything other than execute /usr/local/ndmp/ndmpd, then it may be necessary to add a level of indirection through a shell script that runs valgrind: 1. service ndmpd stop 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real 3. cat >/usr/local/ndmp/ndmpd <<!EOF! #!/bin/bash exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log --leak-check=full /usr/local/ndmp/ndmpd.real !EOF! 4. chmod +x /usr/local/ndmp/ndmpd 5. service ndmpd start -- |
|
From: Pallavi S. <shi...@gm...> - 2019-09-05 10:58:28
|
Hi, Comments prefixed with [PS] below. > 1. service ndmpd stop > 2. service ndmpd start > 3. valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log --leak-check=full /usr/local/ndmp/ndmpd > > echo $? Returns 1 after the 3rd command. Does running ndmpd "by hand" work as the third step? 3. /usr/local/ndmp/ndmpd & # start in background, note the PID 4. ps -ef # does ndmpd show with the same PID as given by the shell? [PS] In step 3, the process, if run by hand (/usr/local/ndmp/ndmpd &) exits immideiately. If "service ndmpd start" does anything other than execute /usr/local/ndmp/ndmpd, then it may be necessary to add a level of indirection through a shell script that runs valgrind: 1. service ndmpd stop 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real 3. cat >/usr/local/ndmp/ndmpd <<!EOF! #!/bin/bash exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log --leak-check=full /usr/local/ndmp/ndmpd.real !EOF! 4. chmod +x /usr/local/ndmp/ndmpd 5. service ndmpd start [PS] service ndmpd start FAILS to run using a wrapper. $ service ndmpd stop Stopping ndmpd: [ OK ] $ service ndmpd start Starting ndmpd: [FAILED] $ cat /usr/local/ndmp/ndmpd #!/bin/bash #/usr/local/ndmp/ndmpd.real exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_04_09.log --leak-check=full /usr/local/ndmp/ndmpd.real $ ps -ef | grep valgrind root 22481 1 0 11:38 ? 00:00:00 valgrind -v --num-callers=50 --log-file=ndmp_valgrind_04_09.log --leak-check=full /usr/local/ndmp/ndmpd.real root 23269 4513 0 11:42 pts/4 00:00:00 grep --color=auto valgrind $ ps -ef | grep ndmpd root 22481 1 0 11:38 ? 00:00:00 valgrind -v --num-callers=50 --log-file=ndmp_valgrind_04_09.log --leak-check=full /usr/local/ndmp/ndmpd.real root 23309 4513 0 11:42 pts/4 00:00:00 grep --color=auto ndmpd As per our observation ndmp internally starts session monitor. But in this case we were not able to see the session monitor and ndmp. Is there any other way to run valgrind on ndmp ? Thanks, Pallavi On Fri, Aug 30, 2019, 8:19 PM John Reiser <jr...@bi...> wrote: > > 1. service ndmpd stop > > 2. service ndmpd start > > 3. valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log > --leak-check=full /usr/local/ndmp/ndmpd > > > > echo $? Returns 1 after the 3rd command. > > Does running ndmpd "by hand" work as the third step? > 3. /usr/local/ndmp/ndmpd & # start in background, note the PID > 4. ps -ef # does ndmpd show with the same PID as given by the shell? > > If "service ndmpd start" does anything other than execute > /usr/local/ndmp/ndmpd, > then it may be necessary to add a level of indirection through a shell > script > that runs valgrind: > > 1. service ndmpd stop > 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real > 3. cat >/usr/local/ndmp/ndmpd <<!EOF! > #!/bin/bash > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log > --leak-check=full /usr/local/ndmp/ndmpd.real > !EOF! > 4. chmod +x /usr/local/ndmp/ndmpd > 5. service ndmpd start > > -- > > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Pallavi S. <shi...@gm...> - 2019-09-09 06:08:23
|
Hi, Can we get any help here ? Thanks, Pallavi On Thu, Sep 5, 2019, 4:28 PM Pallavi Shinde <shi...@gm...> wrote: > Hi, > > Comments prefixed with [PS] below. > > > 1. service ndmpd stop > > 2. service ndmpd start > > 3. valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log > --leak-check=full /usr/local/ndmp/ndmpd > > > > echo $? Returns 1 after the 3rd command. > > Does running ndmpd "by hand" work as the third step? > 3. /usr/local/ndmp/ndmpd & # start in background, note the PID > 4. ps -ef # does ndmpd show with the same PID as given by the shell? > > [PS] In step 3, the process, if run by hand (/usr/local/ndmp/ndmpd &) > exits immideiately. > > If "service ndmpd start" does anything other than execute > /usr/local/ndmp/ndmpd, > then it may be necessary to add a level of indirection through a shell > script > that runs valgrind: > > 1. service ndmpd stop > 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real > 3. cat >/usr/local/ndmp/ndmpd <<!EOF! > #!/bin/bash > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log > --leak-check=full /usr/local/ndmp/ndmpd.real > !EOF! > 4. chmod +x /usr/local/ndmp/ndmpd > 5. service ndmpd start > > [PS] service ndmpd start FAILS to run using a wrapper. > > $ service ndmpd stop > Stopping ndmpd: [ OK ] > > $ service ndmpd start > Starting ndmpd: [FAILED] > > $ cat /usr/local/ndmp/ndmpd > #!/bin/bash > #/usr/local/ndmp/ndmpd.real > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_04_09.log > --leak-check=full /usr/local/ndmp/ndmpd.real > > $ ps -ef | grep valgrind > root 22481 1 0 11:38 ? 00:00:00 valgrind -v > --num-callers=50 --log-file=ndmp_valgrind_04_09.log --leak-check=full > /usr/local/ndmp/ndmpd.real > root 23269 4513 0 11:42 pts/4 00:00:00 grep --color=auto valgrind > > $ ps -ef | grep ndmpd > root 22481 1 0 11:38 ? 00:00:00 valgrind -v > --num-callers=50 --log-file=ndmp_valgrind_04_09.log --leak-check=full > /usr/local/ndmp/ndmpd.real > root 23309 4513 0 11:42 pts/4 00:00:00 grep --color=auto ndmpd > > As per our observation ndmp internally starts session monitor. But in > this case we were not able to see the session monitor and ndmp. > > Is there any other way to run valgrind on ndmp ? > > Thanks, > Pallavi > > On Fri, Aug 30, 2019, 8:19 PM John Reiser <jr...@bi...> wrote: > >> > 1. service ndmpd stop >> > 2. service ndmpd start >> > 3. valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log >> --leak-check=full /usr/local/ndmp/ndmpd >> > >> > echo $? Returns 1 after the 3rd command. >> >> Does running ndmpd "by hand" work as the third step? >> 3. /usr/local/ndmp/ndmpd & # start in background, note the PID >> 4. ps -ef # does ndmpd show with the same PID as given by the shell? >> >> If "service ndmpd start" does anything other than execute >> /usr/local/ndmp/ndmpd, >> then it may be necessary to add a level of indirection through a shell >> script >> that runs valgrind: >> >> 1. service ndmpd stop >> 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real >> 3. cat >/usr/local/ndmp/ndmpd <<!EOF! >> #!/bin/bash >> exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log >> --leak-check=full /usr/local/ndmp/ndmpd.real >> !EOF! >> 4. chmod +x /usr/local/ndmp/ndmpd >> 5. service ndmpd start >> >> -- >> >> >> >> _______________________________________________ >> Valgrind-users mailing list >> Val...@li... >> https://lists.sourceforge.net/lists/listinfo/valgrind-users >> > |
|
From: Tom H. <to...@co...> - 2019-09-09 07:31:11
|
Probably not unless there happens to be somebody here that is familiar with "ndmpd" and how it starts up. You need to make sure that valgrind manages to wind up running the actual daemon so if there is some kind of launcher process that starts it then you need to try and avoid that and start the daemon directly. Many daemons have some kind of switch to do exactly that for debugging purpose, but you are probably more familiar with this program and how it starts than anybody here. You can also try --trace-children=yes but that will follow across all execs not just the one you are interested in. Tom On 09/09/2019 07:08, Pallavi Shinde wrote: > Hi, > Can we get any help here ? > > Thanks, > Pallavi > > On Thu, Sep 5, 2019, 4:28 PM Pallavi Shinde <shi...@gm... > <mailto:shi...@gm...>> wrote: > > Hi, > > Comments prefixed with [PS] below. > > > 1. service ndmpd stop > > 2. service ndmpd start > > 3. valgrind -v --num-callers=50 > --log-file=ndmp_valgrind_30_8.log --leak-check=full > /usr/local/ndmp/ndmpd > > > > echo $? Returns 1 after the 3rd command. > > Does running ndmpd "by hand" work as the third step? > 3. /usr/local/ndmp/ndmpd & # start in background, note the PID > 4. ps -ef # does ndmpd show with the same PID as given by the shell? > > [PS] In step 3, the process, if run by hand (/usr/local/ndmp/ndmpd > &) exits immideiately. > > If "service ndmpd start" does anything other than execute > /usr/local/ndmp/ndmpd, > then it may be necessary to add a level of indirection through a > shell script > that runs valgrind: > > 1. service ndmpd stop > 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real > 3. cat >/usr/local/ndmp/ndmpd <<!EOF! > #!/bin/bash > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log > --leak-check=full /usr/local/ndmp/ndmpd.real > !EOF! > 4. chmod +x /usr/local/ndmp/ndmpd > 5. service ndmpd start > > [PS] service ndmpd start FAILS to run using a wrapper. > > $ service ndmpd stop > Stopping ndmpd: [ OK ] > > $ service ndmpd start > Starting ndmpd: [FAILED] > > $ cat /usr/local/ndmp/ndmpd > #!/bin/bash > #/usr/local/ndmp/ndmpd.real > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_04_09.log > --leak-check=full /usr/local/ndmp/ndmpd.real > > $ ps -ef | grep valgrind > root 22481 1 0 11:38 ? 00:00:00 valgrind -v > --num-callers=50 --log-file=ndmp_valgrind_04_09.log > --leak-check=full /usr/local/ndmp/ndmpd.real > root 23269 4513 0 11:42 pts/4 00:00:00 grep --color=auto > valgrind > > $ ps -ef | grep ndmpd > root 22481 1 0 11:38 ? 00:00:00 valgrind -v > --num-callers=50 --log-file=ndmp_valgrind_04_09.log > --leak-check=full /usr/local/ndmp/ndmpd.real > root 23309 4513 0 11:42 pts/4 00:00:00 grep --color=auto ndmpd > > As per our observation ndmp internally starts session monitor. But > in this case we were not able to see the session monitor and ndmp. > > Is there any other way to run valgrind on ndmp ? > > Thanks, > Pallavi > > On Fri, Aug 30, 2019, 8:19 PM John Reiser <jr...@bi... > <mailto:jr...@bi...>> wrote: > > > 1. service ndmpd stop > > 2. service ndmpd start > > 3. valgrind -v --num-callers=50 > --log-file=ndmp_valgrind_30_8.log --leak-check=full > /usr/local/ndmp/ndmpd > > > > echo $? Returns 1 after the 3rd command. > > Does running ndmpd "by hand" work as the third step? > 3. /usr/local/ndmp/ndmpd & # start in background, note the PID > 4. ps -ef # does ndmpd show with the same PID as given by the > shell? > > If "service ndmpd start" does anything other than execute > /usr/local/ndmp/ndmpd, > then it may be necessary to add a level of indirection through a > shell script > that runs valgrind: > > 1. service ndmpd stop > 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real > 3. cat >/usr/local/ndmp/ndmpd <<!EOF! > #!/bin/bash > exec valgrind -v --num-callers=50 > --log-file=ndmp_valgrind_30_8.log --leak-check=full > /usr/local/ndmp/ndmpd.real > !EOF! > 4. chmod +x /usr/local/ndmp/ndmpd > 5. service ndmpd start > > -- > > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > <mailto:Val...@li...> > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > -- Tom Hughes (to...@co...) http://compton.nu/ |
|
From: Pallavi S. <shi...@gm...> - 2019-09-12 09:45:47
|
Hi, Thank you for your comments. We ran valgrind on ndmp by inserting the valgrind command within /etc/init.d/ndmpd, the script that starts ndmpd. valgrind did indeed run on ndmpd and we did get a memory check report, but it didn't keep itself attached to ndmpd. valgrind dumps the memory check log and exits. The exit status is '1'. Don't know how to 'keep valgrind attached' to ndmpd. Would there be any guidance on how to keep valgrind attached to ndmp? Thanks, Pallavi On Mon, Sep 9, 2019, 12:44 PM Tom Hughes <to...@co...> wrote: > Probably not unless there happens to be somebody here > that is familiar with "ndmpd" and how it starts up. > > You need to make sure that valgrind manages to wind > up running the actual daemon so if there is some kind > of launcher process that starts it then you need to > try and avoid that and start the daemon directly. > > Many daemons have some kind of switch to do exactly > that for debugging purpose, but you are probably more > familiar with this program and how it starts than > anybody here. > > You can also try --trace-children=yes but that will > follow across all execs not just the one you are > interested in. > > Tom > > On 09/09/2019 07:08, Pallavi Shinde wrote: > > Hi, > > Can we get any help here ? > > > > Thanks, > > Pallavi > > > > On Thu, Sep 5, 2019, 4:28 PM Pallavi Shinde <shi...@gm... > > <mailto:shi...@gm...>> wrote: > > > > Hi, > > > > Comments prefixed with [PS] below. > > > > > 1. service ndmpd stop > > > 2. service ndmpd start > > > 3. valgrind -v --num-callers=50 > > --log-file=ndmp_valgrind_30_8.log --leak-check=full > > /usr/local/ndmp/ndmpd > > > > > > echo $? Returns 1 after the 3rd command. > > > > Does running ndmpd "by hand" work as the third step? > > 3. /usr/local/ndmp/ndmpd & # start in background, note the PID > > 4. ps -ef # does ndmpd show with the same PID as given by the > shell? > > > > [PS] In step 3, the process, if run by hand (/usr/local/ndmp/ndmpd > > &) exits immideiately. > > > > If "service ndmpd start" does anything other than execute > > /usr/local/ndmp/ndmpd, > > then it may be necessary to add a level of indirection through a > > shell script > > that runs valgrind: > > > > 1. service ndmpd stop > > 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real > > 3. cat >/usr/local/ndmp/ndmpd <<!EOF! > > #!/bin/bash > > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_30_8.log > > --leak-check=full /usr/local/ndmp/ndmpd.real > > !EOF! > > 4. chmod +x /usr/local/ndmp/ndmpd > > 5. service ndmpd start > > > > [PS] service ndmpd start FAILS to run using a wrapper. > > > > $ service ndmpd stop > > Stopping ndmpd: [ OK ] > > > > $ service ndmpd start > > Starting ndmpd: [FAILED] > > > > $ cat /usr/local/ndmp/ndmpd > > #!/bin/bash > > #/usr/local/ndmp/ndmpd.real > > exec valgrind -v --num-callers=50 --log-file=ndmp_valgrind_04_09.log > > --leak-check=full /usr/local/ndmp/ndmpd.real > > > > $ ps -ef | grep valgrind > > root 22481 1 0 11:38 ? 00:00:00 valgrind -v > > --num-callers=50 --log-file=ndmp_valgrind_04_09.log > > --leak-check=full /usr/local/ndmp/ndmpd.real > > root 23269 4513 0 11:42 pts/4 00:00:00 grep --color=auto > > valgrind > > > > $ ps -ef | grep ndmpd > > root 22481 1 0 11:38 ? 00:00:00 valgrind -v > > --num-callers=50 --log-file=ndmp_valgrind_04_09.log > > --leak-check=full /usr/local/ndmp/ndmpd.real > > root 23309 4513 0 11:42 pts/4 00:00:00 grep --color=auto > ndmpd > > > > As per our observation ndmp internally starts session monitor. But > > in this case we were not able to see the session monitor and ndmp. > > > > Is there any other way to run valgrind on ndmp ? > > > > Thanks, > > Pallavi > > > > On Fri, Aug 30, 2019, 8:19 PM John Reiser <jr...@bi... > > <mailto:jr...@bi...>> wrote: > > > > > 1. service ndmpd stop > > > 2. service ndmpd start > > > 3. valgrind -v --num-callers=50 > > --log-file=ndmp_valgrind_30_8.log --leak-check=full > > /usr/local/ndmp/ndmpd > > > > > > echo $? Returns 1 after the 3rd command. > > > > Does running ndmpd "by hand" work as the third step? > > 3. /usr/local/ndmp/ndmpd & # start in background, note the PID > > 4. ps -ef # does ndmpd show with the same PID as given by the > > shell? > > > > If "service ndmpd start" does anything other than execute > > /usr/local/ndmp/ndmpd, > > then it may be necessary to add a level of indirection through a > > shell script > > that runs valgrind: > > > > 1. service ndmpd stop > > 2. mv /usr/local/ndmp/ndmpd /usr/local/ndmp/ndmpd.real > > 3. cat >/usr/local/ndmp/ndmpd <<!EOF! > > #!/bin/bash > > exec valgrind -v --num-callers=50 > > --log-file=ndmp_valgrind_30_8.log --leak-check=full > > /usr/local/ndmp/ndmpd.real > > !EOF! > > 4. chmod +x /usr/local/ndmp/ndmpd > > 5. service ndmpd start > > > > -- > > > > > > > > _______________________________________________ > > Valgrind-users mailing list > > Val...@li... > > <mailto:Val...@li...> > > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > > > > > > > _______________________________________________ > > Valgrind-users mailing list > > Val...@li... > > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > > > > -- > Tom Hughes (to...@co...) > http://compton.nu/ > |
|
From: Eliot M. <mo...@cs...> - 2019-09-12 13:00:56
|
On 9/12/2019 5:45 AM, Pallavi Shinde wrote: > We ran valgrind on ndmp by inserting the valgrind command within /etc/init.d/ndmpd, the script that > starts ndmpd. > > valgrind did indeed run on ndmpd and we did get a memory check report, but it didn't keep itself > attached to ndmpd. valgrind dumps the memory check log and exits. The exit status is '1'. Don't know > how to 'keep valgrind attached' to ndmpd. > > Would there be any guidance on how to keep valgrind attached to ndmp? What do you mean by "keep itself attached"? From what you say, it sounds as if ndmpd ran and finished, so naturally valgrind finished. Everything went as you asked. Do you mean that you want all runs of ndmpd to be done under valgrind, including future ones, not just the one kicked off in the init.d script? If so, then one way I can think of to do it is: - rename ndmpd, to, say, ndmpd.bin (for binary) - write a script called ndmpd that does: valgrind ndmpd.bin $* - make sure the script is executable, on the path, etc. Then when ndmpd is launched, you'll launch valgrind on the original ndmpd program. This is not so much a "valgrind thing" as a "how to do something on linux" thing ... Maybe somebody can think of even nicer ways to do this. Regards - Eliot Moss |
|
From: Tom H. <to...@co...> - 2019-09-12 13:34:21
|
On 12/09/2019 14:00, Eliot Moss wrote: > On 9/12/2019 5:45 AM, Pallavi Shinde wrote: > >> We ran valgrind on ndmp by inserting the valgrind command within >> /etc/init.d/ndmpd, the script that starts ndmpd. >> >> valgrind did indeed run on ndmpd and we did get a memory check report, >> but it didn't keep itself attached to ndmpd. valgrind dumps the memory >> check log and exits. The exit status is '1'. Don't know how to 'keep >> valgrind attached' to ndmpd. >> >> Would there be any guidance on how to keep valgrind attached to ndmp? > > What do you mean by "keep itself attached"? > > From what you say, it sounds as if ndmpd ran and finished, so naturally > valgrind finished. Everything went as you asked. As I explained at some length in my previous email what almost certainly happened is that ndmpd did what most daemons do, and forked itself into the background with the original process then exiting. Now because valgrind follows fork (but not exec) by default it would normally still follow the other process so I'm guessing that it actually re-execed, or execed some other program. Pallavi is the one debugging ndmpd though so I would hope he knows more abut how it starts up than we do! So, to repeat myself, either find a way to stop it forking like that, or find what it is execing and run that directly, or try --trace-children=yes to make valgrind follow exec. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |