Bug 240477

Summary: --db-attach=yes doesn't work
Product: Red Hat Enterprise Linux 5 Reporter: Markus Armbruster <armbru>
Component: valgrindAssignee: Jakub Jelinek <jakub>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-19 08:05:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Markus Armbruster 2007-05-17 19:27:02 UTC
Description of problem:

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

How reproducible:

Steps to Reproduce:
1. Pick a program that makes valgrind gripe, e.g this one:
int main(void) { int bozo; return bozo; }
Compile it (preferably with symbols) into a.out
2. valgrind --db-attach=yes ./a.out
3. When asked whether to attach, reply y
Actual results:
$ valgrind --db-attach=yes ./a.out 
==20071== Memcheck, a memory error detector.
==20071== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==20071== Using LibVEX rev 1658, a library for dynamic binary translation.
==20071== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==20071== Using valgrind-3.2.1, a dynamic binary instrumentation framework.
==20071== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==20071== For more details, rerun with: -v
==20071== Syscall param exit_group(exit_code) contains uninitialised byte(s)
==20071==    at 0x338A6948CF: _Exit (in /lib64/libc-2.5.so)
==20071==    by 0x338A632D04: exit (in /lib64/libc-2.5.so)
==20071==    by 0x338A61D8AA: (below main) (in /lib64/libc-2.5.so)
==20071== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- y
starting debugger
==20071== starting debugger with cmd:  -nw /proc/20080/fd/1014 20080
/bin/sh: -nw: command not found
==20071== Debugger has detached.  Valgrind regains control.  We continue.
==20071== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 1)
==20071== malloc/free: in use at exit: 0 bytes in 0 blocks.
==20071== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==20071== For counts of detected errors, rerun with: -v
==20071== All heap blocks were freed -- no leaks are possible.

Expected results:
gdb is attached.

Additional info:
Same problem with FC-6's valgrind-3.2.1-4 (i386).  Debugger attaches with FC-5's
valgrind-3.1.0-2 (i386).

Comment 1 Jakub Jelinek 2007-05-19 08:05:37 UTC
You need for the time being also --db-command='gdb -nw %f %p'

*** This bug has been marked as a duplicate of 220840 ***