NetBSD-Bugs archive

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

port-vax/43273: ld.elf_so frame handling breaks exception unwinding for C++



>Number:         43273
>Category:       port-vax
>Synopsis:       ld.elf_so frame handling breaks exception unwinding for C++
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-vax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 06 22:15:00 +0000 2010
>Originator:     Martin Husemann
>Release:        NetBSD 5.99.27
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD dead-to-the-world.duskware.de 5.99.27 NetBSD 5.99.27 (DEAD) #29: 
Wed Apr 28 10:12:36 CEST 2010 
martin%night-porter.duskware.de@localhost:/usr/src/sys/arch/vax/compile/DEAD vax
Architecture: vax
Machine: vax
>Description:

Exception handling for dynamically linke C++ applications is broken on VAX
(there are more problems, statically linked programs fail for other reasons).
Looking at the call stack during a throw operation:

#0  0x7f6b2c57 in _Unwind_RaiseException (2134913164)
   from /usr/lib/libgcc_s.so.1
#1  0x7f7e29be in _rtld_bind_start (2134913164) from /usr/libexec/ld.elf_so
#2  0x7f78c501 in __cxa_throw (2134913184, 135644, 2138606296)
   from /usr/lib/libstdc++.so.7
#3  0x00010cfd in main (1, 2147478568, 2147478576) at test.cpp:14

Obviously frame #1 should not be there. This breaks unwinding, since
_Unwind_RaiseException() uses __builtin_return_address(0) == 0x7f7e29be
and tries to find a frame desription for it. It expects to get 0x7f78c501
here, and with that value it would be able to find a frame description.
With the pc in ld.elf_so (which can't have frame descriptions), it fails
and assumes it has walked out of the stack and terminates the app.

>How-To-Repeat:
throw C++ exceptions on VAX, watch the catch handler not being called.

>Fix:
n/a



Home | Main Index | Thread Index | Old Index