Bug 803725 - RFE: adjust recommended vgdb command to work with varying TMPDIR
RFE: adjust recommended vgdb command to work with varying TMPDIR
Product: Fedora
Classification: Fedora
Component: valgrind (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Mark Wielaard
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-03-15 10:14 EDT by Jim Meyering
Modified: 2013-08-01 01:06 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-01 01:06:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jim Meyering 2012-03-15 10:14:48 EDT
Description of problem:
Thanks for the new --vgdb-error=0 feature.
However, my first attempts to use it failed:

If I run "valgrind -q --vgdb-error=0 ./a.out" in one window,
and then run the command it suggests,
  gdb -q -ex 'target remote | vgdb --pid=18260' ./a.out
in a separate window, the latter always fails for me, giving this
diagnostic: "vgdb error: no FIFO found matching pid 18260"

However, if I do it all in the same window it works fine:

  printf 'int main () { int x; x = x > 0 ? x : x + 1; return x; }' > k.c
  gcc -ggdb3 k.c && valgrind -q --vgdb-error=0 ./a.out &

It prints this advice:

  ==18361== (action at startup) vgdb me ...                                  :
  ==18361== TO DEBUG THIS PROCESS USING GDB: start GDB like this
  ==18361==   /path/to/gdb ./a.out
  ==18361== and then give GDB the following command
  ==18361==   target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=18361
  ==18361== --pid is optional if only one valgrind process is running

But there's no need to specify that painfully long path to vgdb,
since it's just /usr/bin/vgdb, and /usr/bin is in PATH, so we can
just say "vgdb":

  gdb -q -ex 'target remote | vgdb --pid=18361' ./a.out

which works fine.

The problem I had with separate windows is that each
of my shells has its own TMPDIR, and valgrind puts the
FIFO it uses in one $TMPDIR, while the other looks in its
different $TMPDIR and fails to find the required FIFO.

Two possible solutions:

- give vgdb an option by which to specify the pipe
- change the valgrind-emitted command to set TMPDIR, e.g.,

    target remote | env TMPDIR='$TMPDIR' vgdb --pid=$PID

Version-Release number of selected component (if applicable):

Finally, a small nit: I see no way to kill that valgrind
process other than kill -9, so of course its FIFO is left

How reproducible: always

Steps to Reproduce:
1. as above
Comment 1 Mark Wielaard 2012-10-06 16:12:13 EDT
Both valgrind and vgdb take:

    --vgdb-prefix=<prefix>    prefix for vgdb FIFOs [/tmp/vgdb-pipe]

  --vgdb-prefix arg must be given to both Valgrind and vgdb utility
      if you want to change the default prefix for the FIFOs communication
      between the Valgrind gdbserver and vgdb.

That will be used instead of the default prefix to store the FIFOs instead of $TMPDIR/vgdb-pipe

Is that enough for your purposes?

Apart from the printing/formatting nits and that you cannot seem to kill the valgrind process of course.
Comment 2 Jim Meyering 2012-10-06 17:05:07 EDT
Hi Mark.  Yes, that looks perfect.  Thanks!
Comment 4 Fedora End Of Life 2013-07-03 21:01:27 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2013-08-01 01:06:37 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.