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-15148] Merge SwiftModule failed #57474

Closed
swift-ci opened this issue Sep 3, 2021 · 5 comments
Closed

[SR-15148] Merge SwiftModule failed #57474

swift-ci opened this issue Sep 3, 2021 · 5 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 regression swift 5.4

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 3, 2021

Previous ID SR-15148
Radar rdar://problem/82736923
Original Reporter LLy (JIRA User)
Type Bug

Attachment: Download

Environment

macOS Big Sur

Xcode 12.5

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

md5: 7a87abc154faf2348cf12046b307eb70

Issue Description:

sorry for cannot provide project, our project can peaceful running in Xcode 12.4 or 12.3 except 12.5(swift 5.4). Therefore, we guess which is a compiler bug, hope it can be fixed, thx

While evaluating request ASTLoweringRequest(Lowering AST to SIL for module SPIM)

0 swift-frontend 0x0000000114294e85 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37  
1 swift-frontend 0x0000000114293e78 llvm::sys::RunSignalHandlers() + 248  
2 swift-frontend 0x0000000114295446 SignalHandler(int) + 262  
3 libsystem_platform.dylib 0x00007fff20666d7d \_sigtramp + 29  
4 libsystem_platform.dylib 0x0000000000001bbb \_sigtramp + 18446603339972587099  
5 libsystem_c.dylib 0x00007fff20576411 abort + 120

6 swift-frontend 0x0000000110003384 swift::ModuleFileSharedCore::fatal(llvm::Error) + 100  
7 swift-frontend 0x000000010ff88b48 swift::ModuleFile::fatal(llvm::Error) + 2600  
8 swift-frontend 0x000000010ffec824 swift::SILDeserializer::readVTable(llvm::PointerEmbeddedInt\<unsigned int, 31\>) + 2532  
9 swift-frontend 0x00000001100711cb swift::SILDeserializer::getAll(bool) + 107  
10 swift-frontend 0x000000010f951393 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 10899  
11 swift-frontend 0x000000010fa5d50d swift::SimpleRequest\<swift::ASTLoweringRequest, std::\_*1::unique_ptr\<swift::SILModule, std::*\_1::default_delete\<swift::SILModule\> \> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9\>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 205  
12 swift-frontend 0x000000010f9554ac llvm::Expected\<swift::ASTLoweringRequest::OutputType\> swift::Evaluator::getResultUncached\<swift::ASTLoweringRequest\>(swift::ASTLoweringRequest const&) + 780  
13 swift-frontend 0x000000010f951d3f swift::performASTLowering(swift::ModuleDecl\*, swift::Lowering::TypeConverter&, swift::SILOptions const&) + 143  
14 swift-frontend 0x000000010f4b502e swift::performFrontend(llvm::ArrayRef\<char const\*\>, char const\*, void\*, swift::FrontendObserver\*) + 7150  
15 swift-frontend 0x000000010f436e82 main + 1266  
16 libdyld.dylib 0x00007fff2063cf5d start + 1  
/Users/wenht/aug/spicy-aug/.dolphin/dolphin_swift_frontend: line 15: 24917 Abort trap: 6 ${DOLPHIN_HOME}/dolphin ${DOLPHIN_COMPILER} "$@" -debug-prefix-map ${tmp_comp_dir}=.  
Command MergeSwiftModule failed with a nonzero exit code
@typesanitizer
Copy link

@swift-ci create

@xymus
Copy link
Contributor

xymus commented Sep 10, 2021

This kind of failure is usually an issue with the project's Objective-C headers and clang modules. If ChatUserMessageSectionController is defined in Objective-C, please make sure it's part of a single clang module. If the same header is included in SPIM and a different module it may be confusing the compiler as it is seen as having different origins at different compilation steps.

The compiler outputs the following information which tries to explain the compiler confusion. You may want to build the same project with a Swift 5.5 compiler, it should provide more information under that message.

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
could not deserialize type for 'ChatCompatibleSectionController': top-level value not found
Cross-reference to module 'SPIM'
... ChatUserMessageSectionController

As a workaround for merge-module failures, you can always set the Compilation Mode to Whole-Module but this will slow down building in a dev environment.

@swift-ci
Copy link
Collaborator Author

Comment by Alex Lee (JIRA)

@xymus Thanks a lot, this workaround is work for me, and here's some information you may want to know:

  1. ChatUserMessageSectionController is defined in Swift and belongs to SPIM module, which is a pure Swift Class;

2. Project can build success in Xcode 12.5.1 (swiftlang-1205.0.28.2, clang-1205.0.19.57), nothing changed (Compilation Mode is Incremental);

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
@xymus
Copy link
Contributor

xymus commented Mar 31, 2023

We stopped using the merge-module logic to avoid issues like this one in Xcode 14. I believe we can safely close this. Please open a new issue if it somehow still reproduces.

@xymus xymus closed this as completed Mar 31, 2023
@AnthonyLatsis AnthonyLatsis added legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project incremental compilation swift 5.4 regression labels Apr 4, 2023
@AnthonyLatsis
Copy link
Collaborator

We stopped using the merge-module logic

apple/swift-driver#730

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 regression swift 5.4
Projects
None yet
Development

No branches or pull requests

4 participants