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

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

[SR-15148] Merge SwiftModule failed #57474

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

Comments

@swift-ci
Copy link
Collaborator

@swift-ci 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

stack:

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

@typesanitizer typesanitizer commented Sep 3, 2021

@swift-ci create

@xymus
Copy link
Contributor

@xymus 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

@swift-ci swift-ci commented Sep 13, 2021

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
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

3 participants