Using thread/address sanitizers on M1

Anyone used these successfully lately on M1? (I used them a long time ago on x86 and thought I'd give it a spin, but not much success):

Thread Sanitizer gives:

hassila@max ~/D/G/swift-data-model (main)> swift test --sanitize thread
[1/1] Planning buildCompiling plugin Swift-DocC...
Compiling plugin Swift-DocC Preview...
Building for debugging...
Undefined symbols for architecture arm64:
  "___asan_alloca_poison", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashCompletionWords33_2E4AF468845F34F913738BAEDA3877C1LLSaySSGyF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV20customCompletionCallySSSayAA15ParsableCommand_pXpGF in CompletionsGenerator.swift.o
      ...
  "___asan_allocas_unpoison", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashCompletionWords33_2E4AF468845F34F913738BAEDA3877C1LLSaySSGyF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV20customCompletionCallySSSayAA15ParsableCommand_pXpGF in CompletionsGenerator.swift.o
      ...
  "___asan_handle_no_return", referenced from:
      _$s14ArgumentParser15CompletionShellV12autodetectedACSgyFZ in CompletionsGenerator.swift.o
      _$sSo4exitys5NeverOs5Int32VFTO in ParsableArguments.swift.o
      _$s14ArgumentParser37ParsableArgumentsUniqueNamesValidatorV8validateyAA0cdG5Error_pSgAA0cD0_pXpFZySDySSSiGz_AA0A3SetVtXEfU0_ in ParsableArgumentsValidation.swift.o
      _$s14ArgumentParser12ArrayWrapperV7getNextypSgyF in ArgumentDecoder.swift.o
      _$s14ArgumentParser0A10DefinitionV4HelpV7OptionsV10isOptional_WZ in ArgumentDefinition.swift.o
      _$s14ArgumentParser0A10DefinitionV4HelpV7OptionsV11isRepeating_WZ in ArgumentDefinition.swift.o
      _$s14ArgumentParser0A3SetV7counter3key4name4helpAcA8InputKeyV_AA17NameSpecificationVAA0A4HelpVSgtFZyAA0H6OriginV_AA0J0OSgAA12ParsedValuesVztKcfU_ in ArgumentSet.swift.o
      ...
  "___asan_init", referenced from:
      _asan.module_ctor in BashCompletionsGenerator.swift.o
      _asan.module_ctor in CompletionsGenerator.swift.o
      _asan.module_ctor in FishCompletionsGenerator.swift.o
      _asan.module_ctor in ZshCompletionsGenerator.swift.o
      _asan.module_ctor in Argument.swift.o
      _asan.module_ctor in ArgumentHelp.swift.o
      _asan.module_ctor in ArgumentVisibility.swift.o
      ...
  "___asan_memcpy", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashCompletionWords33_2E4AF468845F34F913738BAEDA3877C1LLSaySSGyF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionVSaySSGs5Error_pIggozo_AcDsAE_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionVSSSgs5Error_pIggozo_AcDsAE_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashValueCompletion33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser20CompletionsGeneratorV7command5shellAcA15ParsableCommand_pXp_AA15CompletionShellVSgtKcfC in CompletionsGenerator.swift.o
      ...
  "___asan_memset", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV24generateCompletionScriptySSAA15ParsableCommand_pXpFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU0_ in BashCompletionsGenerator.swift.o
      ...
  "___asan_option_detect_stack_use_after_return", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV24generateCompletionScriptySSAA15ParsableCommand_pXpFZ in BashCompletionsGenerator.swift.o
      _$ss27_finalizeUninitializedArrayySayxGABnlF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      ...
  "___asan_register_globals", referenced from:
      _asan.module_ctor in BashCompletionsGenerator.swift.o
      _asan.module_ctor in CompletionsGenerator.swift.o
      _asan.module_ctor in FishCompletionsGenerator.swift.o
      _asan.module_ctor in ZshCompletionsGenerator.swift.o
      _asan.module_ctor in Argument.swift.o
      _asan.module_ctor in ArgumentHelp.swift.o
      _asan.module_ctor in ArgumentVisibility.swift.o
      ...
  "___asan_register_image_globals", referenced from:
      _asan.module_ctor in InstrumentReferenceData.swift.o
      _asan.module_ctor in MarketData.swift.o
      _asan.module_ctor in PerformanceTesting.swift.o
      _asan.module_ctor in SharedDefinitions.swift.o
      _asan.module_ctor in Trading.swift.o
      _asan.module_ctor in InstrumentReferenceDataService.swift.o
      _asan.module_ctor in MarketDataService.swift.o
      ...
  "___asan_report_load1", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashCompletionWords33_2E4AF468845F34F913738BAEDA3877C1LLSaySSGyF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashValueCompletion33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser4NameOSSs5Error_pIggozo_ACSSsAD_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      ...
  "___asan_report_load2", referenced from:
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP6decode_6forKeys5Int16VAJm_0K0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP6decode_6forKeys6UInt16VAJm_0K0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys4Int8VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys5Int16VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys5UInt8VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys6UInt16VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser18SingleValueDecoderV0cD9ContainerVs0cd8DecodingF0AAsAFP6decodeys5Int16VAJmKFTW in ArgumentDecoder.swift.o
      ...
  "___asan_report_load4", referenced from:
      _$s14ArgumentParser0A0VA2A013ExpressibleByA0RzlE7initial4help10completionACyxGxSg_AA0A4HelpVSgAA14CompletionKindVSgtc33_D54D9D89B07C8521E9D501DA93CDFCE8LlfC in Argument.swift.o
      _$s14ArgumentParser0A0V7initial4help10completion9transformACyxGxSg_AA0A4HelpVSgAA14CompletionKindVSgxSSKctc33_D54D9D89B07C8521E9D501DA93CDFCE8LlfC in Argument.swift.o
      _$s14ArgumentParser0A0V7initial4help10completion9transformACyxGxSg_AA0A4HelpVSgAA14CompletionKindVSgxSSKctc33_D54D9D89B07C8521E9D501DA93CDFCE8LlfcAA0A3SetVAA8InputKeyVcfU_ in Argument.swift.o
      _$s14ArgumentParser8ExitCodeV7successACvgZ in Errors.swift.o
      _$s14ArgumentParser8ExitCodeV7failureACvgZ in Errors.swift.o
      _$s14ArgumentParser8ExitCodeV17validationFailureACvgZ in Errors.swift.o
      _$s14ArgumentParser8ExitCodeV9isSuccessSbvg in Errors.swift.o
      ...
  "___asan_report_load8", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV24generateCompletionScriptySSAA15ParsableCommand_pXpFZ in BashCompletionsGenerator.swift.o
      _$ss27_finalizeUninitializedArrayySayxGABnlF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser15ParsableCommand_pXmTSSs5Error_pIgyozo_AaB_pXmTSSsAC_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      ...
  "___asan_report_load_n", referenced from:
      _$s14ArgumentParser20AsyncParsableCommandPAAE4mainyyYaFZ in AsyncParsableCommand.swift.o
      _$s14ArgumentParser17AsyncMainProtocolPAAE4mainyyYaFZ in AsyncParsableCommand.swift.o
      _$s13SystemPackage14FileDescriptorV5_pipes6ResultOyAC7readEnd_AC05writeH0tAA5ErrnoVGyFZ in FileOperations.swift.o
  "___asan_report_store1", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashCompletionWords33_2E4AF468845F34F913738BAEDA3877C1LLSaySSGyFSSAA4NameOXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser20CompletionsGeneratorV7command5shellAcA15ParsableCommand_pXp_AA15CompletionShellVSgtKcfC in CompletionsGenerator.swift.o
      _$s14ArgumentParser20CompletionsGeneratorV7command9shellNameAcA15ParsableCommand_pXp_SSSgtKcfC in CompletionsGenerator.swift.o
      _$s14ArgumentParser24FishCompletionsGeneratorV08generateD012commandChain_SaySSGAF_SayAA15ParsableCommand_pXpGtFZ in FishCompletionsGenerator.swift.o
      _$s14ArgumentParser4NameO16asFishSuggestion33_7F6BFDB726626BD81CC9C9EF9AFF91B7LLSSvg in FishCompletionsGenerator.swift.o
      _$s14ArgumentParser4NameO15asFormattedFlag33_7F6BFDB726626BD81CC9C9EF9AFF91B7LLSSvg in FishCompletionsGenerator.swift.o
      ...
  "___asan_report_store2", referenced from:
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys4Int8VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys5Int16VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys5UInt8VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeys6UInt16VSgAJm_0M0QztKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser18SingleValueDecoderV16UnkeyedContainerVs0f8DecodingG0AAsAFP15decodeIfPresentys4Int8VSgAJmKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser18SingleValueDecoderV16UnkeyedContainerVs0f8DecodingG0AAsAFP15decodeIfPresentys5Int16VSgAJmKFTW in ArgumentDecoder.swift.o
      _$s14ArgumentParser18SingleValueDecoderV16UnkeyedContainerVs0f8DecodingG0AAsAFP15decodeIfPresentys5UInt8VSgAJmKFTW in ArgumentDecoder.swift.o
      ...
  "___asan_report_store4", referenced from:
      _$s14ArgumentParser8ExitCodeV8rawValues5Int32Vvs in Errors.swift.o
      _$s14ArgumentParser8ExitCodeVyACs5Int32VcfC in Errors.swift.o
      _$s14ArgumentParser8ExitCodeV8rawValueACs5Int32V_tcfC in Errors.swift.o
      _$s14ArgumentParser8ExitCodeV9isSuccessSbvg in Errors.swift.o
      _$s14ArgumentParser8ExitCodeVSYAASY8rawValuexSg03RawF0Qz_tcfCTW in Errors.swift.o
      _$s14ArgumentParser8ExitCodeVSYAASY8rawValue03RawF0QzvgTW in Errors.swift.o
      _$s14ArgumentParser24ParsedArgumentsContainerCyxGs013KeyedDecodingE8ProtocolAAsAEP15decodeIfPresent_6forKeySfSgSfm_0M0QztKFTW in ArgumentDecoder.swift.o
      ...
  "___asan_report_store8", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV24generateCompletionScriptySSAA15ParsableCommand_pXpFZ in BashCompletionsGenerator.swift.o
      _$ss27_finalizeUninitializedArrayySayxGABnlF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser15ParsableCommand_pXmTSSs5Error_pIgyozo_AaB_pXmTSSsAC_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      ...
  "___asan_report_store_n", referenced from:
      _$s14ArgumentParser17NameSpecificationV12shortAndLongACvgZ in NameSpecification.swift.o
      _$s14ArgumentParser11HelpCommandV4helpSbvpfP in HelpCommand.swift.o
      _$s14ArgumentParser20CommandConfigurationV16defaultHelpNames33_C29415A1A74CFB17C1B793C97A54C63ALLAA17NameSpecificationVvgZ in HelpGenerator.swift.o
      _$s22ArgumentParserToolInfo0aD2V0V04NamedE0V04KindE0O8rawValueAGSgSS_tcfC in ToolInfo.swift.o
      _$s22ArgumentParserToolInfo0aD2V0V04KindE0O8rawValueAESgSS_tcfC in ToolInfo.swift.o
      _$s19DataModelExecutable0aB10DefinitionV13_outputFormat33_CD696E9508F406EBBBCD83A8F323FDEFLL14ArgumentParser6OptionVySSSgGvpfi in DataModelDefinition.swift.o
      _$s19DataModelExecutable0aB10DefinitionV16_destinationPath33_CD696E9508F406EBBBCD83A8F323FDEFLL14ArgumentParser6OptionVySSSgGvpfi in DataModelDefinition.swift.o
      ...
  "___asan_set_shadow_f5", referenced from:
      _$s14ArgumentParser0A10DefinitionVSaySSGs5Error_pIggozo_AcDsAE_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionVSSSgs5Error_pIggozo_AcDsAE_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV22generateOptionHandlers33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19bashValueCompletion33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser15CompletionShellV12autodetectedACSgyFZ in CompletionsGenerator.swift.o
      _$s14ArgumentParser20CompletionsGeneratorV7command5shellAcA15ParsableCommand_pXp_AA15CompletionShellVSgtKcfC in CompletionsGenerator.swift.o
      _$s14ArgumentParser20CompletionsGeneratorV24generateCompletionScriptSSyF in CompletionsGenerator.swift.o
      ...
  "___asan_shadow_memory_dynamic_address", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV24generateCompletionScriptySSAA15ParsableCommand_pXpFZ in BashCompletionsGenerator.swift.o
      _$ss27_finalizeUninitializedArrayySayxGABnlF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser15ParsableCommand_pXmTSSs5Error_pIgyozo_AaB_pXmTSSsAC_pIegnrzo_TR in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      ...
  "___asan_stack_free_5", referenced from:
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24FishCompletionsGeneratorV08generateD012commandChain_SaySSGAF_SayAA15ParsableCommand_pXpGtFZ in FishCompletionsGenerator.swift.o
      _$s14ArgumentParser23ZshCompletionsGeneratorV26generateCompletionFunctionySSSayAA15ParsableCommand_pXpGFZ in ZshCompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV19zshCompletionStringySSSgSayAA15ParsableCommand_pXpGF in ZshCompletionsGenerator.swift.o
      _$s14ArgumentParser0A0V4help10completionACyqd__SgGAA0A4HelpVSg_AA14CompletionKindVSgtcAFRszAA013ExpressibleByA0Rd__lufcAA0A3SetVAA8InputKeyVcfU_ in Argument.swift.o
      _$s14ArgumentParser4FlagVA2A010EnumerableC0RzlE7initial11exclusivity4helpACyxGxSg_AA0C11ExclusivityVAA0A4HelpVSgtc33_4A276EFEBCBB2C9B65ADA202F321CCEALlfcAA0A3SetVAA8InputKeyVcfU_AA0A10DefinitionVSi_xtXEfU1_ in Flag.swift.o
      ...
  "___asan_stack_free_6", referenced from:
      _$s14ArgumentParser0A10DefinitionV16argumentSegments33_7F6BFDB726626BD81CC9C9EF9AFF91B7LLySaySaySSG_SStGAFF in FishCompletionsGenerator.swift.o
      _$s14ArgumentParser0A0V7initial15parsingStrategy4help10completionACySayqd__GGAHSg_AA0a12ArrayParsingE0VAA0A4HelpVSgAA14CompletionKindVSgtcAHRszAA013ExpressibleByA0Rd__lu33_D54D9D89B07C8521E9D501DA93CDFCE8LlfcAA0A3SetVAA8InputKeyVcfU_ in Argument.swift.o
      _$s14ArgumentParser28PositionalArgumentsValidatorV8validateyAA08ParsabledE5Error_pSgAA0gD0_pXpFZ in ParsableArgumentsValidation.swift.o
      _$s14ArgumentParser0A3SetV12lenientParse_11subcommands18defaultCapturesAllAA12ParsedValuesVAA14SplitArgumentsV_SayAA15ParsableCommand_pXpGSbtKF in ArgumentSet.swift.o
      _$s14ArgumentParser07CommandB0V5parse9argumentss6ResultOyAA08ParsableC0_pAA0C5ErrorVGSaySSG_tF in CommandParser.swift.o
      _$s14ArgumentParser07CommandB0V22handleCustomCompletionyySaySSGKF in CommandParser.swift.o
      _$s14ArgumentParser18parseIndividualArg_2atSayAA14SplitArgumentsV7ElementVGSS_SitKF in SplitArguments.swift.o
      ...
  "___asan_stack_free_7", referenced from:
      _$s14ArgumentParser0A0V7initial15parsingStrategy4help10completion9transformACySayqd__GGAISg_AA0a12ArrayParsingE0VAA0A4HelpVSgAA14CompletionKindVSgqd__SSKctcAIRszlu33_D54D9D89B07C8521E9D501DA93CDFCE8LlfcAA0A3SetVAA8InputKeyVcfU_ in Argument.swift.o
      _$s14ArgumentParser6OptionV7initial4name15parsingStrategy4help10completionACySayqd__GGAISg_AA17NameSpecificationVAA012ArrayParsingG0VAA0A4HelpVSgAA14CompletionKindVSgtcAIRszAA013ExpressibleByA0Rd__lu33_3FAB84E8577F3610E5081083FAE17795LlfcAA0A3SetVAA8InputKeyVcfU_ in Option.swift.o
      _$s14ArgumentParser6OptionV7initial4name15parsingStrategy4help10completion9transformACySayqd__GGAJSg_AA17NameSpecificationVAA012ArrayParsingG0VAA0A4HelpVSgAA14CompletionKindVSgqd__SSKctcAJRszlu33_3FAB84E8577F3610E5081083FAE17795LlfcAA0A3SetVAA8InputKeyVcfU_ in Option.swift.o
      _$s14ArgumentParser0A3SetV12lenientParse_11subcommands18defaultCapturesAllAA12ParsedValuesVAA14SplitArgumentsV_SayAA15ParsableCommand_pXpGSbtKF10parseValueL_yyAA0A10DefinitionV_AA0jA0OAA11InputOriginV7ElementOyAS_AA4NameOSgSSAHztKXEAHzASztKF in ArgumentSet.swift.o
      _$s14ArgumentParser13HelpGeneratorV16generateSections33_C29415A1A74CFB17C1B793C97A54C63ALL12commandStack10visibilitySayAC7SectionVGSayAA15ParsableCommand_pXpG_AA0A10VisibilityVtFZ in HelpGenerator.swift.o
  "___asan_stack_malloc_0", referenced from:
      _$ss27_finalizeUninitializedArrayySayxGABnlF in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV26generateCompletionFunction33_2E4AF468845F34F913738BAEDA3877C1LLySSSayAA15ParsableCommand_pXpGFZSSAaF_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateA5Words33_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZAfA0A10DefinitionVXEfU_ in BashCompletionsGenerator.swift.o
      _$s14ArgumentParser24BashCompletionsGeneratorV08generateaD033_2E4AF468845F34F913738BAEDA3877C1LLySaySSGSayAA15ParsableCommand_pXpGFZSSSgAA0A10DefinitionVXEfU_SSAaG_pXpXEfU_ in BashCompletionsGenerator.swift.o
      _$ss27_finalizeUninitializedArrayySayxGABnlF in CompletionsGenerator.swift.o
      _$s14ArgumentParser0A10DefinitionV20customCompletionCallySSSayAA15ParsableCommand_pXpGFSSAaE_pXpXEfU_ in CompletionsGenerator.swift.o
      _$sST14ArgumentParserAA15ParsableCommand_pXp7ElementRtzrlE22completionFunctionNameSSyFSaySSGAaB_pXpXEfU_ in CompletionsGenerator.swift.o
      ...
  "___asan_stack_malloc_1", referenced from:
      ...
_$s14ArgumentParser07CommandB0V5parse9argumentss6ResultOyAA08ParsableC0_pAA0C5ErrorVGSaySSG_tF in CommandParser.swift.o
      _$s14ArgumentParser07CommandB0V22handleCustomCompletionyySaySSGKF in CommandParser.swift.o
      _$s14ArgumentParser18parseIndividualArg_2atSayAA14SplitArgumentsV7ElementVGSS_SitKF in SplitArguments.swift.o
      ...
  "___asan_stack_malloc_7", referenced from:
      _$s14ArgumentParser0A0V7initial15parsingStrategy4help10completion9transformACySayqd__GGAISg_AA0a12ArrayParsingE0VAA0A4HelpVSgAA14CompletionKindVSgqd__SSKctcAIRszlu33_D54D9D89B07C8521E9D501DA93CDFCE8LlfcAA0A3SetVAA8InputKeyVcfU_ in Argument.swift.o
      _$s14ArgumentParser6OptionV7initial4name15parsingStrategy4help10completionACySayqd__GGAISg_AA17NameSpecificationVAA012ArrayParsingG0VAA0A4HelpVSgAA14CompletionKindVSgtcAIRszAA013ExpressibleByA0Rd__lu33_3FAB84E8577F3610E5081083FAE17795LlfcAA0A3SetVAA8InputKeyVcfU_ in Option.swift.o
      _$s14ArgumentParser6OptionV7initial4name15parsingStrategy4help10completion9transformACySayqd__GGAJSg_AA17NameSpecificationVAA012ArrayParsingG0VAA0A4HelpVSgAA14CompletionKindVSgqd__SSKctcAJRszlu33_3FAB84E8577F3610E5081083FAE17795LlfcAA0A3SetVAA8InputKeyVcfU_ in Option.swift.o
      _$s14ArgumentParser0A3SetV12lenientParse_11subcommands18defaultCapturesAllAA12ParsedValuesVAA14SplitArgumentsV_SayAA15ParsableCommand_pXpGSbtKF10parseValueL_yyAA0A10DefinitionV_AA0jA0OAA11InputOriginV7ElementOyAS_AA4NameOSgSSAHztKXEAHzASztKF in ArgumentSet.swift.o
      _$s14ArgumentParser13HelpGeneratorV16generateSections33_C29415A1A74CFB17C1B793C97A54C63ALL12commandStack10visibilitySayAC7SectionVGSayAA15ParsableCommand_pXpG_AA0A10VisibilityVtFZ in HelpGenerator.swift.o
  "___asan_unregister_globals", referenced from:
      _asan.module_dtor in BashCompletionsGenerator.swift.o
      _asan.module_dtor in CompletionsGenerator.swift.o
      _asan.module_dtor in FishCompletionsGenerator.swift.o
      _asan.module_dtor in ZshCompletionsGenerator.swift.o
      _asan.module_dtor in Argument.swift.o
      _asan.module_dtor in ArgumentHelp.swift.o
      _asan.module_dtor in ArgumentVisibility.swift.o
      ...
  "___asan_unregister_image_globals", referenced from:
      _asan.module_dtor in InstrumentReferenceData.swift.o
      _asan.module_dtor in MarketData.swift.o
      _asan.module_dtor in PerformanceTesting.swift.o
      _asan.module_dtor in SharedDefinitions.swift.o
      _asan.module_dtor in Trading.swift.o
      _asan.module_dtor in InstrumentReferenceDataService.swift.o
      _asan.module_dtor in MarketDataService.swift.o
      ...
  "___asan_version_mismatch_check_apple_clang_1316", referenced from:
      _asan.module_ctor in BashCompletionsGenerator.swift.o
      _asan.module_ctor in CompletionsGenerator.swift.o
      _asan.module_ctor in FishCompletionsGenerator.swift.o
      _asan.module_ctor in ZshCompletionsGenerator.swift.o
      _asan.module_ctor in Argument.swift.o
      _asan.module_ctor in ArgumentHelp.swift.o
      _asan.module_ctor in ArgumentVisibility.swift.o
      ...
ld: symbol(s) not found for architecture arm64
[1/3] Linking DataModelExecutable
error: fatalError

address sanitiser gives no output on M1, but gives this output on x86 running on a GitHub runner on ubuntu:

==3760==ERROR: LeakSanitizer: detected memory leaks
197

198
Direct leak of 32 byte(s) in 1 object(s) allocated from:
199
    #0 0x55db546b3a5d  (/home/runner/work/swift-data-model/swift-data-model/.build/x86_64-unknown-linux-gnu/debug/swift-data-modelPackageTests.xctest+0x105a5d)
200
    #1 0x7f34ffa90b38  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xaab38)
201
    #2 0x7f34ffe27598  (/usr/share/swift/usr/lib/swift/linux/libXCTest.so+0x48598)
202

203
SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).

Running the same tests on M1 gives no output but doesn't fail at least - any hints on symbolication for that on linux would be much appreciated though.

Got the symbolication half-working and it seems to be a bug in xctest on linux, even when running just an empty test with no user code I will get this:

=================================================================
==6874==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0xaaaad334683c in malloc /home/build-user/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:129:3
    #1 0xffff9861db58 in operator new(unsigned long) (/lib/aarch64-linux-gnu/libstdc++.so.6+0x9fb58)
    #2 0xffff997ce258 in swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::formWeakReference() (/usr/lib/swift/linux/libswiftCore.so+0x3ea258)
    #3 0xffff9979e938 in swift_weakAssign (/usr/lib/swift/linux/libswiftCore.so+0x3ba938)
    #4 0xffff98951168 in $s6XCTest9XCTWaiterC4wait3for7timeout12enforceOrder4file4lineAC6ResultOSayAA0A11ExpectationCG_SdSbs12StaticStringVSitF (/usr/lib/swift/linux/libXCTest.so+0x3f168)
    #5 0xffff989514a8 in $s6XCTest9XCTWaiterC4wait3for7timeout12enforceOrder4file4lineAC6ResultOSayAA0A11ExpectationCG_SdSbs12StaticStringVSitFZ (/usr/lib/swift/linux/libXCTest.so+0x3f4a8)
    #6 0xffff9893fda8 in $s6XCTest21awaitUsingExpectationyyyyYaKcKF (/usr/lib/swift/linux/libXCTest.so+0x2dda8)
    #7 0xffff9893f37c in $s6XCTest0A4CaseC10invokeTestyyF (/usr/lib/swift/linux/libXCTest.so+0x2d37c)
    #8 0xffff9893f1b0 in $s6XCTest0A4CaseC7performyyAA0A3RunCF (/usr/lib/swift/linux/libXCTest.so+0x2d1b0)
    #9 0xffff989436d4 in $s6XCTestAAC3runyyF (/usr/lib/swift/linux/libXCTest.so+0x316d4)
    #10 0xffff9894194c in $s6XCTest0A5SuiteC7performyyAA0A3RunCF (/usr/lib/swift/linux/libXCTest.so+0x2f94c)
    #11 0xffff989436d4 in $s6XCTestAAC3runyyF (/usr/lib/swift/linux/libXCTest.so+0x316d4)
    #12 0xffff9894194c in $s6XCTest0A5SuiteC7performyyAA0A3RunCF (/usr/lib/swift/linux/libXCTest.so+0x2f94c)
    #13 0xffff989436d4 in $s6XCTestAAC3runyyF (/usr/lib/swift/linux/libXCTest.so+0x316d4)
    #14 0xffff9894194c in $s6XCTest0A5SuiteC7performyyAA0A3RunCF (/usr/lib/swift/linux/libXCTest.so+0x2f94c)
    #15 0xffff989436d4 in $s6XCTestAAC3runyyF (/usr/lib/swift/linux/libXCTest.so+0x316d4)
    #16 0xffff9893dee0 in $s6XCTest7XCTMain_9arguments9observerss5NeverOSayAA0A4CaseCm04testF5Class_SaySS_yAHKctG8allTeststG_SaySSGSayAA0A11Observation_pGtF (/usr/lib/swift/linux/libXCTest.so+0x2bee0)
    #17 0xffff9893da58 in $s6XCTest7XCTMainys5NeverOSayAA0A4CaseCm04testD5Class_SaySS_yAFKctG8allTeststGF (/usr/lib/swift/linux/libXCTest.so+0x2ba58)
    #18 0xaaaad36ef024 in $s28swift_data_modelPackageTests6RunnerV4mainyyFZ /home/ordo/swift-data-model/.build/aarch64-unknown-linux-gnu/debug/swift-data-modelPackageTests.derived/runner.swift:10:9
    #19 0xaaaad36ef098 in $s28swift_data_modelPackageTests6RunnerV5$mainyyFZ /home/ordo/swift-data-model/.build/aarch64-unknown-linux-gnu/debug/swift-data-modelPackageTests.derived/runner.swift:3:1
    #20 0xaaaad36ef0b0 in main /home/ordo/swift-data-model/.build/aarch64-unknown-linux-gnu/debug/swift-data-modelPackageTests.derived/runner.swift
    #21 0xffff98783d4c in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x20d4c)
    #22 0xaaaad32d3670 in _start (/home/ordo/swift-data-model/.build/aarch64-unknown-linux-gnu/debug/swift-data-modelPackageTests.xctest+0x91670)

SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).

Will file an issue for it.

Running test suites under linux with asan shows a memory leak in xctest · Issue #342 · apple/swift-corelibs-xctest · GitHub if anyone wants to follow up.

Also another issue here:

https://github.com/apple/swift/issues/58482

Is this through Linux on the M1? How are you running that?

It was both with macOS and Linux on the m1.

I’m running Ubuntu on it in a VM using multipass which is very nifty actually.

I'm not surprised it doesn't work on Linux, as Swift on ARM Linux is only recently supported. On macOS, the sanitizers work through Xcode, but only if you aren't using Swift concurrency. As of Swift 5.6, the thread sanitizer still returns various false positives if you use the concurrency feature.

It also fails on Linux x86 on a GitHub runner…

If you look at the reproducer I created it’s a basically template project created by SPM - tsan seems to miss linking appropriate libs on all platforms (I don’t have access to macOS x86 but can try it on a GitHub runner tomorrow)

(Endgame is that I want tsan/asan running as part of CI pipeline for all platforms)

When run from the command line it fails on macOS too with swift 5.6 without concurrency feature due to the same problem (Xcode 13.x toolchain, all out of the box) - so hopefully whatever is needed to fix that on macOS will help addressing it on Linux too - I want both to work :slight_smile:

Both work fine for me using Xcode 13.3.1 on my M1 Max. I did notice that if you run the sanitizers back to back that you get errors similar to what you're seeing, presumably because it's still using products built for the other sanitizer. Blowing away my .build directory fixed the issue.

1 Like

Ouch. Thanks Jon, it seems you nailed it - I happened to try them one-by-one in a systematic fashion. Will update bug report to reflect that it probably should invalidate build cache when running with sanitizer with a different setting if possible.

Part of that sounds similar to [SR-7787] SwiftPM build TSan build in release mode after ASan build gives linker errors · Issue #4814 · apple/swift-package-manager · GitHub

1 Like