stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Wright <markwri...@internode.on.net>
Subject __rw::__string_ref::size sigsegv
Date Wed, 19 Mar 2008 14:23:11 GMT
Hi,

I compile the following program with Sun Studio 12 on Solaris 10u4
with stdcxx compiled from subversion as 64 bit 15D:

#include <set>
#include <string>

std::set<std::string> setstr;

int main(int argc, char *argv[])
{
  std::copy(argv, argv + argc, std::inserter(setstr, setstr.end()));
  return 0;
}

With a Makefile like:

setstr : setstr.o
	CC -D_REENTRANT -mt -g -xdebugformat=stabs -xs -xtarget=opteron -m64 -library=no%Cstd -library=Crun
-I/h/goanna/1/a_5.10_m64/c/include -o setstr setstr.o -L/h/goanna/1/a_5.10_m64/c/lib  -R/h/goanna/1/a_5.10_m64/c/lib
-lstd15D

setstr.o : setstr.cpp
	CC -D_REENTRANT -mt -g -xdebugformat=stabs -xs -xtarget=opteron -m64  -library=no%Cstd -library=Crun
 -I/h/goanna/1/a_5.10_m64/c/include -c setstr.cpp

clean:
	rm setstr setstr.o

and run it (with no command line arguments), and it crashes with the stack
trace below.  I was wondering if I am doing something wrong (it works fine
when compiled instead with -library=stlport4), or if you can reproduce it?

Thanks, Mark

goanna% gmake
CC -D_REENTRANT -mt -g -xdebugformat=stabs -xs -xtarget=opteron -m64  -library=no%Cstd -library=Crun
 -I/h/goanna/1/a_5.10_m64/c/include -c setstr.cpp
CC -D_REENTRANT -mt -g -xdebugformat=stabs -xs -xtarget=opteron -m64 -library=no%Cstd -library=Crun
-I/h/goanna/1/a_5.10_m64/c/include -o setstr setstr.o -L/h/goanna/1/a_5.10_m64/c/lib  -R/h/goanna/1/a_5.10_m64/c/lib
-lstd15D
goanna% ./setstr
zsh: segmentation fault (core dumped)  ./setstr
goanna% dbx ./setstr core
Reading setstr
core file header read successfully
Reading ld.so.1
Reading libstd15D.so.4.2.0
Reading libCrun.so.1
Reading libm.so.2
Reading libthread.so.1
Reading libc.so.1
t@1 (l@1) program terminated by signal SEGV (no mapping at the fault address)
dbx: warning: undefined type number (0,71) at /h/goanna/2/eng/dev/stdcxx/setstr/./setstr:setstr.cpp
stab #63 nJ_C_link_t(0,68):t(0,70)=*(0,71),
assuming type `(int {assumed})'
Current function is __rw::__string_ref<char,std::char_traits<char>,std::allocator<char>
>::size
  211           return _C_size._C_size;
(dbx) where
current thread: t@1
=>[1] __rw::__string_ref<char,std::char_traits<char>,std::allocator<char>
>::size(this = 0xffffffffffffffe8), line 211 in "_strref.h"
  [2] std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size(this
= 0x41e8f0), line 247 in "string"
  [3] std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(this
= 0x41e8f0, __str = CLASS), line 1186 in "string"
  [4] std::operator< <char,std::char_traits<char>,std::allocator<char> >(__lhs
= CLASS, __rhs = CLASS), line 1356 in "string"
  [5] std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::operator()(this = 0x41d060, __x = CLASS, __y = CLASS), line 94 in "_funcbase.h"
  [6] __rw::__rb_tree<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__rw::__ident<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::basic_string<char,std::char_traits<char>,std::allocator<char> >
>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > >::insert(this = 0x41d030, __it = CLASS, __v = CLASS, __dup = false), line 356
in "_tree.cc"
  [7] __rw::__rb_tree<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__rw::__ident<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::basic_string<char,std::char_traits<char>,std::allocator<char> >
>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > >::insert(this = 0x41d030, __it = CLASS, __x = CLASS, __dup = false), line 592
in "_tree.h"
  [8] std::set<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > >::insert(this = 0x41d030, __it = CLASS, __x = CLASS), line 172 in "set"
  [9] std::insert_iterator<std::set<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > > >::operator=(this = 0xfffffd7fffdfd6d0, __x = CLASS), line 501 in "_iterator.h"
  [10] std::copy<char**,std::insert_iterator<std::set<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > > > >(__first = 0xfffffd7fffdfd798, __last = 0xfffffd7fffdfd7a0, __res
= CLASS), line 95 in "_algobase.h"
  [11] main(argc = 1, argv = 0xfffffd7fffdfd798), line 8 in "setstr.cpp"
(dbx) print -r *this
dbx: cannot access address 0xffffffffffffffe8
(dbx) frame 2
Current function is std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::size
  247           return _C_pref ()->size ();
(dbx) print -r *this
*this = {
    basic_string<char,std::char_traits<char>,std::allocator<char> >::_C_data
    = (nil)
    basic_string<char,std::char_traits<char>,std::allocator<char> >::npos
       = -1
    _C_null_ref                                                                  = struct
__rw::__null_ref<char,std::char_traits<char>,std::allocator<char> > /* STATIC
CLASS */
}
(dbx) loadobject -list
m   /h/goanna/2/eng/dev/stdcxx/setstr/./setstr (primary)
m   /h/goanna/1/a_5.10_m64/c/lib/libstd15D.so.4.2.0
m   /usr/lib/amd64/libCrun.so.1
m   /lib/amd64/libm.so.2
m   /lib/amd64/libthread.so.1
m   /lib/amd64/libc.so.1
(dbx) 

-- 

Mime
View raw message