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-10260] SIL verification failure while compiling code using swift-5.0-RELEASE-ubuntu18.04 #52660
Comments
cc @slavapestov |
Comment by Ewan Mellor (JIRA) I may have hit the same issue. (Please let me know if you disagree and I'll open a separate ticket.) My code is at https://github.com/ewanmellor/antlr-swift-compiler-bug This is a copy of the ANTLR 4 Swift runtime, and its unit tests. To trigger the bug, run ./test.sh in the root of the repo. It will build the Antlr runtime library (which succeeds) and try to compile the tests, which fails. The error message is the same as OP: "SIL verification failed: method does not appear in the class's vtable: VerifyClassMethodVisitor( operandType.getASTType()->getMetatypeInstanceType() ->getClassOrBoundGenericClass(), member).Seen". I've attached the full log. This fails on Swift 5.0.0 and 5.0.1 on Ubuntu 16.04 Xenial and 18.04 Bionic. It compiles and runs just fine on Swift 5.0.1 from Xcode 10.2.1 on macOS 10.14.4 Mojave. (I'm surprised that there are any platform-specific differences at all at this level, but I'm seeing this both on my own machines and on Travis.) We have had no such problems on Swift 4.2. Swift 5.0.0 was the first time this cropped up. The codebase is slightly different because of the migrations to Swift 5 obviously.) |
Comment by Luiz Fernando Silva (JIRA) @belkadan @slavapestov is there any news on this one? This is really a deal breaker for Linux builds. I'm using the exact same Antlr project that ewanmellor (JIRA User) mentioned, and even my heavily modified version also fails with this error. |
I'd also like to know if there's any news on this. It's been over 3 months since I reported the crash, and aside from adding a label to the issue and assigning it, there seems to have been no movement on it whatsoever. It has completely stopped me from being able to do development work on this project on linux, and it would be helpful to know if it's being worked on, is high/low priority, if there's any way for me to help further (e.g. making an attempt at reducing the test case), or even if you can reproduce it. @belkadan @slavapestov, what do you say? |
I reproduced the bug and reduced a testcase. The crash occurs when you use "super.foo()" to a call a method across a module boundary which the current class does not override. As a workaround, you can perform an ordinary call instead, "foo()". This will fix the crash. However in this case since there's no override, the super.foo() call should behave identically to foo(), so I will prepare a fix. |
In @kasei's case, the method is ISO8601DateFormatter.date(from🙂. The reason this bug occurs on Linux and not on Mac is that on Linux, Foundation is written in Swift and the ISO8601DateFormatter class uses vtable dispatch. The bug is specific to the vtable dispatch implementation. On Mac, Foundation is written in Objective-C and the relevant code path in the compiler is not hit. |
@kasei, Could you verify if the problem is fixed and if so move the JIRA to "Closed"? Thanks! |
@AnnaZaks – Yes, this problem appears to be fixed in the latest swift 5.1 snapshot (July 24) for Ubuntu 18.04. Thanks! |
Attachment: Download
Environment
Ubuntu 18.04
Swift version 5.0 (swift-5.0-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
md5: bb8e2042a30490ec536fae35e4c87aee
Issue Description:
A project I work on[1] is causing SIL verification failures when compiling using the new 5.0 toolchain on ubuntu 18.04 (it previously worked using the swift 4.2.4 toolchain as well as using the Xcode 5.0 toolchain on darwin):
I've attached the full error log which is emitted when running `swift build`.
[1] Project: https://github.com/kasei/kineo-endpoint (master at commit 9846313)
The text was updated successfully, but these errors were encountered: