Xcode 11.3 simulator SIGABRT on launch

I have an app that launches fine on device and the simulator from Xcode 11.2 on macOS 10.15.1.


I just upgraded to Xcode 11.3 and macOS 10.15.2. The app still launches fine from Xcode to a device. When launching on the simulator, it immediately crashes with "Message from debugger: Terminated due to signal 6". This happens with 13.3 and 11.4 simulated devices.


Stack trace below. It doesn't look to me like it's even getting into the app code. Anyone else seeing this?


#00x00007fff523d5bea in __abort_with_payload ()
#10x00007fff523d74f3 in abort_with_payload_wrapper_internal ()
#20x00007fff523d74a3 in abort_with_reason ()
#30x00007fff52469974 in pthread_self.cold.1 ()
#40x00007fff52462fe3 in pthread_self ()
#50x0000000106eff16b in __tsan::cur_thread() ()
#60x0000000106ed4985 in wrap_sysctlbyname ()
#70x00007fff52470331 in assert_simulator_supported_host ()
#80x00007fff4ff167c1 in libSystem_initializer ()
#90x0000000106e063a7 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) ()
#100x0000000106e067b8 in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) ()
#110x0000000106e019a2 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#120x0000000106e0190f in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#130x0000000106e0190f in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#140x0000000106e0190f in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#150x0000000106e007a6 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#160x0000000106e00846 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) ()
#170x0000000106df5046 in dyld::initializeMainExecutable() ()
#180x0000000106df90fc in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#190x0000000106df41cd in start_sim ()
#200x0000000111dfa8cc in dyld::useSimulatorDyld(int, macho_header const*, char const*, int, char const**, char const**, char const**, unsigned long*, unsigned long*) ()
#210x0000000111df8575 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#220x0000000111df3227 in dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) ()
#230x0000000111df3025 in _dyld_start ()

Accepted Reply

This is due to the thread sanitizer being enabled for the target. I logged this as FB7489601 this morning and I would recommend logging a duplicate so that it gets more attention. The workaround is to disable TSan.

Replies

I've been helping a friend with what appears to be the same issue. He has a MBP 2018 and I believe the same versions you mentioned.


We were able to test an app without frameworks in the simulator, but our app with frameworks (using carthage, but I dont think CARTHAGE is at fault).

I'm the friend 🙂

I am encountering the same issue and my app has custom frameworks.


Mac OS: 10.15.2

Xcode: 11.3, 11.2.1

Same issue here. I think the Mac OS 10.15.2 is the problem cause it only started to occur after the upgrade.

Some more details:


I reverted to Xcode 11.2.1 and the problem still occurs, so I think it's an issue in 10.15.2. Unfortunately, I unwisely upgraded Xcode and macOS at the same time, so I don't know for certain that it would have happened even if I'd never upgraded Xcode.


Another odd thing is that I can run UI tests on the simulator from Xcode, and after that I can launch the copy of my app that gets installed to the simulator. But just trying to install/debug the app on the simulator directly still seems to be failing before the app actually launches, and leaves it in a bad state that can't be launched.


The app uses a bunch of Cocoapods. I have other apps that use pods, but they launch fine.


The computer is a 2017 iMac with 24GB of memory.


thx for the replies

This is due to the thread sanitizer being enabled for the target. I logged this as FB7489601 this morning and I would recommend logging a duplicate so that it gets more attention. The workaround is to disable TSan.

Disabled the thread sanitizer and back to normal. Cheers!

That's it, thank you so much!

Disable Thread Sanitizer and it works. Thanks a lot!!! You saved the day..

The root cause has been identified. It affects TSAN in simulators on macOS 10.15.2. Until a fix is available you can turn TSAN off or avoid upgrading to 10.15.2.

We're seeing the same issue with our app when building on 10.15.2 and running in the simulator. Turning off TSAN in simulator as suggested resolved it for us. Any idea of when we can expect a fix? Thanks!

I can confirm that the problem is with MacOS 10.15.2.


This problem started for me after updating MacOS to 10.15.2 and before updating XCode from 11.2.1 to 11.3.


While disabling the Thread Sanitizer did allow my simulator to run I have to question the usefullness of Thread Sanitizer if it cannot be used.

Resolved with Xcode 11.3.1

I am having the same problem here and the Thread Sanitizer was already turned off.
Did anybody get the problem solved so far?

Actually, I had the issue with 11.3.1 and Thread Sanitizer was already turned off.

In my case issue was I used to have different xCode versions in my Application folder like that



/Applications/xcode11.3.1/Xcode.app

/Applications/xcode11.3/Xcode.app

/Applications/xcode10.1/Xcode.app



and

/Applications/Xcode.app - was 11.2



It takes me 2 days to understand that build system looks on the /Applications/Xcode.app by default. So bringing 11.3.1 to the /Applications/Xcode.app finally resolve the problem.