Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Feb 2016 00:14:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 207325] projects/clang380-import for TARGET_ARCH=powerpc : c++ exceptions cause SEGV (9 line program)
Message-ID:  <bug-207325-8-bz8Qp5nQ4J@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-207325-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-207325-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207325

--- Comment #1 from Mark Millard <markmi@dsl-only.net> ---
(In reply to Mark Millard from comment #0)

If for TARGET_ARCH=3Dpowerpc I try using lang/gcc5 at the compiler instead =
of
clang 3.8.0:

# g++5 -I /usr/include/c++/v1/ -L /usr/lib/ -g -Wall -pedantic
exception_test.cpp
or
# g++5 -g -Wall -pedantic exception_test.cpp
or
# g++49 -g -Wall -pedantic exception_test.cpp
or
# g++49 -I /usr/include/c++/v1/ -L /usr/lib/ -g -Wall -pedantic
exception_test.cpp

(Note the lack of -Wl,-rpath=3D/usr/local/lib/gcc5 or
-Wl,-rpath=3D/usr/local/lib/gcc5 use.)

Then for the ./a.out I get the same SEGV at the same place as with clang 3.=
8.0
as the compiler in use, despite g++5's/g++49's use of _Unwind_Resume_or_Ret=
hrow
being the caller of _Unwind_RaiseException:

# ./a.out
terminate called after throwing an instance of 'std::exception'
Segmentation fault (core dumped)

Picking one core's backtrace to display:

Core was generated by `a.out'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  _Unwind_GetGR (context=3D0xffffce80, index=3D<optimized out>) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:177
177         return * (_Unwind_Ptr *) ptr;
(gdb) bt
#0  _Unwind_GetGR (context=3D0xffffce80, index=3D<optimized out>) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:177
#1  _Unwind_GetPtr (context=3D0xffffce80, index=3D<optimized out>) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:188
#2  uw_update_context (context=3D0xffffce80, fs=3D0xffffc9c0) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:1370
#3  _Unwind_RaiseException (exc=3D<optimized out>) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind.inc:126
#4  0x41a25d8c in _Unwind_Resume_or_Rethrow (exc=3D<optimized out>) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind.inc:256
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The following do not fail:

# g++49 -Wl,-rpath=3D/usr/local/lib/gcc49 -g -Wall -pedantic exception_test=
.cpp
# ./a.out
# g++5 -Wl,-rpath=3D/usr/local/lib/gcc5 -g -Wall -pedantic exception_test.c=
pp
# ./a.out
#

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207325-8-bz8Qp5nQ4J>