[Bug 5174] New: Uncatchable C++ exceptions with NPTL on ARM and -fomit-frame-pointer

bugzilla at busybox.net bugzilla at busybox.net
Fri May 4 16:08:31 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=5174

           Summary: Uncatchable C++ exceptions with NPTL on ARM and
                    -fomit-frame-pointer
           Product: uClibc
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Threads
        AssignedTo: unassigned at uclibc.org
        ReportedBy: uclibc-bugs at qult.net
                CC: uclibc-cvs at uclibc.org
   Estimated Hours: 0.0


Created attachment 4322
  --> https://bugs.busybox.net/attachment.cgi?id=4322
The source code

Some exceptions seem to be uncatchable when running a dynamically linked binary
with libpthread and uClibc with NPTL support.

The binary must be composed of two compilation units which source files are in
the attached tarball.  The whole executable must be compiled in the following
way:

  arm-linux-g++ -fomit-frame-pointer -o ex-bug ex-bug.cc ex-bug1.cc -lpthread

Apparently it doesn't matter which version of GCC/uClibc/binutils it has been
compiled with.  In any case, when run in an environment with uClibc with NPTL
support, it crashes with signal SIGABRT instead of quitting silently.

Note that this problem doesn't appear when either:

 . uClibc in the runtime environment is compiled with linuxthreads instead of
NPTL.
 . the executable is not linked with libpthread
 . the executable is linked statically
 . the executable is compiled without -fomit-frame-pointer
 . the code is not split in two separate compilation units
 . the instance of Foo is not created the local scope of throw_something()
 . the destructor of Foo can be optimized-out by GCC (hence the "volatile"
qualifier)
 . the call to throw_something() in main() is not in a try/catch block
 . the catch doesn't intend to catch the thrown exception

I've just tested this on uClibc snapshot and buildroot
4205dbd9f665556cc56a36c0e11a5f845c73a57a, but have tested it before in earlier
uClibc version that offered support for NPTL and some earlier buildroot
commits.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list