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-8076] Compiler crash with: Found return instr that returns non-void in Function of void return type! #50609

Closed
swift-ci opened this issue Jun 22, 2018 · 3 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

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8076
Radar rdar://problem/41369680
Original Reporter pierremb (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Apple Swift version 4.2 (swiftlang-1000.0.16.9 clang-1000.10.25.3)
Target: x86_64-apple-darwin17.6.0

Xcode 10.0 beta 2 (10L177m)

macOS High Sierra 10.13.5 (17F77)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee shajrawi (JIRA)
Priority Medium

md5: f2f64000a3fca231c7eae2c6e1973bcc

Issue Description:

$> swift Handler.swift
Found return instr that returns non-void in Function of void return type!
  ret { i64, i64 } %147, !dbg !216
 void<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken function found, compilation aborted!
0  swift                    0x000000010898fa9a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010898eea6 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff69718f5a _sigtramp + 26
3  libsystem_platform.dylib 0x00007ffeeb009b10 _sigtramp + 2173635536
4  libsystem_c.dylib        0x00007fff694b61ae abort + 127
5  swift                    0x0000000104c778e9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 521
6  swift                    0x0000000108942d48 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
7  swift                    0x0000000108942c2b llvm::report_fatal_error(char const*, bool) + 43
8  swift                    0x000000010890ab56 (anonymous namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&) + 54
9  swift                    0x00000001088b231e llvm::FPPassManager::runOnFunction(llvm::Function&) + 446
10 swift                    0x00000001088ba653 llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 115
11 swift                    0x00000001088ba54c llvm::legacy::FunctionPassManager::run(llvm::Function&) + 396
12 swift                    0x0000000104e32e18 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 5208
13 swift                    0x0000000104e37fe4 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int) + 2516
14 swift                    0x0000000104e349a7 swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::GlobalVariable**) + 727
15 swift                    0x0000000104c83baf performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 47871
16 swift                    0x0000000104c74bbf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7839
17 swift                    0x0000000104c1e768 main + 13144
18 libdyld.dylib            0x00007fff6940a015 start + 1
19 libdyld.dylib            0x000000000000000a start + 2529124342
Stack dump:
0.  Program arguments: /Applications/Xcode10.0-beta2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret Handler.swift -enable-objc-interop -sdk /Applications/Xcode10.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -color-diagnostics -module-name Handler 
1.  Running pass 'Module Verifier' on function '@"$S7Handler05QueryA0PAAE11forceHandle5query8ReturnedQyd___SbAA6ChangeVcSgtqd___tKAA0B0Rd__lF"'
zsh: abort      swift Handler.swift
@belkadan
Copy link
Contributor

With asserts:

Assertion failed: (loweredTy->getNumResults() == 1 && "Expected a single result"), function rewriteFunctionReturn, file /Volumes/Data/swift-public/swift/lib/IRGen/LoadableByAddress.cpp, line 2212.

1.  While running pass #&#8203;29 SILModuleTransform "LoadableByAddress".

@swift-ci create

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 23, 2019

Looks like this has been addressed by #17545
pierremb (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"?

Thanks!
Anna

@swift-ci
Copy link
Collaborator Author

Comment by Pierre MB (JIRA)

it works.

Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin18.7.0

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

No branches or pull requests

3 participants