Skip to content

[DNM] workarounds for regression SR-12831 on master/5.3 since Feb 7th #32484

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/IRGen/GenType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,9 @@ TypeConverter::TypeConverter(IRGenModule &IGM)
}

bool error = readLegacyTypeInfo(*fs, path);
if (error)
llvm::report_fatal_error("Cannot read '" + path + "'");
// avoids error: "<unknown>:1:1: Cannot read '/usr/lib/swift/layouts-x86_64.yaml'"
Copy link
Contributor

@CodaFi CodaFi Jun 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper way to "work around" these is to ensure that your resource directory is properly formed. If you have built a custom toolchain, you will need to verify that these layout back-compat files are present under My-Custom-Toolchain.xctoolchain/usr/lib/swift.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also note that these paths are subject to VFS remapping, and are sensitive to the -resource-dir flag.

// if (error)
// llvm::report_fatal_error("Cannot read '" + path + "'");
}

TypeConverter::~TypeConverter() {
Expand Down
9 changes: 8 additions & 1 deletion lib/Serialization/Deserialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5008,7 +5008,14 @@ class TypeDeserializer {
MF.fatal();

const clang::Type *clangFunctionType = nullptr;
if (clangTypeID) {
// avoids: "error: Segmentation fault: 11" (SR-12831)
// during "merge module" containing the following code:
/*
static var onEntry: @convention(c) (_ swizzle: Swizzle, _ returnAddress: UnsafeRawPointer,
_ stackPointer: UnsafeMutablePointer<UInt64>) -> IMP? = {
(swizzle, returnAddress, stackPointer) -> IMP? in
*/
if (clangTypeID && false) {
auto loadedClangType = MF.getClangType(clangTypeID);
if (!loadedClangType)
return loadedClangType.takeError();
Expand Down