Re: Running Valgrind on ndmp

Tom Hughes <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
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 <[email protected] 
> <mailto:[email protected]>> 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 <[email protected]
>     <mailto:[email protected]>> 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
>         [email protected]
>         <mailto:[email protected]>
>         https://lists.sourceforge.net/lists/listinfo/valgrind-users
> 
> 
> 
> _______________________________________________
> Valgrind-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
> 


-- 
Tom Hughes ([email protected])
http://compton.nu/


_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.