The following extremely short program generates several 'violations':

#include <vector>

int main() {
  std::vector<int> v;
  v.push_back(1);
} 

Here are the violations:
*******
mudflap violation 1 (check/write): time=1105134174.644364 ptr=0xbffff820 size=4
pc=0x4001f6b8
location=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_iterator.h:603
(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> >
>::__normal_iterator)'
      /usr/local/lib/libmudflap.so.0(__mf_check+0x48) [0x4001f6b8]
     
./test4(_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEC1ERKS1_+0xf6)
[0x804b728]
      ./test4(_ZNSt6vectorIiSaIiEE3endEv+0x1c) [0x804b74e]
Nearby object 1: checked region begins 16B before and ends 13B before
mudflap object 0x80d5508:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_vector.h:610
(std::vector<int, std::allocator<int> >::push_back) <unnamed variable>'
bounds=[0xbffff830,0xbffff833] size=4 area=stack check=0r/0w liveness=0
alloc time=1105134174.644358 pc=0x400201a8
number of nearby objects: 1
*******
mudflap violation 2 (check/write): time=1105134174.644572 ptr=0xbffff640 size=4
pc=0x4001f6b8
location=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_iterator.h:603
(__gnu_cxx::__normal_iterator<const int*, std::vector<int, std::allocator<int> >
>::__normal_iterator)'
      /usr/local/lib/libmudflap.so.0(__mf_check+0x48) [0x4001f6b8]
     
./test4(_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC1ERKS2_+0xf6)
[0x804c31c]
      ./test4(_ZNKSt6vectorIiSaIiEE5beginEv+0xb0) [0x804c3d6]
Nearby object 1: checked region begins 12B before and ends 9B before
mudflap object 0x80d5bf0:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_vector.h:403
(std::vector<int, std::allocator<int> >::size) <unnamed variable>'
bounds=[0xbffff64c,0xbffff64f] size=4 area=stack check=0r/0w liveness=0
alloc time=1105134174.644566 pc=0x400201a8
Nearby object 2: checked region begins 16B before and ends 13B before
mudflap object 0x80d5c58:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_vector.h:403
(std::vector<int, std::allocator<int> >::size) <unnamed variable>'
bounds=[0xbffff650,0xbffff653] size=4 area=stack check=0r/0w liveness=0
alloc time=1105134174.644567 pc=0x400201a8
number of nearby objects: 2
 ...etc...
*******
mudflap violation 6 (check/write): time=1105134174.645166 ptr=0xbffff760 size=4
pc=0x4001f6b8
location=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_iterator.h:603
(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> >
>::__normal_iterator)'
      /usr/local/lib/libmudflap.so.0(__mf_check+0x48) [0x4001f6b8]
     
./test4(_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEC1ERKS1_+0xf6)
[0x804b728]
      ./test4(_ZNSt6vectorIiSaIiEE3endEv+0x1c) [0x804b74e]
Nearby object 1: checked region begins 28B before and ends 25B before
mudflap object 0x80d5b88:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/vector.tcc:276
(std::vector<int, std::allocator<int> >::_M_insert_aux)
__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >
__new_finish'
bounds=[0xbffff77c,0xbffff77f] size=4 area=stack check=1r/0w liveness=1
alloc time=1105134174.644565 pc=0x400201a8
Nearby object 2: checked region begins 32B before and ends 29B before
mudflap object 0x80d5b20:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/vector.tcc:275
(std::vector<int, std::allocator<int> >::_M_insert_aux)
__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >
__new_start'
bounds=[0xbffff780,0xbffff783] size=4 area=stack check=0r/1w liveness=1
alloc time=1105134174.644564 pc=0x400201a8
Nearby object 3: checked region begins 36B before and ends 33B before
mudflap object 0x80d5570:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/vector.tcc:257
(std::vector<int, std::allocator<int> >::_M_insert_aux) <unnamed variable>'
bounds=[0xbffff784,0xbffff787] size=4 area=stack check=0r/0w liveness=0
alloc time=1105134174.644549 pc=0x400201a8
Nearby object 9: checked region begins 241B after and ends 244B after
mudflap dead object 0x80d66e0:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_uninitialized.h:252
(__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >, int>) __gnu_cxx::__normal_iterator<int*,
std::vector<int, std::allocator<int> > > __result'
bounds=[0xbffff66c,0xbffff66f] size=4 area=stack check=0r/0w liveness=0
alloc time=1105134174.645015 pc=0x400201a8
dealloc time=1105134174.645163 pc=0x4001fcb1
number of nearby objects: 9
*******
mudflap violation 7 (check/write): time=1105134174.645279 ptr=0xbffff75c size=4
pc=0x4001f6b8
location=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_iterator.h:603
(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> >
>::__normal_iterator)'
      /usr/local/lib/libmudflap.so.0(__mf_check+0x48) [0x4001f6b8]
     
./test4(_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEC1ERKS1_+0xf6)
[0x804b728]
      ./test4(_ZNSt6vectorIiSaIiEE5beginEv+0x19) [0x804b8ff]
Nearby object 1: checked region begins 32B before and ends 29B before
mudflap object 0x80d5b88:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/vector.tcc:276
(std::vector<int, std::allocator<int> >::_M_insert_aux)
__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >
__new_finish'
Nearby object 2: checked region begins 36B before and ends 33B before
mudflap object 0x80d5b20:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/vector.tcc:275
(std::vector<int, std::allocator<int> >::_M_insert_aux)
__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >
__new_start'
Nearby object 3: checked region begins 40B before and ends 37B before
mudflap object 0x80d5570:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/vector.tcc:257
(std::vector<int, std::allocator<int> >::_M_insert_aux) <unnamed variable>'
Nearby object 8: checked region begins 237B after and ends 240B after
mudflap dead object 0x80d66e0:
name=`/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/stl_uninitialized.h:252
(__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >, int>) __gnu_cxx::__normal_iterator<int*,
std::vector<int, std::allocator<int> > > __result'
number of nearby objects: 8

-- 
           Summary: Mudflap produce many violations on simple, correct c++
                    program
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libmudflap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bredelin at ucla dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet:  i686-pc-linux-gnu
  GCC host triplet:  i686-pc-linux-gnu
GCC target triplet:  i686-pc-linux-gnu


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

Reply via email to