https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100415
Bug ID: 100415 Summary: runtime error: reference binding to null pointer of type 'const struct __forced_unwind' Product: gcc Version: 10.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- #include <pthread.h> #include <cxxabi.h> int main() { try { pthread_exit(0); } catch (const __cxxabiv1::__forced_unwind&) { throw; } } This produces a UBsan error: $ g++ -fsanitize=undefined fu.C $ ./a.out fu.C:9:45: runtime error: reference binding to null pointer of type 'const struct __forced_unwind' Is libgcc creating a fake object at address 0? Should __forced_unwind exceptions be caught by value instead?