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-9242] After upgrading Swift from 4.1 to 4.2, compiler throws error when compiling Vapor 2.4.5 project on Ubuntu 16.04.5 machine #51730

Closed
swift-ci opened this issue Nov 14, 2018 · 6 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 regression swift 4.2

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-9242
Radar rdar://problem/46099022
Original Reporter peggers (JIRA User)
Type Bug
Status Closed
Resolution Cannot Reproduce

Attachment: Download

Environment

Swift 4.2

Ubuntu 16.04.5 hosted on AWS

Vapor 2.4.5

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

md5: 0e3c33fe618421f9c9c49a71ac40a387

Issue Description:

I have a program that I deploy onto Ubuntu (Vapor 2.4.5 based server app). Up to this point it's been compiling under Swift 4.1 without issue.

Today, I applied a few patches to my UAT server (hosted on AWS). I noticed Swift got updated to 4.2. Now the Swift build process fails, with the following message:

> swift: /home/buildnode/jenkins/workspace/oss-swift-4.2-package-linux-ubuntu-16_04/llvm/lib/IR/Instructions.cpp:2565: static llvm::CastInst *llvm::CastInst::Create(Instruction::CastOps, llvm::Value *, llvm::Type *, const llvm::Twine &, llvm::Instruction *): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.

I rolled my server back to its prior state, and no problems the code compiles.

I have attached an extract of the compiler output, where it crashes.

Very happy to help give more information as required.

@belkadan
Copy link
Contributor

If you can't share the entire project, can you at least post the source of the skipWhitespace method it's complaining about?

Can you try compiling with a development snapshot toolchain from https://swift.org/download ? That way we'll know if it's been fixed on the master branch already, and even if it isn't it might have a more useful error message.

@swift-ci
Copy link
Collaborator Author

Comment by Phil Pegden (JIRA)

Hello,

I'm in the final days of release at the moment - so won't have time to try the latest toolchain this week - hopefully next!

In the meantime, it appears that piece of code causing the issue is in a library I'm dependent on:

https://github.com/vapor/leaf/releases/tag/2.0.2

I've attached a file to this Jira with skipWhiteSpace function.

BTW - Am happy to share the whole project? Do you want me to ZIP it and attach it?

Kind regards, Phil

@belkadan
Copy link
Contributor

Ah, if it's the Leaf package that's failing, that might be good enough, as long as you're not compiling with any custom options. Thanks!

@swift-ci
Copy link
Collaborator Author

Comment by Phil Pegden (JIRA)

I do use the command:

vapor build --release

Rather than Swift version...

@eeckstein
Copy link
Member

Is this still reproducible with a recent 5.0 snapshot?

@swift-ci
Copy link
Collaborator Author

Comment by Phil Pegden (JIRA)

Hmmm - have tried but found that a few open source components I use are only using swift 3. Thus I'm a bit stuck, as the more recent versions only support Vapor 3, which I have to upgrade to.

So I think this should be closed now - as I have no easy way of testing.

Thank you for your help though.

Phil

@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
This issue was closed.
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 regression swift 4.2
Projects
None yet
Development

No branches or pull requests

4 participants