Bug 803725 - RFE: adjust recommended vgdb command to work with varying TMPDIR
Summary: RFE: adjust recommended vgdb command to work with varying TMPDIR
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mark Wielaard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-15 14:14 UTC by Jim Meyering
Modified: 2013-08-01 05:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-01 05:06:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jim Meyering 2012-03-15 14:14:48 UTC
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==
  ==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):
valgrind-3.7.0-2.fc17.x86_64

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

How reproducible: always

Steps to Reproduce:
1. as above

Comment 1 Mark Wielaard 2012-10-06 20:12:13 UTC
Both valgrind and vgdb take:

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

vgdb
  --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 21:05:07 UTC
Hi Mark.  Yes, that looks perfect.  Thanks!

Comment 4 Fedora End Of Life 2013-07-04 01:01:27 UTC
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 05:06:37 UTC
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.