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-13087] SIL Verification failure with @objc protocol on Windows #55533

Open
lxbndr opened this issue Jun 26, 2020 · 1 comment
Open

[SR-13087] SIL Verification failure with @objc protocol on Windows #55533

lxbndr opened this issue Jun 26, 2020 · 1 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 Windows Platform: Windows

Comments

@lxbndr
Copy link
Contributor

lxbndr commented Jun 26, 2020

Previous ID SR-13087
Radar None
Original Reporter @lxbndr
Type Bug

Attachment: Download

Environment

Swift version 5.3-dev (LLVM f9957f0, Swift c825d79)

Target: x86_64-unknown-windows-msvc

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

md5: 9a90a66e23da50b11bbba74112db8aa3

Issue Description:

Our codebase historically has a lot of @objc things. Build for Windows fails on several cases related to this modifier.

This code crashes compler:

import Foundation

@objc
protocol BadGuy {
    func mhwahaha()
}

public class DrEvil: BadGuy {
    public func mhwahaha() {
    }
}

func evilLaughter() {
    let baddy: BadGuy = DrEvil()
    baddy.mhwahaha()
}

Partial stack trace (full output attached):

0.      Program arguments: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe -frontend -c -primary-file ProtocolIssue.swift -target x86_64-unknown-windows-msvc -disable-objc-interop -color-diagnostics -I C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift -I C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\windows\x86_64 -Fsystem C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\System\Library\Frameworks -resource-dir C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift -autolink-library oldnames -autolink-library msvcrt -Xcc -D_MT -Xcc -D_DLL -module-name ProtocolIssue -o C:\Users\Mersenne\AppData\Local\Temp\ProtocolIssue-95606d.o
1.      compnerd.org Swift version 5.3-dev (LLVM f9957f081870012, Swift c825d7987eba360)
2.      While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "ProtocolIssue.swift")
3.      While silgen emitFunction SIL function "@$s13ProtocolIssue12evilLaughteryyF".
 for 'evilLaughter()' (at ProtocolIssue.swift:13:1)
4.      While verifying SIL function "@$s13ProtocolIssue12evilLaughteryyF".
 for 'evilLaughter()' (at ProtocolIssue.swift:13:1)
 #​0 0x00007ff7602529e5 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x40529e5)
 #​1 0x00007ffc71f9cb7d (C:\WINDOWS\System32\ucrtbase.dll+0x6cb7d)
 #​2 0x00007ffc71f9db81 (C:\WINDOWS\System32\ucrtbase.dll+0x6db81)
 #​3 0x00007ff75cd23f37 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb23f37)
 #​4 0x00007ff75cd39da0 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb39da0)
 #​5 0x00007ff75cd467ee (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb467ee)
 #​6 0x00007ff75cd4af75 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb4af75)
 #​7 0x00007ff75cd4b2ac (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb4b2ac)
 #​8 0x00007ff75cd4b5da (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb4b5da)
 #​9 0x00007ff75cd3ee06 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0xb3ee06)
@lxbndr
Copy link
Contributor Author

lxbndr commented Jun 26, 2020

I have no access to recent Swift build for Linux, but Online Swift Playground is based on Swift 5.1 Linux build, and it fails to compile this too. Looks like the issue is pretty old.

@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
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 Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

2 participants