From what I can gather, crashes like this are caused by the order of static initializers. However, the class that it is crashing in doesn’t use any static objects as far as I can tell. Possibly an earlier static initializer is corrupting memory, causing it to crash here. Any tips on tracking this down?
Hey @RolandMR,
Did you ever get the bottom of this one? I love the obscurity of “line:0” in the symbolicated report, which is exactly the same type of crash I have here! And of course we’ll investigate the static initialization stuff (but we’d been pretty careful about that knowing the “fiasco” issue for statics).
Thanks for this. Can you recall if these were simple types (int, float, etc) or more complex types that were constexpr? (It sounds like you just removed or refactored them in your case and this fixed it for whomever had the problem?)
Stumbled upon this post, because a tester reported the same type of crash.
I do use a lot of “static constexpr” in various headers. Should I remove all of them?
I like them, because they are very convenient for initialising e.g. floats or const char*.
I am also wondering about the “static constexpr”. Are they only a problem, if they lead to the “static initialisation order fiasco”? Or are they generally a problem, even outside of a “static initialisation order fiasco”?
what Xcode version do you use?
maybe the static constexpr is not supported well in some Xcode versions asking because I had some issues with static inline variables but in Win with MSVC.
@alatar@MZ1 — we haven’t tracked this down precisely but we have seen report from both Logic Pro and Studio One. One of the workarounds (which sounds a bit odd) for Logic Pro is to: close Logic Pro, move the .component, reopen the project (which will fail without the plugin), close again, move the plugin back. Then it works afterwards! I wonder if forcing a full AU re-scan and resetting AU cache might help (and be less of PITA) but I haven’t been able to reproduce (the best kinds of bugs of course!).
Ah, interesting.
Yes, for us it was also in Logic.
And its a very rare and random problem for us (as far as I understand the testers).
Only happens very seldom.
This is rearing its head again… I assume this SO post is pointing to the potential problem with static constexpr in header files. And that there are different possible mitigations for: