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-5919] Assertion failed: (!destType->isMaterializable() || destType->isVoid()), function emitSimpleAssignment in SILGenExpr.cpp #48478

Closed
weissi opened this issue Sep 18, 2017 · 2 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 SILGen Area → compiler: The SIL generation stage

Comments

@weissi
Copy link
Member

weissi commented Sep 18, 2017

Previous ID SR-5919
Radar None
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment
Apple Swift version 4.1-dev (LLVM f06eb26858, Clang 65adc04c91, Swift 8c65f6e785)
Target: x86_64-apple-darwin17.0.0
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee None
Priority Medium

md5: 07ec0681aea843b9e6dee5688c06dae8

Issue Description:

All the swifts I have at least between 3.1 and a recent snapshot from master crash on this

func foo() -> ((), ()) {
    return ((), ())
}
((), ()) = foo()

with

$ /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-09-12-a.xctoolchain/usr/bin/swiftc test.swift 
Assertion failed: (!destType->isMaterializable() || destType->isVoid()), function emitSimpleAssignment, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/SILGen/SILGenExpr.cpp, line 4101.
0  swift                    0x0000000104f80af8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000104f7fa46 llvm::sys::RunSignalHandlers() + 86
2  swift                    0x0000000104f810be SignalHandler(int) + 366
3  libsystem_platform.dylib 0x00007fff5c7f0f5a _sigtramp + 26
4  libsystem_platform.dylib 0x00007fc95fd00000 _sigtramp + 55636160
5  libsystem_c.dylib        0x00007fff5c61c32a abort + 127
6  libsystem_c.dylib        0x00007fff5c5e4380 basename_r + 0
7  swift                    0x00000001022d7393 emitSimpleAssignment(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Expr*, swift::Expr*) + 1619
8  swift                    0x00000001022c8594 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 7124
9  swift                    0x00000001022c26e4 swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 516
10 swift                    0x000000010225de16 swift::Lowering::SILGenModule::visitTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 374
11 swift                    0x000000010225e63b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 875
12 swift                    0x000000010225f5c0 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool) + 960
13 swift                    0x000000010225fba4 swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&, llvm::Optional<unsigned int>) + 100
14 swift                    0x0000000101bd9fe6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 9862
15 swift                    0x0000000101bd6a5a swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3530
16 swift                    0x0000000101b97a20 main + 3360
17 libdyld.dylib            0x00007fff5c570145 start + 1
18 libdyld.dylib            0x000000000000000d start + 2745761481
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-09-12-a.xctoolchain/usr/bin/swift -frontend -c -primary-file test.swift -target x86_64-apple-darwin17.0.0 -enable-objc-interop -color-diagnostics -module-name test -o /var/folders/k8/7d0p_dxx2ll8vnw5mt5__ddc0000gn/T/test-91faf9.o 
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)
@belkadan
Copy link
Contributor

Looks like a bad assertion – a tuple where all elements are Void is also Void-y enough, and probably an enum with only one case. @jckarter, @slavapestov, is this easy enough to be a starter bug?

@slavapestov
Copy link
Member

The assertion was wrong. #21342

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

No branches or pull requests

4 participants