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-9451] Compiler crash SILFunctionTransform "DefiniteInitialization" #51914

Closed
swift-ci opened this issue Dec 9, 2018 · 3 comments
Closed
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 regression swift 5.0

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Dec 9, 2018

Previous ID SR-9451
Radar rdar://problem/46598727
Original Reporter ianpartridge (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

5.0-DEVELOPMENT-SNAPSHOT-2018-12-08-a on macOS

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 5.0Regression, CompilerCrash
Assignee @slavapestov
Priority Medium

md5: 8485bd0b41868d6651edb430c39d3ce3

is duplicated by:

  • SR-9504 Segfault when referencing self in init()

Issue Description:

class C {
var c: C
init() {
self.c = self
}
}

1. While running pass #37 SILFunctionTransform "DefiniteInitialization" on SILFunction "@$s2d91CCACycfc".1. While running pass #37 SILFunctionTransform "DefiniteInitialization" on SILFunction "@$s2d91CCACycfc". for 'init()' (at /Users/ipartrid/src/test/main.swift:7:5)0 swift 0x000000010ccfe4e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 401 swift 0x000000010ccfd765 llvm::sys::RunSignalHandlers() + 852 swift 0x000000010ccfeaf2 SignalHandler(int) + 2583 libsystem_platform.dylib 0x00007fff686bab3d _sigtramp + 294 libsystem_platform.dylib 0x0000000000000004 _sigtramp + 25430806765 swift 0x0000000109c2d170 (anonymous namespace)::LifetimeChecker::getOutAvailability(swift::SILBasicBlock*, (anonymous namespace)::AvailabilitySet&) + 326 swift 0x0000000109c2b21c (anonymous namespace)::LifetimeChecker::getLivenessAtInst(swift::SILInstruction*, unsigned int, unsigned int) + 5887 swift 0x0000000109c29735 (anonymous namespace)::LifetimeChecker::isInitializedAtUse(swift::ownership::DIMemoryUse const&, bool*, bool*, bool*) + 858 swift 0x0000000109c24a41 (anonymous namespace)::LifetimeChecker::doIt() + 63859 swift 0x0000000109c22deb (anonymous namespace)::DefiniteInitialization::run() + 287510 swift 0x0000000109c59ff5 swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) + 192511 swift 0x0000000109c5b1a3 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 129912 swift 0x0000000109c5c2cf swift::SILPassManager::execute() + 60713 swift 0x000000010928522b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 18714 swift 0x0000000109c64d54 swift::runSILDiagnosticPasses(swift::SILModule&) + 13215 swift 0x0000000109134dbc performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1124416 swift 0x000000010913113d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 302117 swift 0x00000001090e2efe main + 68618 libdyld.dylib 0x00007fff684d108d start + 119 libdyld.dylib 0x0000000000000029 start + 2545086365<unknown>:0: error: unable to execute command: Segmentation fault: 11<unknown>:0: error: compile command failed due to signal 11 (use -v to see invocation)

@slavapestov
Copy link
Member

Cute test case! This should be rejected as an escaping use of 'self', and definitely should not crash. (Maybe one day we could also diagnose this as a reference cycle but we're not there yet).

@swift-ci
Copy link
Collaborator Author

Comment by Ian Partridge (JIRA)

Thanks, sorry for the mangled description text - JIRA formatting is incomprehensible to me 😃

@slavapestov
Copy link
Member

#21163

@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 5.0
Projects
None yet
Development

No branches or pull requests

3 participants