0

The error of commandfailed due to signal: abort trap: 6 has not been solved. The specific error logs are as follows

2.  While running pass #0 SILModuleTransform "SerializeSILPass".
3.  While serializing declaration 0x112201f10 (in module 'gali')
4.  failed to serialize anything
0  swift                    0x00000001087eba13 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x00000001087eb1e6 SignalHandler(int) + 358
2  libsystem_platform.dylib 0x00007fff6d155b1d _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffeeb860ad8 _sigtramp + 2121314264
4  libsystem_c.dylib        0x00007fff6d02ba08 abort + 120
5  swift                    0x00000001050ccdba swift::serialization::Serializer::writeDecl(swift::Decl const*) + 68458
6  swift                    0x00000001050e342f swift::serialization::Serializer::writeAllDeclsAndTypes() + 62287
7  swift                    0x00000001050f03f4 swift::serialization::Serializer::writeAST(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, bool) + 5364
8  swift                    0x00000001050fd330 swift::serialization::Serializer::writeToStream(llvm::raw_ostream&, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SILModule const*, swift::SerializationOptions const&) + 6016
9  swift                    0x00000001050fec0b bool llvm::function_ref<bool (llvm::raw_pwrite_stream&)>::callback_fn<swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*)::$_8>(long, llvm::raw_pwrite_stream&) + 139
10 swift                    0x0000000104405729 swift::withOutputFile(swift::DiagnosticEngine&, llvm::StringRef, llvm::function_ref<bool (llvm::raw_pwrite_stream&)>) + 2569
11 swift                    0x00000001050fea67 swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*) + 311
12 swift                    0x00000001044411bb std::__1::__function::__func<performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*)::$_12, std::__1::allocator<performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*)::$_12>, void ()>::operator()() + 603
13 swift                    0x0000000104be8c61 SerializeSILPass::run() + 49
14 swift                    0x0000000104adf129 swift::SILPassManager::execute() + 7305
15 swift                    0x000000010473bc0b swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 1563
16 swift                    0x0000000104437375 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 33925
17 swift                    0x000000010442b6e4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
18 swift                    0x00000001043b8be3 main + 1219
19 libdyld.dylib            0x00007fff6cf54405 start + 1
lucky_chen
  • 21
  • 1
  • Possible duplicate of [Command failed due to signal: Abort trap: 6](https://stackoverflow.com/questions/30724897/command-failed-due-to-signal-abort-trap-6) – Niki Nov 26 '19 at 03:21
  • I tried your reply, but the problem still exists – lucky_chen Nov 26 '19 at 06:32

2 Answers2

1

I solved the problem, that changing compilation mode from incremental to whole module helps as a workaround, but I would be interested in a real solution too.

enter image description here

koen
  • 5,383
  • 7
  • 50
  • 89
lucky_chen
  • 21
  • 1
1

I would suggest looking for any default parameters passed into functions and ensure they are not other variables - as Swift5 only allows in line values, but dies trying to compile code that still passes variables.

let default = 5
// 'default' can no longer be passed in
func someFunc(_ x:Int = default) -> Int {
}
// can only be a value
func someFunc(_ x:Int = 5) -> Int {
}
Jules Burt
  • 115
  • 2
  • 7