[Valgrind-users] about array out of bounds

2012-02-23 Thread 张昭
Hi all: I use zhangzhao-debian:~/work/tests# /opt/valgrind-3.7.0/bin/valgrind --version valgrind-3.7.0 to test follow code #include stdlib.h static int b[60]; int main ( int argc, char *argv[] ) { int a[50]; int ret; /*a[50] = 1; a[51] = 1;*/ b[59] = 1; b[60] =

[Valgrind-users] Behavior diffenert with valgrind without valgrind

2012-02-23 Thread jee
My code change itself with running, and, I use VALGRIND_DISCARD_TRANSLATIONS with I changed the function's assembly code. and my code is pure C++. i rewrite the assembly code like this: inline hook: mov addr, %rax jmp *%rax I insert this assembly code to the begin of functions, I can run my elf

Re: [Valgrind-users] Behavior diffenert with valgrind without valgrind

2012-02-23 Thread Eliot Moss
On 2/23/2012 7:51 AM, jee wrote: My code change itself with running, and, I use VALGRIND_DISCARD_TRANSLATIONS with I changed the function's assembly code. and my code is pure C++. i rewrite the assembly code like this: inline hook: mov addr, %rax jmp *%rax I insert this assembly code to

Re: [Valgrind-users] Valgrind getting stuck or hung

2012-02-23 Thread Richa Mehta
Hi the output of valgrind ls -l is: [172:~]$ /usr/bin/valgrind ls -l ==2096== Memcheck, a memory error detector ==2096== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.

Re: [Valgrind-users] Valgrind getting stuck or hung

2012-02-23 Thread Richa Mehta
Hi, Here's the required output *[172:~]$ /usr/bin/valgrind --trace-syscalls=yes --trace-symtab=yes --trace-syb-patt=/usr/lib/mylib.so.debug /usr/bin/myprog* *==2944== Memcheck, a memory error detector* *==2944== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.* *==2944== Using

Re: [Valgrind-users] about array out of bounds

2012-02-23 Thread Philippe Waroquiers
On Thu, 2012-02-23 at 17:59 +0800, 张昭 wrote: static int b[60]; int main ( int argc, char *argv[] ) { int a[50]; int ret; /*a[50] = 1; a[51] = 1;*/ b[59] = 1; b[60] = 2; return EXIT_SUCCESS; } and I find this result; why? I always have a array out

Re: [Valgrind-users] Behavior diffenert with valgrind without valgrind

2012-02-23 Thread Philippe Waroquiers
On Thu, 2012-02-23 at 21:33 +0800, jee wrote: like this: in gdb: 137 while(fgets(buff, PATH_MAX, p_file)){ (gdb) //when i press n, .. there's no n,it's dead -_-! What happens if you press Control-c ? Control-c should indicate to the Valgrind gdbserver to give back the

Re: [Valgrind-users] Behavior diffenert with valgrind without valgrind

2012-02-23 Thread jee
the same,can not pause. 2012/2/24 Philippe Waroquiers philippe.waroqui...@skynet.be On Thu, 2012-02-23 at 21:33 +0800, jee wrote: like this: in gdb: 137 while(fgets(buff, PATH_MAX, p_file)){ (gdb) //when i press n, .. there's no n,it's dead -_-! What happens if you