From owner-freebsd-bugs@freebsd.org Fri Feb 19 06:41:01 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74BECAAD847 for ; Fri, 19 Feb 2016 06:41:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6411412F0 for ; Fri, 19 Feb 2016 06:41:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J6f1DF040970 for ; Fri, 19 Feb 2016 06:41:01 GMT (envelope-from bugzilla-noreply@freebsd.org) 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) Date: Fri, 19 Feb 2016 06:41:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2016 06:41:01 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207325 Bug ID: 207325 Summary: projects/clang380-import for TARGET_ARCH=3Dpowerpc : c++ exceptions cause SEGV (9 line program) Product: Base System Version: 11.0-CURRENT Hardware: ppc OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: markmi@dsl-only.net When run the following 9 or so program compiled by clang 3.8.0 (from project/clang380import -r295601) for TARGET_ARCH=3Dpowerpc gets a SEGV: #include int main(void) { try { throw std::exception(); } catch (std::exception& e) {} // same result without & return 0; } (This simplifies what I found in trying to build and use some ports. For example, it blocks using "kyua test -k /usr/tests/Kyuafile", which gets a S= EGV and aborts.) # clang++ -g -std=3Dc++11 -Wall -Wpedantic exception_test.cpp # ./a.out Segmentation fault (core dumped) Trying under gdb: . . . (gdb) run Starting program: /root/c_tests/a.out=20 Program received signal SIGSEGV, Segmentation fault. _Unwind_GetGR (context=3D0xffffd5a0, index=3D) at /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:177 177 return * (_Unwind_Ptr *) ptr; (gdb) bt #0 _Unwind_GetGR (context=3D0xffffd5a0, index=3D) at /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:177 #1 _Unwind_GetPtr (context=3D0xffffd5a0, index=3D) at /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:188 #2 uw_update_context (context=3D0xffffd5a0, fs=3D0xffffd0e0) at /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:1370 #3 _Unwind_RaiseException (exc=3D) at /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind.inc:126 #4 0x4192970c in throw_exception (ex=3D) at /usr/src/lib/libcxxrt/../../contrib/libcxxrt/exception.cc:751 #5 __cxa_throw (thrown_exception=3D, tinfo=3D, dest=3D) at /usr/src/lib/libcxxrt/../../contrib/libcxxrt/exception.cc:778 #6 0x00000000 in ?? () Context details: # freebsd-version -ku; uname -aKU 11.0-CURRENT 11.0-CURRENT FreeBSD FBSDG4C1 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r295601M: Sun Feb 14 15:49:49 PST 2016=20=20=20=20 markmi@FreeBSDx64:/usr/obj/clang_gcc421/powerpc.powerpc/usr/src/sys/GENERIC= vtsc-NODEBUG powerpc 1100097 1100097 buildkernel is via gcc 4.2.1 buildworld is via clang 3.8.0 (I've been experimenting with and submitting issues from this environment, = an arm rip2 environment (clang 3.8.0 for both buildworld and buildkernel), and powerpc64 (via powerpc64-gcc, not clang). So there are some fixes/workaroun= ds for various issues in my environment.) # svnlite status /usr/src/ ? /usr/src/.snap M /usr/src/contrib/libc++/include/__config M /usr/src/contrib/libcxxrt/guard.cc M /usr/src/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp M /usr/src/lib/csu/powerpc64/Makefile ? /usr/src/restoresymtable ? /usr/src/sys/arm/conf/RPI2-NODBG M /usr/src/sys/boot/ofw/Makefile.inc M /usr/src/sys/boot/powerpc/Makefile M /usr/src/sys/boot/powerpc/Makefile.inc M /usr/src/sys/boot/uboot/Makefile.inc M /usr/src/sys/conf/Makefile.powerpc M /usr/src/sys/conf/kern.mk M /usr/src/sys/conf/kmod.mk ? /usr/src/sys/powerpc/conf/GENERIC64-NODBG ? /usr/src/sys/powerpc/conf/GENERIC64vtsc ? /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODEBUG ? /usr/src/sys/powerpc/conf/GENERICvtsc ? /usr/src/sys/powerpc/conf/GENERICvtsc-NODEBUG M /usr/src/sys/powerpc/ofw/ofw_machdep.c M /usr/src/sys/powerpc/powerpc/exec_machdep.c For TARGET_ARCH=3Dpowerpc the signal delivery has a "red zone" added to dea= l with clang 3.8.0 moving the stack pointer late on entry to functions and early on exit from functions compared to the ABI. And there is a va_arg fix for va_list's gpr and fpr value handling to be sure the overflow area is used w= hen it should be. There is tracking of command line option changes. --=20 You are receiving this mail because: You are the assignee for the bug.=