This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libmudflap/48485] mudflap don't discover mistake - negative one index on static array i.e. a[-1]=b;


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48485

--- Comment #3 from konst <krasutug at mail dot ru> 2011-04-07 10:08:59 UTC ---
gcc -fmudflap main.c -lmudflap -o main && ./main
and nothing, but if I do 'a[-2]=c;' in main.c and compile it then the mistake
is discovered by following output:

*******
mudflap violation 1 (check/write): time=1302170495.754005 ptr=0x7fff720f68f0
size=18446744073709551396
pc=0x7f5975684391 location=`main.c:5:8 (main)'
      /usr/lib64/libmudflap.so.0(__mf_check+0x41) [0x7f5975684391]
      ./main(main+0xa0) [0x400a64]
      /lib64/libc.so.6(__libc_start_main+0xfd) [0x7f597532bbfd]
Nearby object 1: checked region begins 0B into and ends 2381354758B after
mudflap object 0x706ea0: name=`main.c:2:6 (main) a'
bounds=[0x7fff720f68f0,0x7fff720f68f9] size=10 area=stack check=0r/3w
liveness=3
alloc time=1302170495.753888 pc=0x7f5975683791
Nearby object 2: checked region begins 280B before and ends 2381354472B after
mudflap object 0x702370: name=`argv[]'
bounds=[0x7fff720f6a08,0x7fff720f6a17] size=16 area=static check=0r/3w
liveness=3
alloc time=1302170495.753853 pc=0x7f5975683791
Nearby object 3: checked region begins 296B before and ends 2381353720B after
mudflap object 0x706ab0: name=`environ[]'
bounds=[0x7fff720f6a18,0x7fff720f6d07] size=752 area=static check=0r/3w
liveness=3
alloc time=1302170495.753885 pc=0x7f5975683791
number of nearby objects: 97


=================
This is my system versions:
=================

 uname --all
Linux home 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64
x86_64 x86_64 GNU/Linux
==================

gcc -v
ÐÑÐÐÐÑÐÑÑÑÑÑ ÐÐÑÑÑÐÐÐÐÐ ÑÐÐÑÐÑÐÐÐÑÐÐ.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.5.2/lto-wrapper
ÐÐÐÐÐÐÑ ÐÑÑÐÑÐÐÑÑÑÐ: x86_64-suse-linux
ÐÐÑÐÐÐÑÑÑ ÐÐÐÑÐÐÑÑÐÑÐÐ: ./configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++ --enable-checking=release
--with-gxx-include-dir=/usr/include/c++/4.5 --enable-ssp --disable-libssp
--disable-plugin --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --enable-libmudflap
--with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.5
--enable-linux-futex --without-system-libunwind --enable-gold
--with-plugin-ld=/usr/bin/gold --with-arch-32=i586 --with-tune=generic
--build=x86_64-suse-linux
ÐÐÐÐÐÑ ÐÐÐÐÐÐÐÑÐÑÐÐÑÑÐ: posix
gcc ÐÐÑÑÐÑ 4.5.2 20101208 (prerelease) [gcc-4_5-branch revision 167585] (SUSE
Linux)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]