Issue 163487
Summary clang-tidy 21.1.2 crashes on JUCE-based GhostLatheProcessor.cpp
Labels clang-tidy
Assignees
Reporter DavidDanielSauce
    ### Summary

`clang-tidy` 21.1.2 from Homebrew (`llvm@21`, arm64) segfaults when analyzing JUCE-heavy translation units in the GhostLathe audio plugin project. The crash is deterministic on macOS 14.5 when running against `GhostLatheProcessor.cpp` or the associated unit tests.

### Version

21.1.2 (Homebrew `llvm@21` build, arm64)

### OS

macOS 14.5 (arm64)

### Steps to Reproduce

1. Install llvm@21 via Homebrew: `brew install llvm@21`.
2. Configure GhostLathe with compile commands:
   ```
 cmake -S . -B build -G Ninja \
     -DCMAKE_BUILD_TYPE=Debug \
 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
   ```
3. Ensure `/opt/homebrew/opt/llvm@21/bin` is first on `PATH`.
4. Run clang-tidy against the problematic TU:
   ```
   run-clang-tidy -p build \
 -clang-tidy-binary clang-tidy \
     src/plugin/GhostLatheProcessor.cpp
 ```

### Expected Behavior

clang-tidy completes analysis and emits diagnostics for the translation unit.

### Actual Behavior

clang-tidy terminates with a segmentation fault while traversing JUCE-generated constructs in `GhostLatheProcessor.cpp`. The crash reproduces consistently on related unit tests (`tests/plugin/GhostLatheProcessorTests.cpp`) as well. A sanitized backtrace and logs are included in the attachments.

### Additional Context

- Downgrading to llvm@20 (clang-tidy 20.1.x) avoids the crash; we currently pin CI to that toolchain.
- JUCE version: 8.0.10. Project builds with CMake 3.30.2 and Ninja 1.12.1; SDKROOT points to the Xcode 16 macOS 14.4/26.0 SDK.
- Sanitized reproduction bundle (sources subset, compile commands, logs) plus stack trace are published here: <https://gist.github.com/DavidDanielSauce/e5cea023e78b31b9b0de0572ed7fef1f>.
 - The gist contains `clang_tidy_crash_report.md`, `clang_tidy_crash_20250930.log`, and a base64-encoded `clang_tidy_crash_bundled.tgz` (decode with `base64 -d clang_tidy_crash_bundled.tgz.base64 > clang_tidy_crash_bundled.tgz`).
- Happy to provide additional sanitized artefacts (e.g., full compile database) if needed.

Thanks for taking a look!

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to