DIPlib / diplib

Quantitative Image Analysis in C++, MATLAB and Python
https://diplib.org
Apache License 2.0
228 stars 50 forks source link

_Unwind_GetDataRelBase() not implemented #146

Closed crisluengo closed 2 months ago

crisluengo commented 8 months ago

Since recently, DIPlib compiled with GCC on an M1 macOS machine crashes whenever an exception is thrown outside the library (this happens both on my own iMac and my work MacBook Pro). It prints to the command line:

libunwind: _Unwind_GetDataRelBase - _Unwind_GetDataRelBase() not implemented

and terminates with SIGABRT. This can be reproduced by just running the tests. It happens both in debug and release modes. The Python bindings cause Python to abort when an error is generated.

I'm using GCC 13.2.0 installed through Homebrew, and Xcode 15.0.0. This didn't use to happen until recently (I've upgraded both Xcode and GCC!). It also does not happen when compiling with Clang, and is not observed on the CI runner (one of which is an Intel macOS machine compiling with an older Xcode Clang, another is an Intel Linux machine compiling with GCC).

The only related issue I've found online is this one: https://gromacs.bioexcel.eu/t/pressure-equilibration-on-mac-not-working/8314 -- not very helpful.

The unimplemented function, according to Linux documentation is an IA64 function, I wouldn't expect it to be called on an aarch64 platform. So I'm not surprised it's not implemented. But why is it being called?

I could not reproduce this issue with a simple project, I'm not sure which feature of DIPlib is causing this issue.


For now, if you happen to have this issue, the workaround is to build with Xcode Clang.

Another solution is to install GCC 12 (brew install gcc@12), then configure CMake to use gcc-12 and g++-12. This issue seems specific to GCC 13.

crisluengo commented 2 months ago

I'm using GCC 14.2.0 now, and this issue is no longer coming up. It must have been fixed.