https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98805

            Bug ID: 98805
           Summary: exception abort on mac os 11 (big sur)
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hanicka at hanicka dot net
  Target Milestone: ---

Any C++ code I try to compile with GCC 10.2.0 (homebrew package AND build from
source) aborts when exception is thrown even when the exception should caught.

This minimal example aborts:

```
struct exception { };

int main() {
        try {
                throw exception{};
        } catch (exception) {

        } catch (...) {

        }
}
```
(Build with g++ exception.cpp && ./a.out)

My GCC build is:
```
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-10.2/bin/g++-10.2
COLLECT_LTO_WRAPPER=/usr/local/gcc-10.2/libexec/gcc/x86_64-apple-darwin20.2.0/10.2.0/lto-wrapper
Target: x86_64-apple-darwin20.2.0
Configured with: ../gcc-10.2.0/configure --prefix=/usr/local/gcc-10.2
--enable-checking=release --enable-languages=c,c++ --disable-multilib
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
--program-suffix=-10.2
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC) 
```

Backtrace of the binary when crashes is:
```
  * frame #0: 0x00007fff20347462 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff20375610 libsystem_pthread.dylib`pthread_kill + 263
    frame #2: 0x00007fff202c8720 libsystem_c.dylib`abort + 120
    frame #3: 0x000000010048b00a libgcc_s.1.dylib`uw_init_context_1.cold + 5
    frame #4: 0x0000000100488475
libgcc_s.1.dylib`_Unwind_RaiseException(exc=0x0000000100505760) at
unwind.inc:93:3
    frame #5: 0x00000001001382f7 libstdc++.6.dylib`__cxa_throw + 55
    frame #6: 0x0000000100003f13 a.out`main at exception.cpp:5:19
    frame #7: 0x00007fff20390621 libdyld.dylib`start + 1
```

Reply via email to