[libgcc1] segfault on ppc when unwinding stack (c++ exceptions, mono exceptions)

Bug #52465 reported by Sebastian Dröge
8
Affects Status Importance Assigned to Milestone
gcc-4.1 (Ubuntu)
Fix Released
Critical
Matthias Klose

Bug Description

Hi,
the latest libgcc1 version (4.1.1-2ubuntu5) is unable to do stack unwinding (_Unwind_RaiseException() and __frame_state_for()) on ppc. When downgrading to 4.1.1-2ubuntu3 it works again so I assume it's caused by SSP.
This let mono, schroot FTBFS and probably renders many packages unusable on ppc.

The small C++ program pasted at the bottom segfaults on PPC and works fine on x86 and amd64. The backtrace at the segfault is:
#0 0x0fdf7404 in __frame_state_for () from /lib/libgcc_s.so.1
#1 0x0fdf8174 in _Unwind_RaiseException () from /lib/libgcc_s.so.1
#2 0x0ffadf48 in __cxa_throw () from /usr/lib/libstdc++.so.6
#3 0x10000bcc in main ()

Bye

------

#include <stdexcept>
#include <iostream>

int main()
{
  try
    {
      throw std::runtime_error("Exception thrown");
    }
  catch (std::runtime_error const& e)
    {
      std::cerr << "Caught runtime_error: " << e.what() << std::endl;
    }
  catch (...)
    {
      std::cerr << "Caught unknown exception!" << std::endl;
    }
}

Sebastian Dröge (slomo)
Changed in gcc-4.1:
importance: Untriaged → Critical
status: Unconfirmed → Confirmed
Revision history for this message
Matthias Klose (doko) wrote : Re: [Bug 52465] [libgcc1] segfault on ppc when unwinding stack (c++ exceptions, mono exceptions)

unable to reproduce with g++-4.1.1-8ubuntu1. Please recheck.

Sebastian Dröge schrieb:
> Public bug reported:
>
> Hi,
> the latest libgcc1 version (4.1.1-2ubuntu5) is unable to do stack unwinding (_Unwind_RaiseException() and __frame_state_for()) on ppc. When downgrading to 4.1.1-2ubuntu3 it works again so I assume it's caused by SSP.
> This let mono, schroot FTBFS and probably renders many packages unusable on ppc.
>
> The small C++ program pasted at the bottom segfaults on PPC and works fine on x86 and amd64. The backtrace at the segfault is:
> #0 0x0fdf7404 in __frame_state_for () from /lib/libgcc_s.so.1
> #1 0x0fdf8174 in _Unwind_RaiseException () from /lib/libgcc_s.so.1
> #2 0x0ffadf48 in __cxa_throw () from /usr/lib/libstdc++.so.6
> #3 0x10000bcc in main ()
>
> Bye
>
> ------
>
> #include <stdexcept>
> #include <iostream>
>
> int main()
> {
> try
> {
> throw std::runtime_error("Exception thrown");
> }
> catch (std::runtime_error const& e)
> {
> std::cerr << "Caught runtime_error: " << e.what() << std::endl;
> }
> catch (...)
> {
> std::cerr << "Caught unknown exception!" << std::endl;
> }
> }
>
> ** Affects: gcc-4.1 (Ubuntu)
> Importance: Critical
> Status: Confirmed
>
> ** Changed in: gcc-4.1 (Ubuntu)
> Importance: Untriaged => Critical
> Status: Unconfirmed => Confirmed
>
>

Revision history for this message
Roger Leigh (rleigh) wrote :

Matthias,

Also see:
http://librarian.launchpad.net/3303410/buildlog_ubuntu-edgy-powerpc.schroot_0.99.2-2ubuntu1_FAILEDTOBUILD.txt.gz

The testsuite fails for all tests throwing exceptions. The above test I wrote is just a minimal testcase for that. Most package builds don't throw exceptions, so this will only show up at runtime for them.

Revision history for this message
Matthias Klose (doko) wrote :

Roger,

thanks for the pointer. I'm unable to reproduce the failure with g++-4.1.1-8 on unstable (explicitely using -fstack-protector), the current g++-4.1.1-8ubuntu1 FTBFS on powerpc. Currently looking at the build issues.

Revision history for this message
Roger Leigh (rleigh) wrote :

From the build log toolchain package versions: g++-4.1_4.1.1-2ubuntu5

It may just be an outdated buildd chroot, and the bug is already fixed?

Revision history for this message
Matthias Klose (doko) wrote :

no, the chroot is up to date; it's https://launchpad.net/distros/ubuntu/+source/gcc-4.1/4.1.1-8ubuntu1
which fails

Revision history for this message
Roger Leigh (rleigh) wrote :

From the build log toolchain package versions: g++-4.1_4.1.1-2ubuntu5

It may just be an outdated buildd chroot, and the bug is already fixed?

Revision history for this message
Matthias Klose (doko) wrote :

fixed in 4.1.1-8ubuntu2

Changed in gcc-4.1:
assignee: nobody → doko
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.