mattgallagher / CwlPreconditionTesting

A Mach exception handler that allows Swift precondition failures to be caught and tested.
ISC License
175 stars 46 forks source link

Apple Silicon under Rosetta #26

Closed asiliuk closed 1 year ago

asiliuk commented 2 years ago

Looks like assertion is still raised if run on M1 under Rosetta. This could happen if target simulator is less then iOS 13.7 or by checking "Open with Rosetta" on Xcode app.

image showing EXC_BAD_INSTRUCTION

I have too little knowledge to try and fix it myself, is it even possible to address? It compiles sources with x86_64 architecture and I'm not sure how to differentiate Intel vs Apple Silicon

Maybe you have any suggestions where to start? Thank you!

Veeit commented 2 years ago

I have the same problem, would love to see a solution

mattgallagher commented 1 year ago

Sorry to take so long to comment on this issue. As far as I can tell, this is an issue with lldb on Rosetta, not with the code itself – lldb always interferes and stop the execution when the bad exception is raised, despite the handler being in-place and the code working correctly.

To move past this, you must run these tests without debugging the executable. i.e. with the "Debug executable" unchecked in the scheme's "Test" settings:

Image 2-4-2023 at 16 27