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-11245] Abort trap 6 while merging swiftmodule #53646

Closed
swift-ci opened this issue Aug 1, 2019 · 9 comments
Closed

[SR-11245] Abort trap 6 while merging swiftmodule #53646

swift-ci opened this issue Aug 1, 2019 · 9 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software incremental compilation legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project non-optimized only Flag: An issue whose reproduction requires non-optimized compilation regression swift 5.1

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Aug 1, 2019

Previous ID SR-11245
Radar rdar://problem/53817884
Original Reporter alexg (JIRA User)
Type Bug
Environment

Version 11.0 beta 5 (11M382q), Swift 5 or 4.2 - it doesn't matter.

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 5.1Regression, Serialization
Assignee None
Priority Medium

md5: 454c924775eb9eeabd4b7f1de4018b17

Issue Description:

When trying to build project with Debug configuration where SWIFT_COMPILATION_MODE is set to Incremental, the target fails to build.

Meanwhile when using whole module compilation mode target successfully builds. When using xcode 10.3 everything builds fine as well.

2. While running pass #​0 SILModuleTransform "SerializeSILPass".
3. While serializing declaration 0x119d892b8 (in module 'OneTwoTrip')
4. failed to serialize anything
0  swift                    0x0000000110cdd0e3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x0000000110cdc8b6 SignalHandler(int) + 358
2  libsystem_platform.dylib 0x00007fff6e92fb5d _sigtramp + 29
3  swift                    0x00000001116d4000 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU32BitRegs + 117520
4  libsystem_c.dylib        0x00007fff6e7ef6a6 abort + 127
5  swift                    0x000000010d5c1493 swift::serialization::Serializer::writeDecl(swift::Decl const*) + 68371
6  swift                    0x000000010d5d7aff swift::serialization::Serializer::writeAllDeclsAndTypes() + 62287
7  swift                    0x000000010d5e4a94 swift::serialization::Serializer::writeAST(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, bool) + 5364
8  swift                    0x000000010d5f19c0 swift::serialization::Serializer::writeToStream(llvm::raw_ostream&, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SILModule const*, swift::SerializationOptions const&) + 6000
9  swift                    0x000000010d5f329b 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                    0x000000010c904949 swift::withOutputFile(swift::DiagnosticEngine&, llvm::StringRef, llvm::function_ref<bool (llvm::raw_pwrite_stream&)>) + 2569
11 swift                    0x000000010d5f30f7 swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*) + 311
12 swift                    0x000000010c94017b 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                    0x000000010d0e6e51 SerializeSILPass::run() + 49
14 swift                    0x000000010cfdd4e9 swift::SILPassManager::execute() + 7305
15 swift                    0x000000010cc3a52b swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 1563
16 swift                    0x000000010c936395 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 33925
17 swift                    0x000000010c92a704 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
18 swift                    0x000000010c8b7f93 main + 1219
19 libdyld.dylib            0x00007fff6e74a3d5 start + 1
20 libdyld.dylib            0x0000000000000c11 start + 2441832509
error: Abort trap: 6 (in target 'OneTwoTrip' from project 'OneTwoTrip')

There are a lot of files in the project, so I don't know how to reproduce it. Do you have any ideas of potential issues? Probably there is an issue with nested types.

@belkadan
Copy link
Contributor

belkadan commented Aug 1, 2019

Looks like the project didn't get attached. I'm sorry you're hitting this but I'm glad there's a reproducer for this issue!

@belkadan
Copy link
Contributor

belkadan commented Aug 1, 2019

@swift-ci create

@swift-ci
Copy link
Collaborator Author

swift-ci commented Aug 2, 2019

Comment by Alexander Guschin (JIRA)

Sorry, I forgot to delete the word attached. Initially I thought I will be able to reproduce it, but then I spent a lot of time and failed: there are a lot of swift files and I don't know which one is causing the issue. The error message is too ambiguous

@belkadan
Copy link
Contributor

belkadan commented Aug 2, 2019

Hm, that's going to be tricky, then. You can at least see which file is causing it by adding the build setting SWIFT_ENABLE_BATCH_MODE=NO.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Aug 2, 2019

Comment by Alexander Guschin (JIRA)

Sadly it doesn't help, I'm getting the same error.

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

xymus commented Mar 31, 2023

We stopped using the merge-module logic in Xcode 14 to avoid this kind of issues. Closing as this code should not be executed anymore.

@AnthonyLatsis
Copy link
Collaborator

@xymus Do you know where the fix landed? Was it the swift-driver or Xcode’s build system?

@AnthonyLatsis AnthonyLatsis added legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project non-optimized only Flag: An issue whose reproduction requires non-optimized compilation incremental compilation compiler crash crash Bug: A crash, i.e., an abnormal termination of software and removed serialization Area → compiler: Serialization & deserialization labels Apr 3, 2023
@xymus
Copy link
Contributor

xymus commented Apr 3, 2023

@AnthonyLatsis We stopped using merge-module when the driver switch to using emit-module-separately as the default incremental build mode: apple/swift-driver#730

@AnthonyLatsis
Copy link
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software incremental compilation legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project non-optimized only Flag: An issue whose reproduction requires non-optimized compilation regression swift 5.1
Projects
None yet
Development

No branches or pull requests

4 participants