Return-Path: Delivered-To: apmail-stdcxx-user-archive@www.apache.org Received: (qmail 81679 invoked from network); 19 Mar 2008 14:23:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Mar 2008 14:23:47 -0000 Received: (qmail 52138 invoked by uid 500); 19 Mar 2008 14:23:45 -0000 Delivered-To: apmail-stdcxx-user-archive@stdcxx.apache.org Received: (qmail 52120 invoked by uid 500); 19 Mar 2008 14:23:45 -0000 Mailing-List: contact user-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@stdcxx.apache.org Delivered-To: mailing list user@stdcxx.apache.org Received: (qmail 52110 invoked by uid 99); 19 Mar 2008 14:23:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2008 07:23:45 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.16.214.73] (HELO mail.internode.on.net) (203.16.214.73) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2008 14:23:06 +0000 Received: from goanna (unverified [121.44.123.170]) by mail.internode.on.net (SurgeMail 3.8f2) with ESMTP id 20279002-1927428 for ; Thu, 20 Mar 2008 00:53:15 +1030 (CDT) Date: Thu, 20 Mar 2008 01:23:11 +1100 From: Mark Wright To: user@stdcxx.apache.org Subject: __rw::__string_ref::size sigsegv Message-ID: <20080320012311.00001f95@goanna> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.10.11; i386-pc-solaris2.10) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I compile the following program with Sun Studio 12 on Solaris 10u4 with stdcxx compiled from subversion as 64 bit 15D: #include #include std::set 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,std::allocator >::size 211 return _C_size._C_size; (dbx) where current thread: t@1 =>[1] __rw::__string_ref,std::allocator >::size(this = 0xffffffffffffffe8), line 211 in "_strref.h" [2] std::basic_string,std::allocator >::size(this = 0x41e8f0), line 247 in "string" [3] std::basic_string,std::allocator >::compare(this = 0x41e8f0, __str = CLASS), line 1186 in "string" [4] std::operator< ,std::allocator >(__lhs = CLASS, __rhs = CLASS), line 1356 in "string" [5] std::less,std::allocator > >::operator()(this = 0x41d060, __x = CLASS, __y = CLASS), line 94 in "_funcbase.h" [6] __rw::__rb_tree,std::allocator >,std::basic_string,std::allocator >,__rw::__ident,std::allocator >,std::basic_string,std::allocator > >,std::less,std::allocator > >,std::allocator,std::allocator > > >::insert(this = 0x41d030, __it = CLASS, __v = CLASS, __dup = false), line 356 in "_tree.cc" [7] __rw::__rb_tree,std::allocator >,std::basic_string,std::allocator >,__rw::__ident,std::allocator >,std::basic_string,std::allocator > >,std::less,std::allocator > >,std::allocator,std::allocator > > >::insert(this = 0x41d030, __it = CLASS, __x = CLASS, __dup = false), line 592 in "_tree.h" [8] std::set,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > >::insert(this = 0x41d030, __it = CLASS, __x = CLASS), line 172 in "set" [9] std::insert_iterator,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > > >::operator=(this = 0xfffffd7fffdfd6d0, __x = CLASS), line 501 in "_iterator.h" [10] std::copy,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > > > >(__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,std::allocator >::size 247 return _C_pref ()->size (); (dbx) print -r *this *this = { basic_string,std::allocator >::_C_data = (nil) basic_string,std::allocator >::npos = -1 _C_null_ref = struct __rw::__null_ref,std::allocator > /* 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) --