EXC_BAD_ACCESS Error in Xcode 16 with Testable Import and Mocking

I’m working on a framework project with an unusual setup:

  • The framework itself
  • Two unit test targets
  • An additional test library to share tools across the tests

The test library uses @testable import MyFramework to mock and override an internal framework class. The new class is then made public and used in the tests.

This setup used to work with Xcode 15, but now, with Xcode 16, I’m getting an EXC_BAD_ACCESS error.

Is this a new Swift bug? Or should I be wondering how this ever worked before?

i have been seeing similar things in my executions specifically inconsistencies detected in dispatching queue debug checks and counters having an incorrect or out of range value in them.