https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207359

            Bug ID: 207359
           Summary: projects/clang380-import for TARGET_ARCH=powerpc64 via
                    powerpc64-gcc : c++ exceptions unbounded loop in
                    _Unwind_RaiseException (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: mar...@dsl-only.net

>From a buildworld/buildkernel install for TARGET_ARCH=powerpc64 based on
powerpc64-xtoolchain-gcc/powerpc64-gcc form projects/clang380-import -r205601.
. .

#include <exception>

int main(void)
{
    try { throw std::exception(); }
    catch (std::exception& e) {} // same result without &
    return 0;
}

(This simplifies what I found in trying to use "kyua test -k
/usr/tests/Kyuafile", which does not progress but uses 100% of a cpu/oore.)

# g++ --version
g++ (FreeBSD Ports Collection for powerpc64) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# g++ -I /usr/include/c++/v1/ -L /usr/lib/ -g -Wall -pedantic
exception_test.cpp

./a.out never finishes.

from gdb:

Program received signal SIGINT, Interrupt.
0x000000005002a088 in .__sys_sigprocmask () from /libexec/ld-elf.so.1
(gdb) bt
#0  0x000000005002a088 in .__sys_sigprocmask () from /libexec/ld-elf.so.1
#1  0x0000000050029c1c in sigprocmask (how=0, set=0x500493a4 <oldsigmask>,
oset=0x0) at /usr/src/lib/libc/sys/sigprocmask.c:48
#2  0x0000000050022d98 in def_lock_release (lock=<optimized out>) at
/usr/src/libexec/rtld-elf/rtld_lock.c:141
#3  0x0000000050023028 in lock_release (lock=0x500496a8 <rtld_locks+32>,
lockstate=<optimized out>) at /usr/src/libexec/rtld-elf/rtld_lock.c:234
#4  0x000000005001ddac in dl_iterate_phdr (callback=@0x501e1b50: 0x501ce350
<_Unwind_IteratePhdrCallback>, param=0xffffffffffffc210) at
/usr/src/libexec/rtld-elf/rtld.c:3544
#5  0x00000000501cf33c in _Unwind_Find_FDE (pc=0x5016e39f
<throw_exception(__cxxabiv1::__cxa_exception*)+143>, bases=0xffffffffffffd1d8)
    at /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2-fde-glibc.c:420
#6  0x00000000501ca9e0 in uw_frame_state_for
(context=context@entry=0xffffffffffffcd30, fs=fs@entry=0xffffffffffffc3b0) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:1106
#7  0x00000000501cb968 in _Unwind_RaiseException (exc=0x50815058) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind.inc:103
#8  0x000000005016e3a0 in throw_exception (ex=0x50815000) at
/usr/src/lib/libcxxrt/../../contrib/libcxxrt/exception.cc:751
#9  0x0000000010000d50 in main () at exception_test.cpp:5
. . . repeated finish commands until . . .
(gdb) finish
Run till exit from #0  _Unwind_RaiseException (exc=0x50815058) at
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind.inc:117
^C
Program received signal SIGINT, Interrupt.
0x000000005002a088 in .__sys_sigprocmask () from /libexec/ld-elf.so.1

_Unwind_RaiseException never returns.

kyua did the same thing but is a more complicated context.

Using g++49's a.out gets the same result for:

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

But the a.out works fine for:

# g++49 -g -Wall -pedantic exception_test.cpp
# ./a.out
# 

The difference is the headers/libraries involved.

(powerpc64-gcc cannot be used that way: it has a freestanding status and the
include path and libraries path need to be supplied.)

(clang 3.8.0 is not up to doing a buildworld. For example: it does not support
soft float yet, at least last checked. This is part of why I test the provided
(ports) cross compile environment for powerpc64 [but in a self-hosted form].)

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to