This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems with gcc/libstdc++ on Solaris 8


Hello All,

I am seeing many strange memory allocation errors and I believe it may
be to due to a gcc configuration error on my part (or at least I'm hoping
it's nothing more than a configuration error), but I am unsure.

Our software is a multi-threaded server that runs on Solaris 8 (aka 2.8).
I am compiling with gcc 2.95.2 and libstdc++ that shipped with it (2.10).
We are using the ACE library for threads (Solaris threads) and mutexes and such,
and we also have some code which calls into pthreads directly.

As an aside, before the pthread specific code was added we were using a
precompiled gcc/g++ from www.sunfreeware.com, but we had to compile our own
with --enable-threads=posix to get everything linking with the Solaris pthreads libs.
I understand that it is okay to mix Solaris native threads with pthreads,
since the latter is implemented using Solaris threads.

Now the problem:  When I started load testing the server I began
experiencing crashes and all stack traces show show something going wrong
in the libc malloc routines, but they all start at various places in
the basic_string and/or STL alloc implementations.

We have not seen this problem on Linux (libstdc++.so.2.9), so I'm lead to believe
something is amiss with our gcc/g++ configuration.  We built gcc/g++ with
the options:
--enable-threads=posix --enable-shared --enable-languages=c++

Here are the interesting bits of our core's stack trace:
#0  0xfe1414c4 in _malloc_unlocked () from /usr/lib/libc.so.1
#1  0xfe141294 in malloc () from /usr/lib/libc.so.1
#2  0x1ce50 in __malloc_alloc_template<0>::allocate (__n=262160)
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3
/stl_alloc.h:157
#3  0x1cee0 in __default_alloc_template<true, 0>::allocate (__n=262160)
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3
/stl_alloc.h:407
#4  0x19414 in
__nw__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_templ
ate2b1i0_3RepUiUi
(s=16, extra=262144)
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3
/std/bastring.cc:33
#5  0x19454 in basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >::Rep::create (extra=262144)
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3
/std/bastring.cc:60
#6  0x194ec in basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >::Rep::clone (this=0x2fd40)
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3
/std/bastring.cc:71
#7  0x1d1bc in basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >::Rep::grab (this=0x2fd40)
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g+---
Type
<return> to continue, or q <return> to quit---
+-3/std/bastring.h:75
#8  0x1c864 in basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >::basic_string (this=0xfdc07858,
s=0x304b0 "208.146.252.9")
    at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3
/std/bastring.h:178

Travis

-- 
Travis Shirk <travis at pobox dot com>
Mathematics is God and Knuth is our prophet.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]