Xcode unit tests crashing from SPM generated project before running tests

This is happening on every SPM Xcode generated project for me, it started with Xcode 9.3 but is extant in 9.4 as well. It looks like it happens when it spawns a thread to run the test, and I have turned off the various Xcode sanitiser and thread checks but no change. The error itself suggests it doesn't have permission to spawn the thread.

Tests complete without issue when run using SPM

Every SPM-generated project? Like, if you just run

swift package init --type=executable
swift package generate-xcodeproj

and run the project without writing anything else, do you get this error?

What if you just run swift run instead of running from within Xcode?

Yup. Every.

Everything runs fine from command line (swift run, swift test etc)

Can you try continuing execution, or running without a debugger?

Everything runs fine from command line (swift run, swift test etc)

That hints to me that it really is an Xcode issue, then. Can you undo whatever tweaks you've made to Xcode?

You might have to uninstall it, delete the preferences from your Library, and reinstall…

I'll try that. Any clues on how to delete the preferences?