Skip to content

Fix segmentation fault on macOS ARM64 with Clang 19#38

Open
firilisinof wants to merge 1 commit intoschnorr:masterfrom
firilisinof:fix-macos-arm64-segfault
Open

Fix segmentation fault on macOS ARM64 with Clang 19#38
firilisinof wants to merge 1 commit intoschnorr:masterfrom
firilisinof:fix-macos-arm64-segfault

Conversation

@firilisinof
Copy link

This fixes the issue #37. The commit fixes two issues causing crashes on modern macOS systems with Clang 19:

  1. Add virtual destructor to PajeEntity class
  • Prevents undefined behavior when deleting derived objects through base pointers
  • Resolves -Wdelete-abstract-non-virtual-dtor compiler warnings
  1. Fix dangling iterator in valuesForEntityType
  • Store container returned by values() before iterating
  • Prevents iteration over destroyed temporary object
  • Resolves -Wdangling-gsl compiler warning

These issues manifest as segmentation faults on Apple Silicon Macs with Clang 19.1.7.

It modifies src/tools/CMakeLists.txt to compile correctly in Apple systems.

This commit fixes two issues causing crashes on modern macOS systems with Clang 19:

1. Add virtual destructor to PajeEntity class
  - Prevents undefined behavior when deleting derived objects through base pointers
  - Resolves -Wdelete-abstract-non-virtual-dtor compiler warnings
2. Fix dangling iterator in valuesForEntityType
  - Store container returned by values() before iterating
  - Prevents iteration over destroyed temporary object
  - Resolves -Wdangling-gsl compiler warning

These issues manifest as segmentation faults on Apple Silicon Macs with Clang 19.1.7.

It modifies src/tools/CMakeLists.txt to compile correctly in Apple systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant