# Xcode 13 clang crash

**URL:** <https://forum.juce.com/t/xcode-13-clang-crash/49088>\
**Category:** General JUCE discussion\
**Created:** [December 6, 2021, 1:49pm UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088 "2021-12-06T13:49:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![audiothing](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/audiothing/32/8906_2.png) [@audiothing](https://forum.juce.com/u/audiothing)\
**Post date:** [December 6, 2021, 1:49pm UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/1 "2021-12-06T13:49:17Z")

</div>

I’ve already submitted feedback to Apple but just wondering if anyone is having the same issue.  
I recently got a new MacBook Pro M1 Max, running Monterey and Xcode 13.  
A project that was building fine on Big Sur (M1, Xcode 12), now crashes with the following error:

```auto
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)

```

No other information or specifics. Tens of other projects build without issues.  
The crash happens only when arm64 is selected, no crash for x86\_64.  
I’m also able to avoid the crash if I use -O1 optimization.

If I remove PluginEditor.cpp and PluginEditor.h it also builds fine. However, there’s nothing fancy in this plugin editor, very similar to other projects. And again, Xcode 12 on Big Sur build without issues.

Any idea what could it be?

---

<div class="post-metadata">

**Author:** ![hyakken](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hyakken](https://forum.juce.com/u/hyakken)\
**Post date:** [March 14, 2022, 10:11am UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/2 "2022-03-14T10:11:32Z")

</div>

Did you solve this issue?  
I just got the same error.

Thank you

---

<div class="post-metadata">

**Author:** ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)\
**Post date:** [March 14, 2022, 10:42am UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/3 "2022-03-14T10:42:34Z")

</div>

We also experience spurious segfaults with Apple clang 12 on our CI machines from times to times. I’d say approximately something like 1 of 200 builds. We once started documenting that but could not find a clear pattern. Simply restarting the build usually fixes it. Is the error that you experience reproducible?

---

<div class="post-metadata">

**Author:** ![hyakken](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hyakken](https://forum.juce.com/u/hyakken)\
**Post date:** [March 14, 2022, 11:26am UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/4 "2022-03-14T11:26:09Z")

</div>

After updating Projucer to 6.1.6, one of our plugin always have this error.  
But it only occurs in the release build.  
I have tried clearing the cache of Xcode and restarting Xcode. Neither worked.

---

<div class="post-metadata">

**Author:** ![aamf](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aamf/32/19941_2.png) [@aamf](https://forum.juce.com/u/aamf)\
**Post date:** [March 14, 2022, 2:11pm UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/5 "2022-03-14T14:11:50Z")

</div>

I’m having the same problem with an iOS app. I’m still on 6.1.5, so I don’t think the JUCE update was the culprit. The error only appears on release builds above -01 optimisation. Updating Xcode made no difference.

---

<div class="post-metadata">

**Author:** ![audiothing](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/audiothing/32/8906_2.png) [@audiothing](https://forum.juce.com/u/audiothing)\
**Post date:** [March 14, 2022, 2:14pm UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/6 "2022-03-14T14:14:39Z")

</div>

The issue is still there, only with one specific plugin (all our other plugins are building fine).  
There are 2 workarounds I have found, build the project with -O1 optimization or build it on an older M1 MacBook with Big Sur and Xcode 12.

For us it’s not random, it happens all the time. I don’t think it’s JUCE related.

---

<div class="post-metadata">

**Author:** ![mcmartin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mcmartin/32/7432_2.png) [@mcmartin](https://forum.juce.com/u/mcmartin)\
**Post date:** [March 15, 2022, 10:49pm UTC](https://forum.juce.com/t/xcode-13-clang-crash/49088/7 "2022-03-15T22:49:00Z")

</div>

Xcode 13.3 was released yesterday. Did you try it out?

If you can make an example that only uses open-source code, I would be happy to look into this issue.
