Post

Replies

Boosts

Views

Activity

Reply to EXC_BAD_ACCESS (code=10... when calling init on a struct
Haha, thanks! Yes the crash still occurs for the exact scenario you described (build and test with the main app — so the full suite of tests is available — running just one specific test by clicking the diamond next to it). I also made sure that UP() is called first thing in the setUp function and the crash still happens for that too. I also tested on Xcode 12.5: this exact scenario passes on it, so the issue seems to be new to one of the Xcode 13.x releases...
Jan ’22
Reply to EXC_BAD_ACCESS (code=10... when calling init on a struct
For the later, a workaround: we found the proposed form of it won't work. That is, even if the framework under discussion has all its tests disabled we actually get similar code=10 crashes in other areas of the codebase (e.g. even in methods called from the app delegate on launching the host app to unit test), that don't look to have to do with initializing structs, both on iOS 14.5 and 15 simulators (all testing was previously on iOS 14.5). For the former, an actionable bug report: correct, the host application popup is set to our app. We also tried without it, i.e. by unit testing the offending framework directly without building the full app—and the crash does still occur, so that might help narrow things down. The current plan is to try getting the framework to build with as few dependencies as possible to see if any of them (or even their quantity?) is the issue (there are currently ~13-30 local and remote SPM packages and frameworks—depending how one counts—marked as dependencies for the Xcodeproject that creates the .framework).
Jan ’22
Reply to EXC_BAD_ACCESS (code=10... when calling init on a struct
Issue resolved. It doesn't look to be a Swift runtime (or Xcode related) bug. Thanks @eskimo for your thoughts and feedback! We were simply missing the following line in our Xcodeproject for the framework with the crashing tests: S475A718279U3V7600S7P2D8 /* SomeDependencyFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SomeDependencyFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; Interestingly for posterity: unit testing that Xcodeproject framework with/without an xctestplan did/didn't cause its unit tests to fail respectively.
Jan ’22