Skip to content

Building HandyJSON in Swift 5.10 throws a fatal error #71946

Open
@CrazyFanFan

Description

@CrazyFanFan

Description

When building HandyJSON using Swift version 5.10, the compiler throws a fatal error. The code was being compiled for 'arm64-apple-ios12.0'.
The error thrown by the compiler was:

Call parameter type does not match function signature!
ptr null
 i64  %16 = call swiftcc i64 @swift_getTypeByMangledNameInContext(ptr %15, i64 %10, ptr null, ptr null) #22, !dbg !2868

Reproduction

Clone HandyJSON to your local.
The issue was encountered when executing the following swift build command:

swift build \
-c release \
-Xswiftc "-target" -Xswiftc "arm64-apple-ios12.0" \
-Xswiftc "-Osize" \
--sdk "/Applications/Xcode-15.3.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk"

Stack dump

<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<unknown>:0: note: Broken module found, compilation aborted!
Rename failed: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/ContextDescriptorType.swift-247a21ae.o.tmp -> /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/ContextDescriptorType.swift.o: No such file or directory
<unknown>:0: error: error closing '/Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/ContextDescriptorType.swift.o' for output: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/ContextDescriptorType.swift-247a21ae.o.tmp => /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/ContextDescriptorType.swift.o: No such file or directory
Rename failed: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/FieldDescriptor.swift-0e23ada6.o.tmp -> /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/FieldDescriptor.swift.o: No such file or directory
<unknown>:0: error: error closing '/Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/FieldDescriptor.swift.o' for output: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/FieldDescriptor.swift-0e23ada6.o.tmp => /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/FieldDescriptor.swift.o: No such file or directory
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
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           0x0000000108837f3c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x00000001088370f8 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000108838544 SignalHandler(int) + 360
3  libsystem_platform.dylib 0x000000019df13584 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000019dee2c20 pthread_kill + 288
5  libsystem_c.dylib        0x000000019ddefa20 abort + 180
6  swift-frontend           0x00000001031416d8 PrettyStackTraceFrontend::~PrettyStackTraceFrontend() + 0
7  swift-frontend           0x0000000108780a18 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
8  swift-frontend           0x0000000108780900 llvm::report_fatal_error(llvm::Twine const&, bool) + 0
9  swift-frontend           0x00000001036144b8 llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::printPipeline(llvm::raw_ostream&, llvm::function_ref<llvm::StringRef (llvm::StringRef)>) + 0
10 swift-frontend           0x0000000108537ce8 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 224
11 swift-frontend           0x0000000103607490 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*, llvm::raw_pwrite_stream*) + 3992
12 swift-frontend           0x0000000103608bec swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, llvm::vfs::OutputBackend&, swift::UnifiedStatsReporter*) + 2364
13 swift-frontend           0x0000000103610e70 (anonymous namespace)::LLVMCodeGenThreads::Thread::run() + 156
14 swift-frontend           0x0000000103610dc8 (anonymous namespace)::LLVMCodeGenThreads::runThread(void*) + 12
15 libsystem_pthread.dylib  0x000000019dee2f94 _pthread_start + 136
16 libsystem_pthread.dylib  0x000000019deddd34 thread_start + 8
Rename failed: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/NSDecimalNumberTransform.swift-094848a0.o.tmp -> /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/NSDecimalNumberTransform.swift.o: No such file or directory
<unknown>:0: error: error closing '/Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/NSDecimalNumberTransform.swift.o' for output: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/NSDecimalNumberTransform.swift-094848a0.o.tmp => /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/NSDecimalNumberTransform.swift.o: No such file or directory
Rename failed: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/HexColorTransform.swift-0a53d513.o.tmp -> /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/HexColorTransform.swift.o: No such file or directory
<unknown>:0: error: error closing '/Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/HexColorTransform.swift.o' for output: /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/HexColorTransform.swift-0a53d513.o.tmp => /Users/current/HandyJSON/.build/arm64-apple-macosx/release/HandyJSON.build/HexColorTransform.swift.o: No such file or directory

Expected behavior

The expected behavior is for the code to compile successfully without any errors.

Environment

swiftc -version
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0

Xcode version: 15.3 (15E5202a)
OS: macos sonoma 14.4 Beta(23E5211a)
Chip: Apple M3 pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrontendArea → compiler: FrontendbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions