valgrind --db-attach=yes does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
valgrind (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: valgrind
GDB does not attach to the process as it should. See the example below run on a sample program
===============
#include <malloc.h>
int main()
{
int i;
char * a = malloc(3);
for(i=0; i<4; i++)
a[i] = 0;
}
================
valgrind --db-attach=yes ./a.out
==3513== Memcheck, a memory error detector
==3513== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==3513== Using Valgrind-
==3513== Command: ./a.out
==3513==
==3513== Invalid write of size 1
==3513== at 0x40051C: main (in /home/ortyl/a.out)
==3513== Address 0x51b1043 is 0 bytes after a block of size 3 alloc'd
==3513== at 0x4C2815C: malloc (vg_replace_
==3513== by 0x400505: main (in /home/ortyl/a.out)
==3513==
==3513==
==3513== ---- Attach to debugger ? --- [Return/
==3513== starting debugger with cmd: /usr/bin/gdb -nw /proc/3516/fd/1014 3516
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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-linux-gnu".
For bug reporting instructions, please see:
<http://
Reading symbols from /proc/3516/
Attaching to program: /proc/3516/fd/1014, process 3516
ptrace: Operation not permitted.
/home/ortyl/3516: No such file or directory.
(gdb)
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: valgrind 1:3.6.0~
ProcVersionSign
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
Date: Sun Oct 24 12:50:51 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
PATH=(custom, user)
LANG=en_GB.utf8
SHELL=/bin/bash
SourcePackage: valgrind
It works with "sudo valgrind --db-attach=yes ./a.out" command.