SIGSEGV with -D_GLIBCXX_DEBUG

Drago ff kmakaron@yahoo.co.uk
Tue Jan 13 16:35:00 GMT 2009


Hello, I receive SIGSEGV in my multhreading code compiled with -D_GLIBCXX_DEBUG. GDB says:

--------------------------------------------------------------------------

0xb7e7e129 in __gnu_cxx::__exchange_and_add () from /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../libstdc++.so.6
(gdb) bt
#0  0xb7e7e129 in __gnu_cxx::__exchange_and_add () from /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../libstdc++.so.6
#1  0x0805aaf1 in std::string::_Rep::_M_dispose (this=0x1b, __a=@0xbf87d543) at /usr/include/c++/4.1.3/bits/basic_string.h:232
#2  0x0805ab46 in ~basic_string (this=0xbf87d628) at /usr/include/c++/4.1.3/bits/basic_string.h:478
#3  0x0805b625 in ~namedclass (this=0xbf87d624) at /usr/local/include/pqxx/util.hxx:570
#4  0xb7f36e05 in ~nontransaction (this=0xbf87d5f0) at nontransaction.cxx:28
#5  0x08055258 in db_get_global_settings (C=@0xbf87d9fc) at main.cc:41
#6  0x080570cd in main () at main.cc:148
--------------------------------------------------------------------


namedclass definition is:

class PQXX_LIBEXPORT namedclass
{
public:
  namedclass(const PGSTD::string &Classname, const PGSTD::string &Name="") :
    m_Classname(Classname),
    m_Name(Name)
  {
  }

  const PGSTD::string &name() const throw () { return m_Name; }         //[t1]
  const PGSTD::string &classname() const throw () {return m_Classname;} //[t73]
  PGSTD::string description() const;

private:
  PGSTD::string m_Classname, m_Name;
};

----------------------------------------------------------

Nothing to do nasty things, according to me. Without _GLIBCXX_DEBUG defined, everything is OK.

I am using Using:

--------------------------------------------------------

built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

----------------------------------------------

I have tested it on recent debian - same behaviour. I think it is some kind of bug in libstdc++.





More information about the Libstdc++ mailing list