[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#554574: libstdc++6: apt segfaults on hppa



On Sun, Nov 22, 2009 at 10:30 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> > The problem appears to have gone away with head.  I don't see it with
>> > hpux.
>> >
>>
>> Note that latest version of gcc 4.4 in Debian is built with
>> --disable-libstdcxx-pch, but the segfault is this present :(
>
> Personally, I don't believe the segfault is related to the FAILs
> seen in the libstdc++ testsuite.  As you showed, there is an ABI
> change in the library depending on libc version.  Someone needs
> to generate a backtrace so that we can get some idea what's happening.

Running apt-get with the newly compiled libstdc++6 with
--without-cloog/--without-ppl still cause the segfault.

The glibc locale() function is causing this failure.

The segfault happens when basic_ios is being initialized. The
ios_base::_M_init() calls locale() to create a locale object and
stores this into _M_ios_locale. The assignment is done through an
operator= for the locale type, and this crashes.

Starting program: /usr/bin/apt-get

Program received signal SIGSEGV, Segmentation fault.
std::locale::operator= (this=0xbff01c84, __other=...) at
../../../../src/libstdc++-v3/src/locale.cc:116
116         _M_impl->_M_remove_reference();
Current language:  auto; currently c++
(gdb) bt
#0  std::locale::operator= (this=0xbff01c84, __other=...) at
../../../../src/libstdc++-v3/src/locale.cc:116
#1  0x40390c10 in std::ios_base::_M_init (this=0xbff01fc8) at
../../../../src/libstdc++-v3/src/ios_locale.cc:43
#2  0x403a9858 in std::basic_ios<char, std::char_traits<char> >::init
(this=0x4043e890, __sb=0xbff01fc8)
    at /home/carlos/fsrc/debian/gcc-4.4-4.4.2/build/hppa-linux-gnu/libstdc++-v3/include/bits/basic_ios.tcc:128
#3  0x405c7eec in ReadConfigFile(Configuration&, std::string const&,
bool, unsigned int) () from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
#4  0x405c79e8 in ReadConfigDir(Configuration&, std::string const&,
bool, unsigned int) () from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
#5  0x40606eac in pkgInitConfig(Configuration&) () from
/usr/lib/libapt-pkg-libc6.9-6.so.4.8
#6  0x0001d8b8 in main ()
(gdb)

This is the 14th call to std::locale::operator=, but the first call
with an object that was created on the stack.

The object *this a std::locale object, has an invalid _M_impl member,
whose value should be a pointer to an implementation but instead it's
a value of 0x8.

This happens because the original locale object was created at address
0xbff01c20. However, when apt-get calls "std::basic_ios<char,
std::char_traits<char> >::init" it passes in the address 0xbff01c18.
So we went from a constructor using this as 0xbff01c20, to eventually
passing this as 0xbff01c18 to a template. The pointer to the
std::ios_base object is now off by 8 bytes and this causes the crash.

What happened here? Why does ReadConfigFile() think that the object is
in a different location?

Any hints on how to track this down?

Cheers,
Carlos.


Reply to: