misaligned_stack_error after moving some code into external framework (Cocoa)
I just moved a 开发者_运维技巧bunch of code into a separate framework. Nothing has changed in the code since the move and it compiles fine. However, on runtime, It crashes with "misaligned_stack_error". I've been looking around and some people are saying -mstackrealign fixes it, however I have added it to the C flags for both projects in Xcode and it still crashes, exactly the same way.
(Please note the format of the projects: a framework, loaded into a plugin, which installs into some 3rd party software).
I'd greatly appreciate some help to resolve this issue.
Without seeing either the code or the backtrace at the point of the crash, it is impossible to precisely say what is wrong.
Shooting a rubberband into the dark, I'd guess that something is either incorrectly dynamically generating a bit of code or there is a bit of buggy assembly in the mix somewhere. In either case, something isn't following the ABI of the architecture correctly, leading to the crash.
精彩评论