Xcode 11.x, crash in MetadataCacheEntryBase::doInitialization()

I'm seeing a crash (specifically EXC_BAD_ACCESS trying to read from 0x00) in the following stack, but only when

  1. the tread sanitizer option is off

  2. testing that target in a scheme that has multple targets. When I use a scheme that has only that one target, the crash doesn't occur.

    #0 swift::MetadataCacheEntryBase<(anonymous namespace)::SingletonMetadataCacheEntry, int>::doInitialization(swift::ConcurrencyControl&, swift::MetadataCompletionQueueEntry*, swift::MetadataRequest) ()
    #1 swift_getSingletonMetadata ()
    #2 type metadata accessor for FileURL ()
    #3 type metadata accessor for (fileURL: FileURL, fetchResponse: FetchResponse) ()
    #4 type metadata accessor for Result<(fileURL: FileURL, fetchResponse: FetchResponse), ContentUpdateError> ()
    #5 type metadata completion function for FetchResultDecoder ()
    #6 swift::MetadataCacheEntryBase<(anonymous namespace)::SingletonMetadataCacheEntry, int>::doInitialization(swift::ConcurrencyControl&, swift::MetadataCompletionQueueEntry*, swift::MetadataRequest) ()
    #7 swift_getSingletonMetadata ()
    #8 type metadata accessor for FetchResultDecoder ()
    #9 type metadata completion function for FetchMyContentOperation ()
    #10 swift::MetadataCacheEntryBase<(anonymous namespace)::SingletonMetadataCacheEntry, int>::doInitialization(swift::ConcurrencyControl&, swift::MetadataCompletionQueueEntry*, swift::MetadataRequest) ()
    #11 swift_getSingletonMetadata ()
    #12 type metadata accessor for FetchMyContentOperation ()
    #13 ObjC metadata update function for FetchMyContentOperation ()
    #14 realizeClassMaybeSwiftMaybeRelock(objc_class*, mutex_tt&, bool) ()
    #15 realizeAllClasses() ()
    #16 objc_copyClassList ()
    #17 +[XCTestCase(RuntimeUtilities) _allSubclasses] ()
    #18 +[XCTestCase(RuntimeUtilities) allSubclasses] ()
    #19 +[XCTestSuite _suiteForBundleCache] ()
    #20 -[XCTestSuite _initWithTestConfiguration:] ()
    #21 +[XCTestSuite testSuiteForTestConfiguration:] ()
    #22 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke ()
    #23 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.100 ()
    #24 -[XCTestObservationCenter _observeTestExecutionForBlock:] ()
    #25 -[XCTTestRunSession runTestsAndReturnError:] ()
    #26 -[XCTestDriver runTestsAndReturnError:] ()
    #27 _XCTestMain ()
    #28 main ()
    #29 start ()

I suspect a compiler error because turning on thread sanitizer (enableASanStackUseAfterReturn = "YES") on "fixes" it.

Where do I go from here?

Terms of Service

Privacy Policy

Cookie Policy