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

[SR-9376] Private CodingKeys in another file messes up Codable synthesis #51842

Open
tkrajacic opened this issue Nov 29, 2018 · 5 comments
Open

[SR-9376] Private CodingKeys in another file messes up Codable synthesis #51842

tkrajacic opened this issue Nov 29, 2018 · 5 comments

Comments

@tkrajacic
Copy link

@tkrajacic tkrajacic commented Nov 29, 2018

Previous ID SR-9376
Radar rdar://problem/59998063
Original Reporter @tkrajacic
Type Bug

Attachment: Download

Environment

Tested with Xcode Version 10.1 (10B61) included toolchain and the latest master (2018-11-28a)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Codable, CompilerCrash
Assignee None
Priority Medium

md5: 8fb0cf9840008677d56ea3c469ce3c08

Issue Description:

This traps the compiler when using `incremental` compilation mode but not when using `whole module` mode (see attached sample project for easy testing):

Property.swift

struct Property: Decodable {
    var key: String
}

Property+Codable.swift

extension Property {
    private enum CodingKeys: String, CodingKey {
        case key
    }
}

with the result:

Global is external, but doesn't have external or weak linkage!
%swift.type* @"$S14CodableCrasher8PropertyV10CodingKeys33_1AC7B054C26C4327D88753EB7D2E403CLLON"
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken module found, compilation aborted!
0  swift                    0x000000010542f59a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010542ed4e SignalHandler(int) + 302
2  libsystem_platform.dylib 0x00007fff592edb3d _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffeee5cad20 _sigtramp + 2502808064
4  libsystem_c.dylib        0x00007fff591ac1c9 abort + 127
5  swift                    0x00000001016b4a67 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 519
6  swift                    0x00000001053e31c8 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
7  swift                    0x00000001053e30ab llvm::report_fatal_error(char const*, bool) + 43
8  swift                    0x00000001053aa6ec (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 204
9  swift                    0x0000000105350763 llvm::FPPassManager::doFinalization(llvm::Module&) + 83
10 swift                    0x0000000105355b57 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 71
11 swift                    0x000000010187b1b5 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 4533
12 swift                    0x00000001016c1242 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 49170
13 swift                    0x00000001016b1d35 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7717
14 swift                    0x0000000101657965 main + 1349
15 libdyld.dylib            0x00007fff5910408d start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/tkrajacic/Downloads/CodableCrasher/CodableCrasher/Property.swift /Users/tkrajacic/Downloads/CodableCrasher/CodableCrasher/Property+Codable.swift /Users/tkrajacic/Downloads/CodableCrasher/CodableCrasher/AppDelegate.swift -emit-module-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property~partial.swiftmodule -emit-module-doc-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property~partial.swiftdoc -serialize-diagnostics-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.dia -emit-dependencies-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.d -emit-reference-dependencies-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.swiftdeps -target x86_64-apple-macosx10.14 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Products/Debug -F /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Products/Debug -enable-testing -g -module-cache-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-generated-files.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-own-target-headers.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-all-target-headers.hmap -Xcc -iquote -Xcc /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-project-headers.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Products/Debug/include -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources/x86_64 -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/tkrajacic/Downloads/CodableCrasher -module-name CodableCrasher -o /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.o -index-store-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-efdmtzdcpqqlnnhkijqdnqchqgjg/Index/DataStore -index-system-modules 
error: Abort trap: 6

This only happens when the conformance is in a separate file.

Possibly related to https://bugs.swift.org/browse/SR-4370 ?

@belkadan
Copy link
Contributor

@belkadan belkadan commented Nov 30, 2018

Probably not related. That's really scary that it's trying to use the CodingKeys from the other file! Fortunately it's probably an easy fix: we need to do a smarter lookup when synthesizing Codable implementations.

@tkrajacic
Copy link
Author

@tkrajacic tkrajacic commented Nov 30, 2018

Yeah sry, I just went through all the other bug reports with the same error and there were only very few open.

A poor man's check for related bugs 🙂

@tkrajacic
Copy link
Author

@tkrajacic tkrajacic commented Apr 2, 2019

This still crashes when using Xcode 10.2 in Swift 4.2 compiler mode. Then I even get the crash-reporter popup with the following:

Process: swift [39067]Process: swift [39067]Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftIdentifier: swiftVersion: 1001.0.69.5Code Type: X86-64 (Native)Parent Process: ??? [39065]Responsible: swift [39067]User ID: 501
Date/Time: 2019-04-02 06:21:13.591 +0200OS Version: Mac OS X 10.14.4 (18E226)Report Version: 12Anonymous UUID: 3EA4B8E2-6EF8-2F9C-35F9-8F59E7857CB2
Sleep/Wake UUID: F4DB7AC1-19F7-4CAA-B7AE-677F0FEFA672
Time Awake Since Boot: 220000 secondsTime Since Wake: 5000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)Exception Codes: 0x0000000000000000, 0x0000000000000000Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread0 libsystem_kernel.dylib 0x00007fff7bfc62c6 __pthread_kill + 101 libsystem_pthread.dylib 0x00007fff7c07bbf1 pthread_kill + 2842 libsystem_c.dylib 0x00007fff7bf30745 __abort + 1443 libsystem_c.dylib 0x00007fff7bf306b5 abort + 1424 swift 0x0000000105143aa8 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$1::invoke(void*, std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> > const&, bool) + 9365 swift 0x000000010929c7d6 llvm::report_fatal_error(llvm::Twine const&, bool) + 2786 swift 0x000000010929c6bb llvm::report_fatal_error(char const*, bool) + 437 swift 0x000000010926289c (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 2048 swift 0x0000000109206823 llvm::FPPassManager::doFinalization(llvm::Module&) + 519 swift 0x000000010920e212 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 8210 swift 0x0000000105329055 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>, llvm::GlobalVariable, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 459711 swift 0x000000010515091e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 5156612 swift 0x00000001051406de swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 686213 swift 0x00000001050de7be main + 124614 libdyld.dylib 0x00007fff7be8b3d5 start + 1
Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x000000011114d5c0 rcx: 0x00007ffeeab44958 rdx: 0x0000000000000000 rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007ffeeab44990 rsp: 0x00007ffeeab44958 r8: 0x0000000000000000 r9: 0x0000000000989680 r10: 0x0000000000000000 r11: 0x0000000000000206 r12: 0x0000000000000307 r13: 0x00007ffeeab44a10 r14: 0x0000000000000006 r15: 0x000000000000002d rip: 0x00007fff7bfc62c6 rfl: 0x0000000000000206 cr2: 0x00007fbf73cd1008 Logical CPU: 0Error Code: 0x02000148Trap Number: 133``Binary Images: 0x1050b3000 - 0x109ca7ffb swift (1001.0.69.5) <05F55527-3D9F-3E64-A0EB-7B8762E34A07> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift 0x1110ab000 - 0x1111156ef dyld (655.1.1) <F217F7F8-A795-3109-B77F-B1E2277F3E3B> /usr/lib/dyld 0x7fff78c4f000 - 0x7fff78c50ffb libSystem.B.dylib (1252.250.1) <72841192-B0C9-36A0-8E55-ED651EADEF08> /usr/lib/libSystem.B.dylib 0x7fff78e92000 - 0x7fff78ee5ff7 libc.1.dylib (400.9.4) <446DAE5E-4E97-3E4B-B2A3-AC0A74C0E453> /usr/lib/libc.1.dylib 0x7fff78ee6000 - 0x7fff78efbff7 libcabi.dylib (400.17) <A2D1FDAD-E10F-3E53-958F-CB6BC8485767> /usr/lib/libc+abi.dylib 0x7fff79991000 - 0x7fff799aeff7 libedit.3.dylib (50.200.2) <3A226EAE-7A18-3C63-ACFE-D2F272FEE034> /usr/lib/libedit.3.dylib 0x7fff7a095000 - 0x7fff7a0c5fff libncurses.5.4.dylib (53.200.3) <710A5A0A-8501-384F-8F0A-722B56CC6016> /usr/lib/libncurses.5.4.dylib 0x7fff7a649000 - 0x7fff7adcefdf libobjc.A.dylib (756.2) <4F86FC7C-496B-3E68-8A74-1EA2BA22FBCC> /usr/lib/libobjc.A.dylib 0x7fff7b51f000 - 0x7fff7b531ff7 libz.1.dylib (70.200.4) <FDF169F3-F992-3E8E-B3F7-D4134FEBAE41> /usr/lib/libz.1.dylib 0x7fff7bd0e000 - 0x7fff7bd12ff3 libcache.dylib (81) <9A8C27B0-49C9-337F-8BE2-37171ED2D8EE> /usr/lib/system/libcache.dylib 0x7fff7bd13000 - 0x7fff7bd1dff3 libcommonCrypto.dylib (60118.250.2) <17C4F395-9FF0-331F-8167-5E85AA3588E9> /usr/lib/system/libcommonCrypto.dylib 0x7fff7bd1e000 - 0x7fff7bd25ff7 libcompiler_rt.dylib (63.4) <8CB2B2B6-2C55-3733-9842-0E037AE3F46A> /usr/lib/system/libcompiler_rt.dylib 0x7fff7bd26000 - 0x7fff7bd2fff7 libcopyfile.dylib (146.250.1) <24905E41-9E2F-3DD1-A255-5A17F9FCDAD7> /usr/lib/system/libcopyfile.dylib 0x7fff7bd30000 - 0x7fff7bdb4fc7 libcorecrypto.dylib (602.250.23) <3A6CBD41-AFFE-3E06-B1EC-3E95BC79BAC5> /usr/lib/system/libcorecrypto.dylib 0x7fff7be3b000 - 0x7fff7be74ff7 libdispatch.dylib (1008.250.7) <50235FCE-B399-3319-90DC-88F530D4FC5C> /usr/lib/system/libdispatch.dylib 0x7fff7be75000 - 0x7fff7bea1ff7 libdyld.dylib (655.1.1) <54C6B494-4A3D-3EEC-B083-636A76AAD649> /usr/lib/system/libdyld.dylib 0x7fff7bea2000 - 0x7fff7bea2ffb libkeymgr.dylib (30) <BEA04E04-FCF1-3A70-810F-08D0FF54CA36> /usr/lib/system/libkeymgr.dylib 0x7fff7beb0000 - 0x7fff7beb0ff7 liblaunch.dylib (1336.251.2) <30E6424E-4640-3DBA-9B64-D5F725263C6E> /usr/lib/system/liblaunch.dylib 0x7fff7beb1000 - 0x7fff7beb6fff libmacho.dylib (927.0.2) <D8515A20-ED7B-3B13-9ADA-4BD7E19E38C4> /usr/lib/system/libmacho.dylib 0x7fff7beb7000 - 0x7fff7beb9ffb libquarantine.dylib (86.220.1) <8A9BF971-DB7D-311A-B131-6C5025E82F8F> /usr/lib/system/libquarantine.dylib 0x7fff7beba000 - 0x7fff7bebbff7 libremovefile.dylib (45.200.2) <950036B7-B91E-3B5D-853C-8C551E5B6A32> /usr/lib/system/libremovefile.dylib 0x7fff7bebc000 - 0x7fff7bed3ff3 libsystem_asl.dylib (356.200.4) <16F632AD-FADA-3DE9-85E8-EBC7D619A1DA> /usr/lib/system/libsystem_asl.dylib 0x7fff7bed4000 - 0x7fff7bed4ff7 libsystem_blocks.dylib (73) <0CD6861B-EC5F-3345-9C24-B21EEB85E44F> /usr/lib/system/libsystem_blocks.dylib 0x7fff7bed5000 - 0x7fff7bf5cfff libsystem_c.dylib (1272.250.1) <F3AA9047-EEDD-3D80-8CC1-023FB312EC8B> /usr/lib/system/libsystem_c.dylib 0x7fff7bf5d000 - 0x7fff7bf60ffb libsystem_configuration.dylib (963.250.1) <02C7A973-014A-31D7-B7D2-247D384CB0D2> /usr/lib/system/libsystem_configuration.dylib 0x7fff7bf61000 - 0x7fff7bf64ff7 libsystem_coreservices.dylib (66) <4CF1C89B-FA6C-3DF3-B1F8-79F549849534> /usr/lib/system/libsystem_coreservices.dylib 0x7fff7bf65000 - 0x7fff7bf6bfff libsystem_darwin.dylib (1272.250.1) <6983A268-20F4-3F98-A3F5-D63848933B02> /usr/lib/system/libsystem_darwin.dylib 0x7fff7bf6c000 - 0x7fff7bf72ff7 libsystem_dnssd.dylib (878.250.4) <9FC5724C-DD03-3E14-A6E1-2DD009D79E0A> /usr/lib/system/libsystem_dnssd.dylib 0x7fff7bf73000 - 0x7fff7bfbeffb libsystem_info.dylib (517.200.9) <F617D3CF-5A4A-36D0-8CBB-4A7C7CDB67AF> /usr/lib/system/libsystem_info.dylib 0x7fff7bfbf000 - 0x7fff7bfe7ff7 libsystem_kernel.dylib (4903.251.3) <84EF0290-6CB5-36E5-A273-692A7E437B36> /usr/lib/system/libsystem_kernel.dylib 0x7fff7bfe8000 - 0x7fff7c033ff7 libsystem_m.dylib (3158.200.7) <33105665-CCC3-36D5-82C9-9B21730CB3DF> /usr/lib/system/libsystem_m.dylib 0x7fff7c034000 - 0x7fff7c058fff libsystem_malloc.dylib (166.251.2) <90DA09E3-1276-3FCF-8F5F-C9AA61AB9B6D> /usr/lib/system/libsystem_malloc.dylib 0x7fff7c059000 - 0x7fff7c063ff7 libsystem_networkextension.dylib (767.250.2) <4575D797-B793-3D18-9E93-8696CF0B133B> /usr/lib/system/libsystem_networkextension.dylib 0x7fff7c064000 - 0x7fff7c06bfff libsystem_notify.dylib (172.200.21) <679E9132-1A46-326E-9A11-D3FF9C86041C> /usr/lib/system/libsystem_notify.dylib 0x7fff7c06c000 - 0x7fff7c075fef libsystem_platform.dylib (177.250.1) <3CC59141-5365-3848-94C3-D65E6FCA1E74> /usr/lib/system/libsystem_platform.dylib 0x7fff7c076000 - 0x7fff7c080ff7 libsystem_pthread.dylib (330.250.2) <4344198A-A1A3-3C52-97B4-F168D56E9789> /usr/lib/system/libsystem_pthread.dylib 0x7fff7c081000 - 0x7fff7c084ff7 libsystem_sandbox.dylib (851.250.12) <66E91015-F62A-3365-BB81-AA88707E8F12> /usr/lib/system/libsystem_sandbox.dylib 0x7fff7c085000 - 0x7fff7c087ff3 libsystem_secinit.dylib (30.220.1) <F054DCB0-68CE-35E7-8B8C-D648C42124EC> /usr/lib/system/libsystem_secinit.dylib 0x7fff7c088000 - 0x7fff7c08fff3 libsystem_symptoms.dylib (820.257.1) <C8517F35-E9DA-3649-B07D-2B38349C6730> /usr/lib/system/libsystem_symptoms.dylib 0x7fff7c090000 - 0x7fff7c0a5fff libsystem_trace.dylib (906.250.5) <AE77ACC7-488F-3AE1-BB0C-1ACFC7E1CE77> /usr/lib/system/libsystem_trace.dylib 0x7fff7c0a7000 - 0x7fff7c0acffb libunwind.dylib (35.4) <8F0BC197-B97C-3DDC-92B0-6A7D3CB72FD8> /usr/lib/system/libunwind.dylib 0x7fff7c0ad000 - 0x7fff7c0dcff7 libxpc.dylib (1336.251.2) <49138829-09C8-355C-B558-97E070B84EC5> /usr/lib/system/libxpc.dylib
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: 457922 thread_create: 0 thread_set_state: 576
VM Region Summary:ReadOnly portion of Libraries: Total=318.0M resident=0K(0%) swapped_out_or_unallocated=318.0M(100%)Writable regions: Total=113.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=113.6M(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Kernel Alloc Once 8K 1 MALLOC 105.1M 35 MALLOC guard page 16K 4 STACK GUARD 56.0M 1 Stack 8192K 1 _DATA 5604K 43 LINKEDIT 230.1M 3 _TEXT 87.9M 42 shared memory 8K 2 =========== ======= ======= TOTAL 492.6M 132
Model: MacBook9,1, BootROM 179.0.0.0.0, 2 processors, Intel Core m7, 1,3 GHz, 8 GB, SMC 2.35f105Graphics: kHW_IntelHD515Item, Intel HD Graphics 515, spdisplays_builtinMemory Module: BANK 0/DIMM0, 4 GB, LPDDR3, 1867 MHz, 0x80CE, 0x4B33514634463430424D2D41474346202020Memory Module: BANK 1/DIMM0, 4 GB, LPDDR3, 1867 MHz, 0x80CE, 0x4B33514634463430424D2D41474346202020AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x158), Broadcom BCM43xx 1.0 (7.77.61.2 AirPortDriverBrcmNIC-1305.8)Bluetooth: Version 6.0.11f4, 3 services, 27 devices, 1 incoming serial portsNetwork Service: Wi-Fi, AirPort, en0USB Device: USB 3.0 BusThunderbolt Bus:

@tkrajacic
Copy link
Author

@tkrajacic tkrajacic commented Apr 2, 2019

Even in Swift 5 this crashes spectacularly

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@tkrajacic
Copy link
Author

@tkrajacic tkrajacic commented Apr 26, 2022

This still crashes in the latest Swift 5.6 (Xcode Version 13.3.1 (13E500a))

CompileSwift normal x86_64 /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/Property.swift (in target 'CodableCrasher' from project 'CodableCrasher')
    cd /Users/tkrajacic/Downloads/SR-9376/CodableCrasher
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/Property.swift /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/Property+Codable.swift /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/AppDelegate.swift -emit-dependencies-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.d -emit-reference-dependencies-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.swiftdeps -serialize-diagnostics-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.dia -target x86_64-apple-macos10.14 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -I /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Products/Debug -F /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Products/Debug -enable-testing -g -module-cache-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity\=checked -Onone -D DEBUG -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-debugging-options -Xcc -working-directory -Xcc /Users/tkrajacic/Downloads/SR-9376/CodableCrasher -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-generated-files.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-own-target-headers.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-all-target-headers.hmap -Xcc -iquote -Xcc /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-project-headers.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Products/Debug/include -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources-normal/x86_64 -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources/x86_64 -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources -Xcc -DDEBUG\=1 -module-name CodableCrasher -target-sdk-version 12.3 -o /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.o -index-unit-output-path /CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.o -index-store-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Index/DataStore -index-system-modules

Global is external, but doesn't have external or weak linkage!
%swift.type_descriptor* @"$s14CodableCrasher8PropertyV10CodingKeys33_1AC7B054C26C4327D88753EB7D2E403CLLOMn"
Global is external, but doesn't have external or weak linkage!
%swift.type* @"$s14CodableCrasher8PropertyV10CodingKeys33_1AC7B054C26C4327D88753EB7D2E403CLLON"
Global is external, but doesn't have external or weak linkage!
%swift.protocol_conformance_descriptor* @"$s14CodableCrasher8PropertyV10CodingKeys33_1AC7B054C26C4327D88753EB7D2E403CLLOs0D3KeyAAMc"
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
<unknown>:0: note: Broken module found, compilation aborted!
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/Property.swift /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/Property+Codable.swift /Users/tkrajacic/Downloads/SR-9376/CodableCrasher/CodableCrasher/AppDelegate.swift -emit-dependencies-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.d -emit-reference-dependencies-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.swiftdeps -serialize-diagnostics-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.dia -target x86_64-apple-macos10.14 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -I /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Products/Debug -F /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Products/Debug -enable-testing -g -module-cache-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-debugging-options -Xcc -working-directory -Xcc /Users/tkrajacic/Downloads/SR-9376/CodableCrasher -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-generated-files.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-own-target-headers.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-all-target-headers.hmap -Xcc -iquote -Xcc /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/CodableCrasher-project-headers.hmap -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Products/Debug/include -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources-normal/x86_64 -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources/x86_64 -Xcc -I/Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/DerivedSources -Xcc -DDEBUG=1 -module-name CodableCrasher -target-sdk-version 12.3 -o /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Build/Intermediates.noindex/CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.o -index-unit-output-path /CodableCrasher.build/Debug/CodableCrasher.build/Objects-normal/x86_64/Property.o -index-store-path /Users/tkrajacic/Library/Developer/Xcode/DerivedData/CodableCrasher-empparzmujrdgqbucuiwecbjwntb/Index/DataStore -index-system-modules
1.	Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
2.	Compiling with the current language version
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x000000010e550de7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x000000010e54fe38 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x000000010e551440 SignalHandler(int) + 288
3  libsystem_platform.dylib 0x00007ff8128e7dfd _sigtramp + 29
4  libsystem_malloc.dylib   0x00007ff8126ee1b3 free_tiny + 446
5  libsystem_c.dylib        0x00007ff81281dd24 abort + 123
6  swift-frontend           0x000000010927c962 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_2::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 994
7  swift-frontend           0x000000010e49db97 llvm::report_fatal_error(llvm::Twine const&, bool) + 295
8  swift-frontend           0x000000010e49da69 llvm::report_fatal_error(char const*, bool) + 41
9  swift-frontend           0x000000010e30301f (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 191
10 swift-frontend           0x000000010e29d142 llvm::FPPassManager::doFinalization(llvm::Module&) + 66
11 swift-frontend           0x000000010e295920 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 80
12 swift-frontend           0x00000001097b4119 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 2313
13 swift-frontend           0x00000001097b58cc swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, swift::UnifiedStatsReporter*) + 2812
14 swift-frontend           0x000000010928766b performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 3195
15 swift-frontend           0x0000000109279261 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 15233
16 swift-frontend           0x00000001092385d4 swift::mainEntry(int, char const**) + 1108
17 dyld                     0x000000012066a51e start + 462
error: Abort trap: 6 (in target 'CodableCrasher' from project 'CodableCrasher')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants