Hi, I am new to valgrind. I am trying to debug my web application (testwtdbg.wt) using valgrind. But there is a mismatch between the FIFO name valgrind generates and the FIFO vgdb tries to use. I am using a FastCGI (Apache's mod_fcgid) application developed using Wt (www.webtoolkit.eu). Valgrind is not directly invoked by me. Instead I specify the valgrind command and its options in a Wt configuration file (wt_config.xml) and Wt then prepends this command to the application before launching it using execve system call. Here are the commands issued to use valgrind and the corresponding output:
*A] A.1. Command to start valgrind and web-application "testwtdbg.wt" (this command is issued, using system call execve, by Wt framework in the context of Apache webserver): /usr/local/bin/valgrind -v --trace-children=yes --vgdb=full --vgdb-error=0 /var/www/html/plug/docroot/testwtdbg.wt <<additional parameters of the application/Wt>> A.2. Log messages (Apache log messages): [root@playground build]# cat /var/log/httpd/error_log [Sat Apr 14 13:15:51 2012] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0 [Sat Apr 14 13:15:51 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sat Apr 14 13:15:51 2012] [notice] Digest: generating secret for digest authentication ... [Sat Apr 14 13:15:51 2012] [notice] Digest: done [Sat Apr 14 13:15:51 2012] [notice] Apache/2.2.22 (Unix) DAV/2 mod_fcgid/2.3.6 configured -- resuming normal operations [2012-Apr-14 13:16:35.383695] 6022 - [info] "WServer/wtfcgi: initializing relay server" [2012-Apr-14 13:16:35.387222] 6022 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/html/plug/docroot/testwtdbg.wt')" [2012-Apr-14 13:16:35.389108] 6022 - [info] "wtfcgi: reading FastCGI stream from stdin" [2012-Apr-14 13:16:35.398416] 6022 - [info] "wtfcgi: spawned dedicated process for ZHUb9FY39csyCLdY: pid=6164" ==6164== Memcheck, a memory error detector ==6164== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==6164== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==6164== Command: /var/www/html/plug/docroot/testwtdbg.wt client ZHUb9FY39csyCLdY ==6164== --6164-- Valgrind options: --6164-- -v --6164-- --trace-children=yes --6164-- --vgdb=full --6164-- --vgdb-error=0 --6164-- Contents of /proc/version: --6164-- Linux version 3.3.1-3.fc16.x86_64 (mockbu...@x86-12.phx2.fedoraproject.org) (gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC) ) #1 SMP Wed Apr 4 18:08:51 UTC 2012 --6164-- Arch and hwcaps: AMD64, amd64-sse3 --6164-- Page sizes: currently 4096, max supported 4096 --6164-- Valgrind library directory: /usr/local/lib/valgrind --6164-- Reading syms from /var/www/html/plug/docroot/testwtdbg.wt (0x400000) --6164-- Reading syms from /usr/local/lib/valgrind/memcheck-amd64-linux (0x38000000) --6164-- object doesn't have a dynamic symbol table --6164-- Reading syms from /lib64/ld-2.14.90.so (0x3d26200000) --6164-- Reading suppressions file: /usr/local/lib/valgrind/default.supp ==6164== (action at startup) vgdb me ... ==6164== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-6164-by-???-on-??? ==6164== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-6164-by-???-on-??? ==6164== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-6164-by-???-on-??? ==6164== ==6164== TO CONTROL THIS PROCESS USING vgdb (which you probably ==6164== don't want to do, unless you know exactly what you're doing, ==6164== or are doing some strange experiment): ==6164== /usr/local/lib/valgrind/../../bin/vgdb --pid=6164 ...command... ==6164== ==6164== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==6164== /path/to/gdb /var/www/html/plug/docroot/testwtdbg.wt ==6164== and then give GDB the following command ==6164== target remote | /usr/local/lib/valgrind/../../bin/vgdb --pid=6164 ==6164== --pid is optional if only one valgrind process is running ==6164== *B] B.1. Check the FIFOs created by valgrind gdbserver: [root@playground build]# ls -la /tmp/ drwxrwxrwt. 37 root root 4096 Apr 14 14:13 . dr-xr-xr-x. 22 root root 4096 Apr 13 00:18 .. drwxrwxrwt. 2 root root 4096 Apr 13 00:30 .font-unix drwxrwxrwt. 2 root root 4096 Apr 14 11:56 .ICE-unix -rw-------. 1 root root 0 Apr 13 00:41 tmpDjwfid prw-r--r--. 1 apache apache 0 Apr 14 13:18 vgdb-pipe-from-vgdb-to-6164-by-???-on-??? -rw-r--r--. 1 apache apache 48 Apr 14 13:18 vgdb-pipe-shared-mem-vgdb-6164-by-???-on-??? prw-r--r--. 1 apache apache 0 Apr 14 13:18 vgdb-pipe-to-vgdb-from-6164-by-???-on-??? -r--r--r--. 1 root root 11 Apr 14 11:56 .X0-lock drwxrwxrwt. 2 root root 4096 Apr 14 11:56 .X11-unix drwxrwxrwt. 2 root root 4096 Apr 13 00:30 .XIM-unix *C] C.1 Start GDB to connect to the valgrind gdbserver: [root@playground build]# gdb /var/www/html/plug/docroot/testwtdbg.wt GNU gdb (GDB) Fedora (7.3.50.20110722-13.fc16) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /var/www/html/plug/docroot/testwtdbg.wt...done. (gdb) target remote | vgdb --pid=6164 Remote debugging using | vgdb --pid=6164 syscall failed: No such file or directory error opening /tmp/vgdb-pipe-shared-mem-vgdb-6164-by-plug-on-playground.fc16 shared memory file Remote communication error. Target disconnected.: Connection reset by peer. (gdb) *D] D.1 Check the FIFO information using vgdb: [root@playground build]# vgdb -d -d -d help --pid=6164 1334405920.781999 searching pid in directory /tmp/ format /tmp/vgdb-pipe-from-vgdb-to- 1334405920.782175 check_trial 0 1334405920.782662 trying /tmp/.X0-lock 1334405920.783015 trying /tmp/vgdb-pipe-shared-mem-vgdb-6164-by-???-on-??? 1334405920.786167 trying /tmp/.X11-unix 1334405920.786233 trying /tmp/tmpDjwfid 1334405920.786660 trying /tmp/.font-unix 1334405920.786901 trying /tmp/.ICE-unix 1334405920.787175 trying /tmp/vgdb-pipe-from-vgdb-to-6164-by-???-on-??? 1334405920.787228 trying /tmp/vgdb-pipe-from-vgdb-to-6164-by-???-on-??? 1334405920.789632 trying /tmp/.XIM-unix 1334405920.792089 trying /tmp/vgdb-pipe-to-vgdb-from-6164-by-???-on-??? 1334405920.792142 trying /tmp/vgdb-pipe-to-vgdb-from-6164-by-???-on-??? 1334405920.792265 vgdb: using /tmp/vgdb-pipe-from-vgdb-to-6164-by-plug-on-playground.fc16 /tmp/vgdb-pipe-to-vgdb-from-6164-by-plug-on-playground.fc16 /tmp/vgdb-pipe-shared-mem-vgdb-6164-by-plug-on-playground.fc16 syscall failed: No such file or directory error opening /tmp/vgdb-pipe-shared-mem-vgdb-6164-by-plug-on-playground.fc16 shared memory file >From the above output it looks like the valgrind gdbserver generates FIFO names that is different than the ones expected by vgdb. How do I tell vgdb to use the correct FIFO? A postfix option (--vgdb-postfix) similar to --vgdb-prefix would have helped in this case. But as that is not available what alternate method is available for vgdb to use the correct FIFOs. Thanks and regards, ~Plug ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users