valgrind --db-attach=yes does not work

Bug #665850 reported by Paul Ortyl
12
This bug affects 2 people
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-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==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_malloc.c:236)
==3513== by 0x400505: main (in /home/ortyl/a.out)
==3513==
==3513==
==3513== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- y
==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://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-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /proc/3516/fd/1014...(no debugging symbols found)...done.
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~svn20100724-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.35-22.35-generic 2.6.35.4
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

Revision history for this message
Paul Ortyl (ortylp) wrote :
Revision history for this message
River (riverchiang) wrote :

It works with "sudo valgrind --db-attach=yes ./a.out" command.

Changed in valgrind (Ubuntu):
status: New → Confirmed
assignee: nobody → River (riverchiang)
Revision history for this message
River (riverchiang) wrote :

Sorry, I am not going to assign the bug to me. How can I cancel the assignment?

Changed in valgrind (Ubuntu):
status: Confirmed → Opinion
status: Opinion → Confirmed
Revision history for this message
Paul Ortyl (ortylp) wrote :

I am using valgrind for years and it never needed root privileges.

Revision history for this message
Loïc Minier (lool) wrote :
Changed in valgrind (Ubuntu):
assignee: River (riverchiang) → nobody
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.