Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: swift-5.8 #320900

Closed
huwaireb opened this issue Jun 18, 2024 · 21 comments
Closed

Build failure: swift-5.8 #320900

huwaireb opened this issue Jun 18, 2024 · 21 comments
Labels
0.kind: build failure 6.topic: darwin Running or building packages on Darwin

Comments

@huwaireb
Copy link

huwaireb commented Jun 18, 2024

Note

The issue's fix has been identified and will be solved soon see #320900 (comment)

Steps To Reproduce

nix build github:nixos/nixpkgs/nixpkgs-unstable#swift

Build log

https://hydra.nixos.org/build/262150427/nixlog/3

References: #316075 (comment)
Related: #319270 nix-community/home-manager#5550

@dtzWill @trepetti @dduan @Trundle @stephank

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.5.0, macOS 14.5`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.23.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a 👍 reaction to issues you find important.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/having-issues-with-swift-5-8-build/46871/2

ELD added a commit to ELD/nix-system that referenced this issue Jun 25, 2024
@GaetanLepage
Copy link
Contributor

Could it be marked as broken in the meantime to avoid useless work for the builders from attempting at building it ?

@huwaireb
Copy link
Author

huwaireb commented Jul 1, 2024

Turns out the problem was with clang, using the locally built clang instead of nixpkgs's works for Darwin at least. However, this isn't ideal as it was building just fine before a certain change, i can't pinpoint. I suspect it was merged in #316075

You can test it out by simply exporting the CC and CXX, prior to building Swift to target the locally built clang.

I can't dedicate enough time to this, if each time I try to test a change I have to build llvm which takes 15-25 minutes on my machine.

cc @stephank

@YorikSar
Copy link
Contributor

YorikSar commented Jul 7, 2024

On my machine swiftc itself has built successfully, but whenever I try to use it, I get following on the Console:

<many sandbox violations skipped>
0	error	22:21:30.398565+0200	kernel	Sandbox: .swift-frontend-wrapped(15482) deny(1) file-read-metadata /usr/libexec/swift
0	error	22:21:30.398576+0200	kernel	Sandbox: .swift-frontend-wrapped(15482) deny(1) file-read-metadata /usr/bin
0	default	22:21:30.411803+0200	kernel	CODE SIGNING: cs_invalid_page(0x108934000): p=15482[.swift-frontend-] final status 0x23000200, denying page sending SIGKILL
0	default	22:21:30.411813+0200	kernel	CODE SIGNING: process 15482[.swift-frontend-]: rejecting invalid page at address 0x108934000 from offset 0x4748000 in file "/nix/store/740l3753ba41sn99gr2npdjmbqylbikm-swift-5.8/bin/.swift-frontend-wrapped" (cs_mtime:1.0 == mtime:1.0) (signed:1 validated:1 tainted:1 nx:0 wpmapped:0 dirty:0 depth:0)

and then the following crash report is generated:

Report
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               .swift-frontend-wrapped [15482]
Path:                  /Volumes/VOLUME/*/.swift-frontend-wrapped
Identifier:            .swift-frontend-wrapped
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        cmake [15390]
Responsible:           nix [615]
User ID:               301

Date/Time:             2024-07-07 22:21:30.4127 +0200
OS Version:            macOS 14.5 (23F79)
Report Version:        12
Anonymous UUID:        D32A71CD-4437-A955-8CA8-77660F649846

Sleep/Wake UUID:       9EF6D2B1-9EF3-4D26-978C-F3E03EE953C5

Time Awake Since Boot: 440000 seconds
Time Since Wake:       1232 seconds

System Integrity Protection: enabled

Notes:
dyld_process_snapshot_get_shared_cache failed

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x00000001089355ac
Exception Codes:       0x0000000000000032, 0x00000001089355ac

Termination Reason:    Namespace CODESIGNING, Code 2 Invalid Page

VM Region Info: 0x1089355ac is in 0x1041ec000-0x108c78000;  bytes after start: 74749356  bytes before end: 3418707
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  __TEXT                      1041ec000-108c78000    [ 74.5M] r-x/r-x SM=COW  /Volumes/VOLUME/*/.swift-frontend-wrapped
      __DATA_CONST                108c78000-10905c000    [ 3984K] r--/rw- SM=COW  /Volumes/VOLUME/*/.swift-frontend-wrapped

Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   .swift-frontend-wrapped       	       0x10837df6c llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) + 96
1   .swift-frontend-wrapped       	       0x10831f788 std::__1::pair<llvm::StringMapIterator<llvm::cl::Option*>, bool> llvm::StringMap<llvm::cl::Option*, llvm::MallocAllocator>::try_emplace<llvm::cl::Option*>(llvm::StringRef, llvm::cl::Option*&&) + 44
2   .swift-frontend-wrapped       	       0x10831fa1c (anonymous namespace)::CommandLineParser::addOption(llvm::cl::Option*, llvm::cl::SubCommand*) + 140
3   .swift-frontend-wrapped       	       0x108314268 llvm::cl::Option::addArgument() + 80
4   .swift-frontend-wrapped       	       0x104befb10 _GLOBAL__sub_I_LSLocationPrinter.cpp + 996
5   dyld                          	       0x18560905c invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const + 168
6   dyld                          	       0x1856470d4 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 172
7   dyld                          	       0x18563a99c invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 496
8   dyld                          	       0x1855ea2fc dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 300
9   dyld                          	       0x185639930 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
10  dyld                          	       0x18563c208 dyld3::MachOFile::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, bool&) block_pointer) const + 160
11  dyld                          	       0x185646dc8 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 432
12  dyld                          	       0x185605070 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 524
13  dyld                          	       0x18560b614 dyld4::JustInTimeLoader::runInitializers(dyld4::RuntimeState&) const + 36
14  dyld                          	       0x18560545c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 220
15  dyld                          	       0x1856090ec dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_1::operator()() const + 116
16  dyld                          	       0x185605628 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 380
17  dyld                          	       0x1856284d8 dyld4::APIs::runAllInitializersForMain() + 464
18  dyld                          	       0x1855eef7c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3156
19  dyld                          	       0x1855ededc start + 1844


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000600003248340   x1: 0x00000001089355ac   x2: 0x0000000000000002   x3: 0x000000016bc08d70
    x4: 0x0000000000000003   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000000000100   x9: 0x0000000000000000  x10: 0x0000000000000002  x11: 0x00000001089355ac
   x12: 0x0000000000000000  x13: 0x0000000000000000  x14: 0x00000000000007fb  x15: 0x000000008c07b7fb
   x16: 0x0000000000000000  x17: 0x0000000104bef72c  x18: 0x0000000000000000  x19: 0x0000000000000002
   x20: 0x00000001089355ac  x21: 0x0000600003248340  x22: 0x0000000000000002  x23: 0x0000000000000030
   x24: 0x00000001089355ac  x25: 0x000000016bc08f10  x26: 0x000000016bc08f10  x27: 0x00000001090962d0
   x28: 0x00000001090962b8   fp: 0x000000016bc08d00   lr: 0x000000010831f788
    sp: 0x000000016bc08cb0   pc: 0x000000010837df6c cpsr: 0x60001000
   far: 0x00000001089355ac  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x1855e8000 -        0x185670a17 dyld (*) <37bbc384-0755-31c7-a808-0ed49e44dd8e> /usr/lib/dyld
       0x10ae2c000 -        0x10ae3ffff libz.dylib (*) <d9cb9126-6868-34fe-8286-c17a04f80926> /Volumes/VOLUME/*/libz.dylib
       0x10ae4c000 -        0x10ae57fff libiconv.2.dylib (*) <dee05f5c-2e92-3ac6-8978-0f88992d1988> /Volumes/VOLUME/*/libiconv.2.dylib
       0x10af68000 -        0x10b00bfff libc++.1.0.dylib (*) <c122fe1f-719d-3bfc-8287-fb089f288fde> /Volumes/VOLUME/*/libc++.1.0.dylib
       0x185598000 -        0x1855e7d83 libobjc.A.dylib (*) <b326b2c3-1069-3d17-b49d-9dcb24efec6f> /usr/lib/libobjc.A.dylib
       0x185919000 -        0x185934ffb libc++abi.dylib (*) <4ac7c5cd-3746-3a53-aad6-c231e183b705> /usr/lib/libc++abi.dylib
       0x1925c2000 -        0x1925c9fff liboah.dylib (*) <7c0b820a-d15e-3376-98b2-2e58d3c5461e> /usr/lib/liboah.dylib
       0x18588c000 -        0x185918ff7 libc++.1.dylib (*) <ec33cd83-7098-3ad6-82c8-bc03ac81e87b> /usr/lib/libc++.1.dylib
       0x1925f4000 -        0x1925f5fff libSystem.B.dylib (*) <b5e49904-efc0-3bb7-9156-0c6811b8c533> /usr/lib/libSystem.B.dylib
       0x1925ee000 -        0x1925f3fff libcache.dylib (*) <bb710df3-6ce9-38be-912e-bc1d3b0a04f4> /usr/lib/system/libcache.dylib
       0x1925a8000 -        0x1925b5ff7 libcommonCrypto.dylib (*) <1e6f0a0b-a0b1-36c4-ba13-1fdb2e9e41ad> /usr/lib/system/libcommonCrypto.dylib
       0x1925d4000 -        0x1925d7fff libcompiler_rt.dylib (*) <86a432ca-bdd0-3055-87ef-b8797d6e2bc2> /usr/lib/system/libcompiler_rt.dylib
       0x1925ca000 -        0x1925d3fff libcopyfile.dylib (*) <173d29d4-80f5-39c6-9515-b86c298c5f18> /usr/lib/system/libcopyfile.dylib
       0x1856dc000 -        0x185784ff7 libcorecrypto.dylib (*) <4846087b-3a35-3bec-91cd-73fc35c16941> /usr/lib/system/libcorecrypto.dylib
       0x1857c2000 -        0x185809fff libdispatch.dylib (*) <502762ee-7aa7-306c-9dbd-88981a86bb78> /usr/lib/system/libdispatch.dylib
       0x18597d000 -        0x1859a2ff7 libdyld.dylib (*) <e49303e9-66a8-39d6-a917-e9ea8c42c63f> /usr/lib/system/libdyld.dylib
       0x1925e4000 -        0x1925e4ffb libkeymgr.dylib (*) <f1f36cc7-85d3-3580-a204-129c10bd1191> /usr/lib/system/libkeymgr.dylib
       0x192580000 -        0x192587ffb libmacho.dylib (*) <74a3752d-71dd-3d13-920f-6fbae85c4e30> /usr/lib/system/libmacho.dylib
       0x191a60000 -        0x191a62fff libquarantine.dylib (*) <874110ab-0828-3ee2-819f-92bb8586fcf2> /usr/lib/system/libquarantine.dylib
       0x1925e1000 -        0x1925e3ffb libremovefile.dylib (*) <a66b11d1-ebc0-36a0-98b1-27f13ce7f240> /usr/lib/system/libremovefile.dylib
       0x18b0f8000 -        0x18b10fff7 libsystem_asl.dylib (*) <9da6175c-e8c5-38b7-868c-d00212b9504d> /usr/lib/system/libsystem_asl.dylib
       0x185671000 -        0x185675ff8 libsystem_blocks.dylib (*) <30b81352-889c-3235-b936-5c61d478ec27> /usr/lib/system/libsystem_blocks.dylib
       0x18580d000 -        0x18588bff7 libsystem_c.dylib (*) <05b44e93-dffc-3bd8-90ab-fd97cb73f171> /usr/lib/system/libsystem_c.dylib
       0x1925d8000 -        0x1925dcffb libsystem_collections.dylib (*) <420f8a42-e02f-3d87-a284-f1b6c1ecf6a6> /usr/lib/system/libsystem_collections.dylib
       0x190c38000 -        0x190c3cfff libsystem_configuration.dylib (*) <ae144804-727a-33cd-812b-1e75455f15c0> /usr/lib/system/libsystem_configuration.dylib
       0x18fc74000 -        0x18fc9effb libsystem_containermanager.dylib (*) <89719da0-8df3-3681-ae71-d7d8253e69f1> /usr/lib/system/libsystem_containermanager.dylib
       0x192217000 -        0x19221cfff libsystem_coreservices.dylib (*) <7a8f0eeb-c843-362b-8749-254dccdb9c6e> /usr/lib/system/libsystem_coreservices.dylib
       0x188d9b000 -        0x188da5ff3 libsystem_darwin.dylib (*) <8caeb973-f243-392f-86ad-4ceeb1868465> /usr/lib/system/libsystem_darwin.dylib
       0x24dde2000 -        0x24dde5fff libsystem_darwindirectory.dylib (*) <f3e20d94-eb08-364f-ad4d-130b43b4a2b1> /usr/lib/system/libsystem_darwindirectory.dylib
       0x1925e5000 -        0x1925edfff libsystem_dnssd.dylib (*) <5b174353-095d-346a-9f28-14a42de6b305> /usr/lib/system/libsystem_dnssd.dylib
       0x24dde6000 -        0x24dde9ffb libsystem_eligibility.dylib (*) <bdd6664d-846f-3822-af3c-ba7f2f1fc63e> /usr/lib/system/libsystem_eligibility.dylib
       0x18580a000 -        0x18580cfff libsystem_featureflags.dylib (*) <c6b3356e-be61-3000-a726-d9aa0268106f> /usr/lib/system/libsystem_featureflags.dylib
       0x1859ab000 -        0x1859d7ffb libsystem_info.dylib (*) <927ab7d1-ea20-36ce-a394-e86f5af9375b> /usr/lib/system/libsystem_info.dylib
       0x192545000 -        0x19257bff3 libsystem_m.dylib (*) <5c9fa671-307c-3034-95fc-95cf416b5aba> /usr/lib/system/libsystem_m.dylib
       0x185785000 -        0x1857c1ff7 libsystem_malloc.dylib (*) <c6337a38-2b5c-3805-95e8-cf1786e2f4e7> /usr/lib/system/libsystem_malloc.dylib
       0x18b065000 -        0x18b07fffb libsystem_networkextension.dylib (*) <b3d16049-09c6-3342-9bbf-87ebe245f5df> /usr/lib/system/libsystem_networkextension.dylib
       0x189211000 -        0x189221fff libsystem_notify.dylib (*) <368949bf-0bc2-3bff-9251-eb3727e28dbe> /usr/lib/system/libsystem_notify.dylib
       0x190c3d000 -        0x190c42fff libsystem_sandbox.dylib (*) <ad95432d-9618-3476-bf3e-7982acb8e465> /usr/lib/system/libsystem_sandbox.dylib
       0x24ddea000 -        0x24ddedffb libsystem_sanitizers.dylib (*) <b1014621-dab5-340a-8bd2-d612080f1bf6> /usr/lib/system/libsystem_sanitizers.dylib
       0x1925dd000 -        0x1925e0ffb libsystem_secinit.dylib (*) <d7285456-42b8-36b2-84bb-a3b4a385c701> /usr/lib/system/libsystem_secinit.dylib
       0x185935000 -        0x18596fffb libsystem_kernel.dylib (*) <9b8b53f9-e2b6-36df-98e9-28d8fca732f2> /usr/lib/system/libsystem_kernel.dylib
       0x1859a3000 -        0x1859aafe7 libsystem_platform.dylib (*) <d5bbfc31-d52a-37d6-a41b-48638113ad4c> /usr/lib/system/libsystem_platform.dylib
       0x185970000 -        0x18597cfff libsystem_pthread.dylib (*) <386b0fc1-7873-3328-8e71-43269fd1b2c7> /usr/lib/system/libsystem_pthread.dylib
       0x18cae8000 -        0x18caf0ff3 libsystem_symptoms.dylib (*) <1612db0c-9601-3b59-8f43-df6feeb3e30c> /usr/lib/system/libsystem_symptoms.dylib
       0x1856c1000 -        0x1856dbfff libsystem_trace.dylib (*) <fec4ece0-45b9-3e80-94b1-b733f332e676> /usr/lib/system/libsystem_trace.dylib
       0x1925b6000 -        0x1925c1fff libunwind.dylib (*) <7e5fc595-8860-353c-b913-e919b6799c5b> /usr/lib/system/libunwind.dylib
       0x185676000 -        0x1856c0fff libxpc.dylib (*) <c2792dd4-e847-3309-b5b5-3c44551ca778> /usr/lib/system/libxpc.dylib
       0x10ae1c000 -        0x10ae1ffff libcharset.1.dylib (*) <61367104-e368-3936-a122-b6c1f9faa016> /Volumes/VOLUME/*/libcharset.1.dylib
       0x1859d8000 -        0x185eb0fff com.apple.CoreFoundation (6.9) <84b539d5-22c9-3f8c-84c8-903e9c7b8d29> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1890ac000 -        0x1890ecff7 com.apple.CoreServicesInternal (505) <33ffa204-8330-300f-a925-ca92d431dc21> /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal
       0x186b2d000 -        0x18778afff com.apple.Foundation (6.9) <99e0292d-7873-3968-9c9c-5955638689a5> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
       0x1925f6000 -        0x1925f9fff libfakelink.dylib (*) <fad80869-def7-35cf-b2bd-9dd1f7509cde> /usr/lib/libfakelink.dylib
       0x188ad4000 -        0x188d9afff libicucore.A.dylib (*) <14e673ca-1dc8-3d05-9eca-21524d723fde> /usr/lib/libicucore.A.dylib
       0x1925fa000 -        0x1925faffb com.apple.SoftLinking (1.0) <bfb92125-9e7c-324a-ac5a-45c732e73762> /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking
       0x18912e000 -        0x189210fff com.apple.framework.IOKit (2.0.2) <7de54f4f-8ed9-359f-8c86-2798b6574743> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
       0x199c82000 -        0x199c82fff com.apple.CoreServices (1226) <29d4f9d1-cac2-3a60-8901-f290a8780ca1> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
       0x18d76d000 -        0x18d76efff libDiagnosticMessagesClient.dylib (*) <c7ea5723-bf44-39cc-b9dd-3aba9a7d8cd6> /usr/lib/libDiagnosticMessagesClient.dylib
       0x18b080000 -        0x18b081fff libenergytrace.dylib (*) <bc89b4c1-c980-33cb-9eb9-ebd0564f1679> /usr/lib/libenergytrace.dylib
       0x191a87000 -        0x191a98ffb libbsm.0.dylib (*) <a0fa929e-0f99-3ec0-8d1e-0ce932c8b32b> /usr/lib/libbsm.0.dylib
       0x192536000 -        0x192544fff libz.1.dylib (*) <6c4c0566-1289-361b-9cb8-d4829d36b048> /usr/lib/libz.1.dylib
       0x192588000 -        0x1925a7fff libkxld.dylib (*) <a9fa7933-c8ff-339c-87f9-930ae13d3051> /usr/lib/system/libkxld.dylib
       0x18ac91000 -        0x18b064fff com.apple.CFNetwork (1.0) <0af09533-3214-3182-a742-0c04a20f38d1> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
       0x18e2e0000 -        0x18e2ecff7 com.apple.CoreServices.FSEvents (1376.120.2) <e7dd26e1-1b36-3ecf-91b0-860a605facfe> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
       0x188da6000 -        0x1890abfff com.apple.CoreServices.CarbonCore (1333) <40a52404-2ad8-304a-8e95-288142ca0c92> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
       0x18d7b6000 -        0x18d850fff com.apple.Metadata (14.5) <857a33a6-d352-38b3-99d1-54e999ca09e6> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
       0x19221d000 -        0x19224efff com.apple.CoreServices.OSServices (1141.1) <52d67ba7-38af-352c-b3fc-17310a457cd1> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
       0x1926d3000 -        0x192749ff3 com.apple.SearchKit (1.4.1) <6a356b82-915e-343b-a208-5572892ad9d0> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
       0x18ca69000 -        0x18cadcff7 com.apple.AE (944) <3b96540c-5db5-3880-bc50-a759b87f6638> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
       0x185eb1000 -        0x18616bfff com.apple.LaunchServices (1141.1) <a7732bb4-ebdc-3953-99aa-f4c8126604fa> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
       0x1939f9000 -        0x193a4ffff com.apple.DictionaryServices (1.2) <b31de1eb-a4fb-39ad-b93d-714052bac909> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
       0x18e2ed000 -        0x18e317fff com.apple.coreservices.SharedFileList (225) <a71928e2-142f-3476-b537-add1f74c59b6> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
       0x188701000 -        0x188ad3fff com.apple.security (7.0) <fb15585c-5985-39fe-88b0-97a713ff6cbb> /System/Library/Frameworks/Security.framework/Versions/A/Security
       0x1867ad000 -        0x186840fff com.apple.SystemConfiguration (1.21) <c3644d38-5c26-3555-8a80-0cbc0d65d44f> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
       0x192773000 -        0x19278dffb libapple_nghttp2.dylib (*) <aaa8e2c9-3528-3ac2-915f-25eacd6eb958> /usr/lib/libapple_nghttp2.dylib
       0x1927a9000 -        0x192878ff7 libcompression.dylib (*) <4db7a0ba-9d34-39e0-b650-23813be6f62c> /usr/lib/libcompression.dylib
       0x18c6dd000 -        0x18c88ffff libsqlite3.dylib (*) <f6219e0f-e23a-3d19-b004-3de03a2d91c5> /usr/lib/libsqlite3.dylib
       0x18caf1000 -        0x18d73dfff com.apple.Network (1.0) <0ab02a0f-2225-37cf-9a0f-faa394b27339> /System/Library/Frameworks/Network.framework/Versions/A/Network
       0x24c4a6000 -        0x24c4b1fff libCoreEntitlements.dylib (*) <eab5c846-b11d-3d9c-ae0f-cb674c78ef62> /usr/lib/libCoreEntitlements.dylib
       0x232a65000 -        0x232ab0fff com.apple.MessageSecurity (1.0) <d147500f-7864-3e05-9df3-b1e83cc8176d> /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity
       0x18c6c3000 -        0x18c6dcfff com.apple.ProtocolBuffer (1) <a9b03dec-ab77-3731-ace2-34eda2161e90> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer
       0x18b082000 -        0x18b0f7fff libMobileGestalt.dylib (*) <01af5de7-19ee-37e3-b9ec-a94212ee2454> /usr/lib/libMobileGestalt.dylib
       0x192146000 -        0x192209fc7 com.apple.AppleFSCompression (163) <6ebd5137-288a-3469-8fdc-7801290357c2> /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
       0x191a6f000 -        0x191a86fff libcoretls.dylib (*) <1df0b553-730c-313c-8316-c1fce4a891b8> /usr/lib/libcoretls.dylib
       0x193a6f000 -        0x193a70ffb libcoretls_cfhelpers.dylib (*) <9074ae3f-c807-3d6a-8494-6d50ff4f9fc6> /usr/lib/libcoretls_cfhelpers.dylib
       0x1927a3000 -        0x1927a8fff libpam.2.dylib (*) <9844064b-cfba-3b1c-9015-b5f66f74077c> /usr/lib/libpam.2.dylib
       0x193ae1000 -        0x193aefffb libxar.1.dylib (*) <706ea148-bb71-3ac0-9665-b8b43ef44ae5> /usr/lib/libxar.1.dylib
       0x18e31f000 -        0x18e368fff com.apple.CoreAutoLayout (1.0) <bce0435c-c520-300a-af95-24ffdd18a31c> /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout
       0x18d851000 -        0x18d859ffb com.apple.DiskArbitration (2.7) <0cf44dc5-2cd2-39d6-b3ed-ba6b57b75d7e> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
       0x19264a000 -        0x1926d2fff libarchive.2.dylib (*) <9dbff872-76b0-372e-86f8-c73802e66699> /usr/lib/libarchive.2.dylib
       0x18e369000 -        0x18e452fff libxml2.2.dylib (*) <8c3268f6-fa2e-3357-81d8-73a14d6b2718> /usr/lib/libxml2.2.dylib
       0x190c49000 -        0x190c4afff liblangid.dylib (*) <cbca194b-d155-36ee-a6b7-cc117eb506a4> /usr/lib/liblangid.dylib
       0x197b80000 -        0x197cbdfff com.apple.combine (1.0) <ea089775-bc2d-331f-a5be-d4e815ec443d> /System/Library/Frameworks/Combine.framework/Versions/A/Combine
       0x2211ab000 -        0x22130afff com.apple.CollectionsInternal (1.1.0) <555cc8c1-7693-36f2-8a5c-4d8a509add84> /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal
       0x237b5b000 -        0x237b63ff7 com.apple.ReflectionInternal (1.0.0) <16b79d38-1ed9-34b5-a708-24b626c4f51f> /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal
       0x2380ed000 -        0x238104fff com.apple.RuntimeInternal (1.0.0) <a7903523-c87f-3d73-8a53-904f70482802> /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal
       0x195640000 -        0x195b9dfff libswiftCore.dylib (*) <c2fd0f69-d72c-37a5-938e-1bd710c88431> /usr/lib/swift/libswiftCore.dylib
       0x1ab33f000 -        0x1ab345fff libswiftCoreFoundation.dylib (*) <a0e54ba3-3408-37e8-84cd-f2f32342336f> /usr/lib/swift/libswiftCoreFoundation.dylib
       0x1a8daf000 -        0x1a8db8ff3 libswiftDarwin.dylib (*) <3de2759c-d92a-3178-b4a9-f508dc6adb69> /usr/lib/swift/libswiftDarwin.dylib
       0x19b2f2000 -        0x19b309ff7 libswiftDispatch.dylib (*) <b060fdbe-7861-3e6c-9c27-7f067ad899f8> /usr/lib/swift/libswiftDispatch.dylib
       0x1ab38a000 -        0x1ab38afff libswiftIOKit.dylib (*) <8a2029d5-a2e6-3157-80e3-1c1f1335d449> /usr/lib/swift/libswiftIOKit.dylib
       0x19db67000 -        0x19db6aff5 libswiftObjectiveC.dylib (*) <8aa60343-012f-3197-8068-763502b17440> /usr/lib/swift/libswiftObjectiveC.dylib
       0x1ab351000 -        0x1ab388ff2 libswiftXPC.dylib (*) <29a6efdb-404c-36ef-ba75-21f9a8a45d23> /usr/lib/swift/libswiftXPC.dylib
       0x24da95000 -        0x24db00ff7 libswift_Concurrency.dylib (*) <ecc0aae8-fbf0-31df-9881-88fba5de2fa3> /usr/lib/swift/libswift_Concurrency.dylib
       0x24dbe9000 -        0x24dc8bff7 libswift_StringProcessing.dylib (*) <e94d2d06-422d-37da-aa4a-a1fead0614ef> /usr/lib/swift/libswift_StringProcessing.dylib
       0x19db6b000 -        0x19db85fff libswiftos.dylib (*) <fc475323-d274-3263-ba4d-e5925be6996d> /usr/lib/swift/libswiftos.dylib
       0x190c45000 -        0x190c48ffb com.apple.AppleSystemInfo (3.1.5) <284c8baa-c605-38e4-8989-035111869ffc> /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo
       0x1925fb000 -        0x192630ff3 libpcap.A.dylib (*) <88eb2c48-5300-3606-800b-393cdfaa86de> /usr/lib/libpcap.A.dylib
       0x18cadd000 -        0x18cae7fff libdns_services.dylib (*) <32f7b7ca-e2f2-3662-9288-36e45355ad97> /usr/lib/libdns_services.dylib
       0x18ac90000 -        0x18ac90fff libnetwork.dylib (*) <3aa4f957-c82f-31b3-9609-84f54870fc13> /usr/lib/libnetwork.dylib
       0x19176d000 -        0x19177cff3 com.apple.IOMobileFramebuffer (343.0.0) <1da8e614-a3c3-333a-aef6-05072de150ed> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer
       0x18fc9f000 -        0x18fcb6fff com.apple.IOSurface (352.50.1) <a4cd29ec-62e6-33e2-bfc8-7819e956cc3f> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
       0x193a50000 -        0x193a6eff7 liblzma.5.dylib (*) <4a2bae85-b137-34d4-bff1-aa1d4b3f3c55> /usr/lib/liblzma.5.dylib
       0x24db40000 -        0x24dbe8ff7 libswift_RegexParser.dylib (*) <c7986940-41f8-3d2d-ab4a-6ab50beb170a> /usr/lib/swift/libswift_RegexParser.dylib
       0x19220a000 -        0x192216ffb libbz2.1.0.dylib (*) <fe4884df-c495-3024-9c52-81a6fa48948e> /usr/lib/libbz2.1.0.dylib
       0x192631000 -        0x192637ff7 libiconv.2.dylib (*) <6ff6b28c-6fdc-34fa-aa4d-c453cd8cba98> /usr/lib/libiconv.2.dylib
       0x19257c000 -        0x19257ffff libcharset.1.dylib (*) <b5583e20-03d0-36ef-a7fe-172530e4c5cf> /usr/lib/libcharset.1.dylib
       0x193ecf000 -        0x193ed9fff libheimdal-asn1.dylib (*) <2c076790-84f9-335d-9460-19ec8fc4ffcf> /usr/lib/libheimdal-asn1.dylib
       0x191a63000 -        0x191a6efff libCheckFix.dylib (*) <e2951e0e-6cd8-3612-92b8-6b6a23a2c244> /usr/lib/libCheckFix.dylib
       0x18b110000 -        0x18b130ff0 com.apple.TCC (1.0) <8a0ea757-b9df-3366-8e0c-3d4573902d3a> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
       0x190c4b000 -        0x190d6dfff com.apple.CoreNLP (1.0) <e921f18f-76ab-3ea3-bc85-1cb6834573ba> /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
       0x18d76f000 -        0x18d7b5fff com.apple.spotlight.metadata.utilities (1.0) <d2245b90-40b1-394e-b575-dad7093b0390> /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities
       0x199f47000 -        0x199f47fff com.apple.Accelerate (1.11) <a1d25cd6-16d7-3434-bfb1-8c5a0e999168> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
       0x191a99000 -        0x191af4fff libmecab.dylib (*) <231c4f28-deb4-3dd2-aa15-2f284ddde006> /usr/lib/libmecab.dylib
       0x186841000 -        0x186875ff3 libCRFSuite.dylib (*) <3e3d0a90-6aa3-3bd1-a727-67c0a431de47> /usr/lib/libCRFSuite.dylib
       0x191af5000 -        0x191af7ffb libgermantok.dylib (*) <943146cb-ba1e-3f4e-918f-3509e2654e05> /usr/lib/libgermantok.dylib
       0x19274a000 -        0x19274bff7 libThaiTokenizer.dylib (*) <0354ba92-b207-3d92-9d57-7ae07c70cf9c> /usr/lib/libThaiTokenizer.dylib
       0x18d85a000 -        0x18dc43fdf com.apple.vImage (8.1) <d07fd9dc-3856-399d-a81e-899cefd6ba50> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
       0x199c59000 -        0x199c59fff com.apple.Accelerate.vecLib (3.11) <d32b1028-e58a-3770-9ae3-0de81d9ad004> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
       0x193b28000 -        0x193ba3fff libvMisc.dylib (*) <c1240987-2399-3f07-8018-572f3690ec03> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
       0x191648000 -        0x191738f87 libvDSP.dylib (*) <0a4d5667-82b0-3149-a60e-f97358ba60c1> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
       0x1862b8000 -        0x186653fef libBLAS.dylib (*) <6bd0f520-6488-3a00-8e62-72634163926d> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
       0x19287e000 -        0x1939f8fcf libLAPACK.dylib (*) <48ee31be-e483-3d09-ba13-997ab977a13c> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
       0x191af8000 -        0x191b0cfff libLinearAlgebra.dylib (*) <3e7b0cfb-bb03-3dd8-974f-3a858773eb2b> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
       0x19278e000 -        0x1927a0ff3 libSparseBLAS.dylib (*) <3cb02470-835f-3045-baf6-d943568fe147> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
       0x192879000 -        0x19287dffb libQuadrature.dylib (*) <8e0f5493-a1ad-3995-9825-83bf6aa6ef2b> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
       0x190d74000 -        0x191647fef libBNNS.dylib (*) <83cc9d7f-6097-3160-a6fe-2a8c8cf14b70> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
       0x186746000 -        0x1867acfff libSparse.dylib (*) <cfd9d339-1a54-3b1a-b34e-20b1c6f7f204> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
       0x2311b4000 -        0x23174cfff com.apple.MIL (3304.6) <5d0a6482-2945-36cf-b30c-bd3cbf1148bb> /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL
       0x18e2c0000 -        0x18e2dfffb com.apple.CFOpenDirectory (14.5) <7b2c50c1-c7df-30bb-b9f0-5786d1bda8bb> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
       0x18e2b0000 -        0x18e2bffff com.apple.OpenDirectory (14.5) <9c248368-e66d-3da5-bb91-2fe8031dfe35> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
       0x193a71000 -        0x193ae0fff com.apple.APFS (2236.120.10) <c9060514-fd6c-325a-86d5-01a52bc667bd> /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
       0x19199f000 -        0x191a2cfff com.apple.securityfoundation (6.0) <656a09e4-92c3-3f4b-826c-1f0899c503eb> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
       0x193af0000 -        0x193af3ff7 libutil.dylib (*) <fd15e16e-a565-3054-9468-3f22506d3928> /usr/lib/libutil.dylib
       0x22f315000 -        0x22f3f4fff com.apple.InstalledContentLibrary (1.0) <199afa70-6e96-3606-81f7-b99557be6b94> /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary
       0x1890ed000 -        0x18912dfff com.apple.CSStore (1141.1) <d872b449-9090-3d20-95e6-05cc8d6585c3> /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore
       0x18e318000 -        0x18e31efff libapp_launch_measurement.dylib (*) <d4fe7175-3b1b-33cc-9d0c-172e10e2bfa2> /usr/lib/libapp_launch_measurement.dylib
       0x21e958000 -        0x21e96bfff com.apple.private.AppleMobileFileIntegrity-fmk (1.0) <1feb7730-804a-396e-a3f6-49bb2923f4b3> /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity
       0x1ab30d000 -        0x1ab331fff libmis.dylib (*) <4a9f130b-1340-3b33-b5c3-90889a28294b> /usr/lib/libmis.dylib
       0x1bb9ff000 -        0x1bba06fff com.apple.MobileSystemServices (1.0) <c2ef7c2f-6c0a-37fe-b8c1-02fea3eb410d> /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices
       0x1d9a61000 -        0x1d9a64fff com.apple.ConfigProfileHelper (16.5) <b61ca85b-c469-31a6-ae90-5a6046181308> /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper
       0x18d73e000 -        0x18d76cfff com.apple.analyticsd (1.0) <290e81d8-3981-3a94-a59e-dd367c9ba892> /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics
       0x19274c000 -        0x192772ff7 com.apple.applesauce (1.0) <9a7649fa-6ccc-3c9f-beb8-6020b7023b96> /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce
       0x18778b000 -        0x187970fff com.apple.LanguageModeling (1.0) <7701df1d-3d87-3f60-9d5d-b8b7a0f6917a> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
       0x193af4000 -        0x193b1fff3 libxslt.1.dylib (*) <3ce8845c-f488-3dd3-abc9-23e76dbcd0f8> /usr/lib/libxslt.1.dylib
       0x192638000 -        0x192649fff libcmph.dylib (*) <e2d90341-9f74-315b-a27b-fe493be1c4b7> /usr/lib/libcmph.dylib
       0x191739000 -        0x19176cfff com.apple.CoreEmoji (1.0) <5c303a03-8ea3-317a-82d7-3662844d1b1f> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
       0x190d6e000 -        0x190d73fff com.apple.LinguisticData (1.0) <e0cf614b-be94-322e-a5b4-20b39cc70ebd> /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
       0x186654000 -        0x186745ff7 com.apple.Lexicon-framework (1.0) <659549b8-af23-3b84-aa57-593bc7378441> /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
       0x191a2d000 -        0x191a54fff com.apple.coreservices.BackgroundTaskManagement (1.0) <29555a47-7022-36c6-806e-d1b09f45a193> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
       0x24c690000 -        0x24c69bfff libTLE.dylib (*) <8f92e018-aa6c-3b54-ab50-9e7abdce0f8d> /usr/lib/libTLE.dylib
       0x10aeb0000 -        0x10aed7fff libc++abi.1.0.dylib (*) <6350ae3e-e769-322f-88c2-575b5f12ff7d> /Volumes/VOLUME/*/libc++abi.1.0.dylib
       0x1041ec000 -        0x108c77fff .swift-frontend-wrapped (*) <c6324092-5294-3e7b-9437-f757cb8a5b93> /Volumes/VOLUME/*/.swift-frontend-wrapped
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=756.5M resident=0K(0%) swapped_out_or_unallocated=756.5M(100%)
Writable regions: Total=589.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=589.8M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                   32K        1 
MALLOC                           521.2M       11 
MALLOC guard page                   96K        6 
STACK GUARD                         16K        1 
Stack                             64.0M        1 
VM_ALLOCATE                         16K        1 
__AUTH                             343K       67 
__AUTH_CONST                      4087K      148 
__DATA                            2424K      150 
__DATA_CONST                      8241K      155 
__DATA_DIRTY                       365K       58 
__LINKEDIT                       558.2M        7 
__OBJC_RO                         71.9M        2 
__OBJC_RW                         2199K        1 
__TEXT                           198.3M      162 
dyld private memory               4384K        4 
mapped file                        3.1G      244 
shared memory                       16K        1 
===========                     =======  ======= 
TOTAL                              4.5G     1020 



-----------
Full Report
-----------
<omitted for brevity>

The stacktrace:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   .swift-frontend-wrapped       	       0x10837df6c llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) + 96
1   .swift-frontend-wrapped       	       0x10831f788 std::__1::pair<llvm::StringMapIterator<llvm::cl::Option*>, bool> llvm::StringMap<llvm::cl::Option*, llvm::MallocAllocator>::try_emplace<llvm::cl::Option*>(llvm::StringRef, llvm::cl::Option*&&) + 44
2   .swift-frontend-wrapped       	       0x10831fa1c (anonymous namespace)::CommandLineParser::addOption(llvm::cl::Option*, llvm::cl::SubCommand*) + 140
3   .swift-frontend-wrapped       	       0x108314268 llvm::cl::Option::addArgument() + 80
4   .swift-frontend-wrapped       	       0x104befb10 _GLOBAL__sub_I_LSLocationPrinter.cpp + 996

suggests that the issue happens during library initialisation, probably at first memory allocation.

Also note that the code that triggers this was removed in Swift 5.10 with swiftlang/swift#67395

@victorhooi
Copy link

Stupid question - but is there any workaround for this issue right now?

As a Nix newbie - this is stopping me from making any changes to my Nix configuration (on my macOS machine), or installing any new packages. But I'm assuming for somebody familiar with Nix, there may be some temporary workaround, or way to get their box going? (e.g. reverting to an older version?)

@huwaireb
Copy link
Author

huwaireb commented Jul 10, 2024

Stupid question - but is there any workaround for this issue right now?

As a Nix newbie - this is stopping me from making any changes to my Nix configuration (on my macOS machine), or installing any new packages. But I'm assuming for somebody familiar with Nix, there may be some temporary workaround, or way to get their box going? (e.g. reverting to an older version?)

I don't have the exact commit, so I can't say for unstable. However, it seems to work on 24.05. So probably that is your bet.

@victorhooi
Copy link

Hmm, I'm using flakes, via this template.

I believe it's set to use unstable packages, via this line:

https://github.com/dustinlyons/nixos-config/blob/main/flake.nix#L4

Is there some way to revert just the swift package from 24.05 - if you think that might fix this issue?

@JPyke3
Copy link

JPyke3 commented Jul 12, 2024

Hmm, I'm using flakes, via this template.

I believe it's set to use unstable packages, via this line:

https://github.com/dustinlyons/nixos-config/blob/main/flake.nix#L4

Is there some way to revert just the swift package from 24.05 - if you think that might fix this issue?

Is there any particular reason you need to be on unstable? Be aware that if you are on unstable this is probably going to be coming up a bit.

You can change that line from this:

nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

To this:

nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";

To change everything to 24.05

If you just want to switch just nix-darwin which isn't entirely recommended, you can have a flake input for both unstable and 24.05:

nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";

And then you can change the follows in the Nix input declarations to this (For the inputs you want to follow unstable pkgs instead):

inputs.nixpkgs.follows = "unstable";

@huwaireb
Copy link
Author

huwaireb commented Jul 12, 2024

cc @NixOS/darwin-maintainers, as suggested on the Nix macOS matrix channel. Given it's not an issue solvable by the Swift maintainer alone.

@huwaireb
Copy link
Author

huwaireb commented Jul 12, 2024

A fix to the clang linking issues landed on main unknowingly, therefore the initial error is no longer an issue. However, two more errors arose right after. The codesigning one mentioned by @YorikSar, and building it with latest nixpkgs-unstable will error with an unsupported flag being passed.

@reckenrode's ld64 upgrades (#307880) fixes the codesigning errors, and he also suggested passing hardeningDisable = [ "zerocallusedregs" ]; to the swift derivation which outright fixes it.

Once #307880 lands on master (soon), passing hardeningDisable = [ "zerocallusedregs" ]; to the derivation and unmarking it as broken, will solve this issue.

@corngood
Copy link
Contributor

Once #307880 lands on master (soon), passing hardeningDisable = [ "zerocallusedregs" ]; to the derivation and unmarking it as broken, will solve this issue.

in case nobody else did it yet: #326588

@corngood
Copy link
Contributor

#326588 seems to fix it even without #307880 (see nixpkgs-review).

@huwaireb
Copy link
Author

#326588 seems to fix it even without #307880 (see nixpkgs-review).

It builds sure, but try using it. You should run into similar issues as above

On my machine swiftc itself has built successfully, but whenever I try to use it, I get following on the Console:

<many sandbox violations skipped>
0	error	22:21:30.398565+0200	kernel	Sandbox: .swift-frontend-wrapped(15482) deny(1) file-read-metadata /usr/libexec/swift
0	error	22:21:30.398576+0200	kernel	Sandbox: .swift-frontend-wrapped(15482) deny(1) file-read-metadata /usr/bin
0	default	22:21:30.411803+0200	kernel	CODE SIGNING: cs_invalid_page(0x108934000): p=15482[.swift-frontend-] final status 0x23000200, denying page sending SIGKILL
0	default	22:21:30.411813+0200	kernel	CODE SIGNING: process 15482[.swift-frontend-]: rejecting invalid page at address 0x108934000 from offset 0x4748000 in file "/nix/store/740l3753ba41sn99gr2npdjmbqylbikm-swift-5.8/bin/.swift-frontend-wrapped" (cs_mtime:1.0 == mtime:1.0) (signed:1 validated:1 tainted:1 nx:0 wpmapped:0 dirty:0 depth:0)

and then the following crash report is generated:

Report
The stacktrace:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   .swift-frontend-wrapped       	       0x10837df6c llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) + 96
1   .swift-frontend-wrapped       	       0x10831f788 std::__1::pair<llvm::StringMapIterator<llvm::cl::Option*>, bool> llvm::StringMap<llvm::cl::Option*, llvm::MallocAllocator>::try_emplace<llvm::cl::Option*>(llvm::StringRef, llvm::cl::Option*&&) + 44
2   .swift-frontend-wrapped       	       0x10831fa1c (anonymous namespace)::CommandLineParser::addOption(llvm::cl::Option*, llvm::cl::SubCommand*) + 140
3   .swift-frontend-wrapped       	       0x108314268 llvm::cl::Option::addArgument() + 80
4   .swift-frontend-wrapped       	       0x104befb10 _GLOBAL__sub_I_LSLocationPrinter.cpp + 996

suggests that the issue happens during library initialisation, probably at first memory allocation.

Also note that the code that triggers this was removed in Swift 5.10 with swiftlang/swift#67395

@corngood
Copy link
Contributor

corngood commented Jul 12, 2024

Do you have more exact steps? For example, this (in an empty dir) seems to work for me:

nix shell ~/.cache/nixpkgs-review/pr-326588/nixpkgs#swiftPackages.swift -c bash -c 'swift package init && swift build'

I can also run swiftc Sources/*/*.swift in the generated project.

I only have access to the darwin community builder, so that's what I'm testing on.

@huwaireb
Copy link
Author

Do you have more exact steps? For example, this (in an empty dir) seems to work for me:

nix shell ~/.cache/nixpkgs-review/pr-326588/nixpkgs#swiftPackages.swift -c bash -c 'swift package init && swift build'

I can also run swiftc Sources/*/*.swift in the generated project.

I only have access to the darwin community builder, so that's what I'm testing on.

I'm genuinely so confused, errors are disappearing and appearing 😭. I'm going to try building it off your PR, see if it works.

@huwaireb
Copy link
Author

huwaireb commented Jul 12, 2024

Do you have more exact steps? For example, this (in an empty dir) seems to work for me:

nix shell ~/.cache/nixpkgs-review/pr-326588/nixpkgs#swiftPackages.swift -c bash -c 'swift package init && swift build'

I can also run swiftc Sources/*/*.swift in the generated project.

I only have access to the darwin community builder, so that's what I'm testing on.

Built swift off your branch and used it, it works just fine now 🎉.

for anyone that runs into that codesign issue can either try to rebuild it again or wait for the ld64 upgrade PR. Given it is unknown what causes it to fail.

We can close this issue after #326588 is merged, thanks @reckenrode, @emilazy, and @corngood.

@mjm
Copy link
Contributor

mjm commented Jul 12, 2024

I applied the patch for #326588 and was able to build swift and therefore dockutil, so just wanted to add my voice to say this works for me :D Thank you for the fix!

shahinism pushed a commit to shahinism/nixpkgs that referenced this issue Jul 15, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-debug-nix-cache-misses/49151/4

@aaronpkelly
Copy link

aaronpkelly commented Jul 28, 2024

Hello swift-unwrapped maintainers @dduan @stephank @trepetti @Trundle

on the nixpkgs staging-next branch, swift-unwrapped is currently failing to build on 3/4 platforms:

two of those platforms haven't had a successful build in almost 2 months :(

can you please take a look?

@huwaireb
Copy link
Author

huwaireb commented Jul 28, 2024

Hello swift-unwrapped maintainers @dduan @stephank @trepetti @Trundle

on the nixpkgs staging-next branch, swift-unwrapped is currently failing to build on 3/4 platforms:

two of those platforms haven't had a successful build in almost 2 months :(

can you please take a look?

Looks like the initial error that was caused by nixpkgs's clang is now back. We had no leads to what commit caused it given it suddenly disappeared.

could someone reopen this issue as the option isn't available for me.

cc @NixOS/maintainers

EDIT:

Probably better to just move to a newer issue that was opened 2 weeks ago:
#327836

@aaronpkelly

@aaronpkelly
Copy link

Sure, I'll put my comment there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

10 participants