With Fedora 16/x64 + V-trunk rev.12400/2261
gcc -O0 -g2 a.c -o array
valgrind --tool=exp-sgcheck ./array
i have:
- exp-sgcheck/globalerr works fine
- array: no errs about global array
- array: no errs about stack array
(fast) look into bugzilla shows no similar.
$ cat a.c
int b[60];
int main ( )
{
int a[60];
a[59] = 1;
a[60] = 2;
b[59] = 1;
b[60] = 2;
return 0;
}
$ gcc -O0 -g2 a.c -S -o /dev/tty
.file "a.c"
.text
.Ltext0:
.comm b,240,32
.globl main
.type main, @function
main:
.LFB0:
.file 1 "a.c"
.loc 1 3 0
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $120, %rsp
.loc 1 5 0
movl $1, -4(%rbp)
.loc 1 6 0
movl $2, 0(%rbp)
.loc 1 7 0
movl $1, b+236(%rip)
.loc 1 8 0
movl $2, b+240(%rip)
.loc 1 9 0
movl $0, %eax
.loc 1 10 0
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
[ skip ]
Dmitry
2012/2/23 张昭 <mail.zhangz...@gmail.com>
> 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] = 2;
> return EXIT_SUCCESS;
> }
> compile use gcc -g array.c -o array and run with
> zhangzhao-debian:~/work/tests# /opt/valgrind-3.7.0/bin/valgrind
> --tool=exp-sgcheck ./array
> ==14029== exp-sgcheck, a stack and global array overrun detector
> ==14029== NOTE: This is an Experimental-Class Valgrind Tool
> ==14029== Copyright (C) 2003-2011, and GNU GPL'd, by OpenWorks Ltd et al.
> ==14029== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
> ==14029== Command: ./array
> ==14029==
> ==14029==
> ==14029== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> zhangzhao-debian:~/work/tests#
>
> and I find this result; why? I always have a array out of bounds but
> valgrind doesn't found that? Help
>
> zhangzhao
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users