vector_capacity:test03() failing on mips-irix6

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Thu Dec 12 21:12:00 GMT 2002


On mips-irix6, I've been seeing errors in libstdc++-v3 testcase
23_containers/vector_capacity.cc since around 11/17 on the trunk and
around 12/5 on the 3.2.x branch up through today:

http://gcc.gnu.org/ml/gcc-testresults/2002-11/msg00658.html
http://gcc.gnu.org/ml/gcc-testresults/2002-12/msg00228.html

This coincided with the installation of the following patch in each
place respectively:

 >             Benjamin Kosnik  <bkoz@redhat.com>
 >             Gabriel Dos Reis  <gdr@integrable-solutions.net>
 > 
 > 	PR libstdc++/8230
 > 	* include/bits/stl_alloc.h: Use builtin_expect for the most
 > 	obvious limit checks.
 > 	(__default_alloc_template::allocate): Check for null, throw
 > 	bad_alloc.
 > 	* include/bits/vector.tcc: Formatting tweaks.
 > 	* include/bits/stl_vector.h: Same.	
 > 	* testsuite/20_util/allocator_members.cc (test02): Add.
 > 	* testsuite/23_containers/vector_capacity.cc (test03): Add.


When I ran vector_capacity.exe under gdb, sure enough it dies in the
new test03.  Here's a backtrace, any thoughts?

		Thanks,
		--Kaveh





Program received signal SIGSEGV, Segmentation fault.
0x10010bb4 in __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::fill_n<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned, int const&) (__first=
      {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x1002c000},
    __n=1073735691, __value=@0x7fff2e48) at bits/stl_algobase.h:539
539             *__first = __value;
(gdb) where
#0  0x10010bb4 in __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::fill_n<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned, int const&) (__first=
      {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x1002c000},
    __n=1073735691, __value=@0x7fff2e48) at bits/stl_algobase.h:539
#1  0x1000f368 in __uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned int, int> (__first=
      {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x10026030},
    __n=1073741823, __x=@0x7fff2e48) at bits/stl_uninitialized.h:180
#2  0x1000fc54 in uninitialized_fill_n<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned int, int> (__first=
      {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x10026030},
    __n=1073741823, __x=@0x7fff2e48) at bits/stl_uninitialized.h:216
#3  0x1000c5b8 in std::vector<int, std::allocator<int> >::_M_fill_insert(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned, int const&) (this=0x7fff2e88, __position=
      {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x0},
    __n=1073741823, __x=@0x7fff2e48) at bits/vector.tcc:343
#4  0x1000db84 in std::vector<int, std::allocator<int> >::insert(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned, int const&) (this=0x7fff2e88, __pos=
      {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x0},
    __n=1073741823, __x=@0x7fff2e48) at bits/stl_vector.h:671
#5  0x1000cefc in std::vector<int, std::allocator<int> >::resize(unsigned, int const&) (this=0x7fff2e88,
    __new_size=1073741823, __x=@0x7fff2e48) at bits/stl_vector.h:438
#6  0x1000c9b8 in std::vector<int, std::allocator<int> >::resize(unsigned) (this=0x7fff2e88, __new_size=1073741823)
    at bits/stl_vector.h:452
#7  0x1000b250 in test03() ()
    at /a/caip/a99/u99/ghazi/gcc-testing/egcc-CVS20021211/libstdc++-v3/testsuite/23_containers/vector_capacity.cc:109
#8  0x1000ef40 in main ()
    at /a/caip/a99/u99/ghazi/gcc-testing/egcc-CVS20021211/libstdc++-v3/testsuite/23_containers/vector_capacity.cc:187
(gdb) print __first
$1 = {<iterator<std::random_access_iterator_tag,int,int,int*,int&>> = {<No data fields>}, _M_current = 0x1002c000}
(gdb) print *__first
$2 = (int &) @0x1002c000: Cannot access memory at address 0x1002c000
(gdb) print __value
$3 = (const int &) @0x7fff2e48: 0
(gdb)



More information about the Gcc-bugs mailing list