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-3774] Generated SIL cannot be parsed by compiler #46359

Open
ahoppen opened this issue Jan 28, 2017 · 3 comments
Open

[SR-3774] Generated SIL cannot be parsed by compiler #46359

ahoppen opened this issue Jan 28, 2017 · 3 comments
Assignees
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 SILGen Area → compiler: The SIL generation stage SILParser Area → compiler: The SIL parser

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jan 28, 2017

Previous ID SR-3774
Radar None
Original Reporter @ahoppen
Type Bug
Environment

swift-DEVELOPMENT-SNAPSHOT-2017-01-27-a

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, SILGen, SILParser
Assignee @gottesmm
Priority Medium

md5: 09864f49eea78aa74102bc513312dc44

Issue Description:

Compiling the attached code to SIL (using the -emit-sil compiler flag), adding the class definition on top of the SIL file (as per SR-3773) and then parsing the SIL file again using -parse-sil crashes the compiler.

class Foo {
  func bar() -> String {
    return ""
  }
}

Stack trace:

Assertion failed: (!getParent()->hasQualifiedOwnership() || Kind != ValueOwnershipKind::Any), function createPHIArgument, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/SIL/SILBasicBlock.cpp, line 172.
0  swift                    0x000000010ea741a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010ea733c6 llvm::sys::RunSignalHandlers() + 86
2  swift                    0x000000010ea747f9 SignalHandler(int) + 361
3  libsystem_platform.dylib 0x00007fffd8029bba _sigtramp + 26
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 670917728
5  libsystem_c.dylib        0x00007fffd7eb0420 abort + 129
6  libsystem_c.dylib        0x00007fffd7e77893 basename_r + 0
7  swift                    0x000000010c46159f swift::SILBasicBlock::createPHIArgument(swift::SILType, swift::ValueOwnershipKind, swift::ValueDecl const*) + 255
8  swift                    0x000000010c66823a swift::Parser::parseDeclSIL() + 5386
9  swift                    0x000000010c62d6dd swift::Parser::parseTopLevel() + 269
10 swift                    0x000000010c65f53f swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 287
11 swift                    0x000000010c42b9dc swift::CompilerInstance::performSema() + 3580
12 swift                    0x000000010ba0fef7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4263
13 swift                    0x000000010b9ceb60 main + 3312
14 libdyld.dylib            0x00007fffd7e1c255 start + 1
15 libdyld.dylib            0x000000000000000e start + 673070522
@ahoppen
Copy link
Contributor Author

ahoppen commented Jan 28, 2017

A even further reduced example produces the same error message:

class Foo {}
let x = Foo()

@jckarter
Copy link
Member

@gottesmm is that expected at this point?

@gottesmm
Copy link
Member

gottesmm commented Apr 7, 2017

Yes. I am probably going to make a few changes to make this less likely to happen. The issue is that he needs the frontend flag -assume-parsing-unqualified-ownership-sil.

@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 SILGen Area → compiler: The SIL generation stage SILParser Area → compiler: The SIL parser
Projects
None yet
Development

No branches or pull requests

4 participants