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-13186] swift invocation crashes after integrated REPL was removed #55626

dan-zheng opened this issue Jul 9, 2020 · 0 comments

[SR-13186] swift invocation crashes after integrated REPL was removed #55626

dan-zheng opened this issue Jul 9, 2020 · 0 comments


Copy link

@dan-zheng dan-zheng commented Jul 9, 2020

Previous ID SR-13186
Radar None
Original Reporter @dan-zheng
Type Bug
Status In Progress
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee owenvoorhees (JIRA)
Priority Medium

md5: 7acb53830623092543a9390e4addf038

Issue Description:

After the integrated REPL was removed, directly invoking swift (when LLDB is not built) produces a crash:

$ swift
Assertion failed: (!Files.empty() || failedToLoad()), function getFiles, file swift-dev/swift/include/swift/AST/Module.h, line 363.
Stack dump:
0.  Program arguments: swift-dev/build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swift-frontend -frontend -repl -enable-objc-interop -sdk /Applications/ -color-diagnostics -target-sdk-version 10.16 -module-name REPL
1.  Swift version 5.3-dev (LLVM 609d16e6ecd05b0, Swift ed0e6288d1c5b8a)
0  swift-frontend           0x0000000107f3a585 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift-frontend           0x0000000107f39558 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x0000000107f3ab66 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6c1f95fd _sigtramp + 29
4  swift-frontend           0x000000010a8a08e7 cmark_strbuf__initbuf + 180650
5  libsystem_c.dylib        0x00007fff6c0cf808 abort + 120
6  libsystem_c.dylib        0x00007fff6c0ceac6 err + 0
7  swift-frontend           0x0000000107ff3933 swift::CompilerInstance::performParseAndResolveImportsOnly() (.cold.1) + 35
8  swift-frontend           0x0000000103ba1e0b swift::CompilerInstance::performParseAndResolveImportsOnly() + 267
9  swift-frontend           0x0000000103ba1e25 swift::CompilerInstance::performSema() + 21
10 swift-frontend           0x0000000103ab721e performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 2670
11 swift-frontend           0x0000000103ab661c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3388
12 swift-frontend           0x0000000103a51c1d main + 861

It would be less confusing if this instead produced a diagnostic, like swiftc when invoked with no files:

$ swiftc
<unknown>:0: error: no input files

Related forum post:

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant