I am using g++ on Linux, and my code has lot of vectors each stores a
particualr type of structure. (Structure internally had some vectors).
When I am trying to push_back an element to a one of the vectors in
the parent strutcure, it always core dumps on Linux and HP. On Solaris
the same code is working fine without any problem.
My code is actually an API, and this problem is seen only by few
callers and not by everybody on linux/HP.
Here is the stack trace of core dump, can some of you help me out
here..
#0 0x080ff6bd in basic_string<ch ar, string_char_tra its<char>,
__default_alloc _template<true, 0> >::Rep::grab (this=0x3f0dca1 e)
at /usr/include/g++-3/std/bastring.h:75
75 charT* grab () { if (selfish) return clone (); ++ref;
return data (); }
(gdb) where
#0 0x080ff6bd in basic_string<ch ar, string_char_tra its<char>,
__default_alloc _template<true, 0> >::Rep::grab (this=0x3f0dca1 e)
at /usr/include/g++-3/std/bastring.h:75
#1 0x080fe985 in basic_string<ch ar, string_char_tra its<char>,
__default_alloc _template<true, 0> >::basic_stri ng (this=0x828ab24 ,
str=@0xbfffedbc )
at /usr/include/g++-3/std/bastring.h:177
#2 0x0810670e in ImageData::Imag eData (this=0x828ab18 ,
_ctor_arg=@0xbf ffedb0)
at /usr/include/g++-3/stl_construct.h :48
#3 0x080ffc8b in void construct<Image Data, ImageData> (__p=0x828ab18,
__value=@0xbfff edb0) at /usr/include/g++-3/stl_construct.h :48
#4 0x080ffda2 in vector<ImageDat a, allocator<Image Data>
::_M_insert_au x (
this=0xbfffee58 , __position=0x0, __x=@0xbfffedb0 )
at /usr/include/g++-3/stl_vector.h:60 4
#5 0x080febab in vector<ImageDat a, allocator<Image Data> >::push_back
(
this=0xbfffee58 , __x=@0xbfffedb0 ) at
/usr/include/g++-3/stl_vector.h:32 5
#6 0x0809072b in PickListReports ::makeModel (this=0x82927a8 )
at picklistreports .cpp:820
#7 0x08080f3b in vreport (robotNum=0x0, vaultName=0x828 e028 "V1",
profileName=0x0 , sessionid=1, reportid=-1, reportFormat=0,
distInfo=0x0,
argInfo=0x0) at vreport.cpp:350
#8 0x0807fb1f in vreport (robot=0x0, vault=0x828e028 "V1",
profile=0x0,
sessionid=1) at vreport.cpp:71
#9 0x08071f28 in DoReport (rptcmd=0xbffff a79 "picking_librar y",
sessionId=1,
reportFileName= 0x0) at reports.cpp:85
#10 0x08079873 in new_main (argC=9, argV=0xbffff914 ) at vltrun.cpp:431
#11 0x080794e8 in main (argC=9, argV=0xbffff914 ) at vltrun.cpp:342
#12 0x410b8507 in __libc_start_ma in (main=0x80794d4 <main>, argc=9,
ubp_av=0xbffff9 14, init=0x804fd28 <_init>, fini=0x812be24 <_fini>,
rtld_fini=0x400 0dc14 <_dl_fini>, stack_end=0xbff ff90c)
at ../sysdeps/generic/libc-start.c:129
#6 is the place where I am using push_back.
I tried using stlport instead of g++'s STL but no use it core dumps
at the same place always.
Your help is highly appreciated in this regard.
Thanks
Ganesh.