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-11578] seg fault on tab completion in swift REPL #53983

Open
swift-ci opened this issue Oct 7, 2019 · 7 comments
Open

[SR-11578] seg fault on tab completion in swift REPL #53983

swift-ci opened this issue Oct 7, 2019 · 7 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 REPL

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 7, 2019

Previous ID SR-11578
Radar rdar://problem/56040810
Original Reporter rob_kn (JIRA User)
Type Bug
Environment

macOS 10.14.6

Xcode 11.0

Additional Detail from JIRA
Votes 15
Component/s Compiler
Labels Bug, CompilerCrash, REPL
Assignee None
Priority Medium

md5: 5c80df131b3ef7c46e031bf66e405fde

is duplicated by:

  • SR-12017 Tab completion in repl causes "Segmentation fault: 11"

Issue Description:

If I try tab completion in the REPL in this example:

$ swift
Welcome to Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7).
1> var optionalName: String? = "Foo"
optionalName: String? = "Foo"
2> if let name = optio<tab>

I get the following seg fault error:

lldb 0x000000010b8c2705 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 lldb 0x000000010b8c1d77 llvm::sys::RunSignalHandlers() + 39
2 lldb 0x000000010b8c2d58 SignalHandler(int) + 264
3 libsystem_platform.dylib 0x00007fff78587b5d _sigtramp + 29
4 libsystem_platform.dylib 0x00007fdb6d27c300 _sigtramp + 4107225024
5 LLDB 0x000000010c37b1dd (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 15469
6 LLDB 0x000000010cb597ba swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 458
7 LLDB 0x000000010c39f03e doCodeCompletion(swift::SourceFile&, llvm::StringRef, unsigned int*, swift::CodeCompletionCallbacksFactory*) + 494
8 LLDB 0x000000010c39ede1 swift::REPLCompletions::populate(swift::SourceFile&, llvm::StringRef) + 673
9 LLDB 0x000000010bdde029 lldb_private::SwiftREPL::CompleteCode(std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> > const&, lldb_private::StringList&) + 569
10 LLDB 0x000000010bb8d4a9 lldb_private::REPL::IOHandlerComplete(lldb_private::IOHandler&, char const*, char const*, char const*, int, int, lldb_private::StringList&, lldb_private::StringList&) + 489
11 LLDB 0x000000010bb01157 lldb_private::IOHandlerEditline::AutoCompleteCallback(char const*, char const*, char const*, int, int, lldb_private::StringList&, lldb_private::StringList&, void*) + 55
12 LLDB 0x000000010bba41fe lldb_private::Editline::TabCommand(int) + 110
13 LLDB 0x000000010bba6531 lldb_private::Editline::ConfigureEditor(bool)::$13::_invoke(editline*, int) + 33
14 libedit.3.dylib 0x00007fff75f0774b el_wgets + 478
15 libedit.3.dylib 0x00007fff75f1294b el_gets + 37
16 LLDB 0x000000010bba5d1e lldb_private::Editline::GetLines(int, lldb_private::StringList&, bool&) + 446
17 LLDB 0x000000010bb01b03 lldb_private::IOHandlerEditline::Run() + 115
18 LLDB 0x000000010bae8fdb lldb_private::Debugger::ExecuteIOHandlers() + 123
19 LLDB 0x000000010baeba23 lldb_private::Debugger::IOHandlerThread(void*) + 19
20 LLDB 0x000000010bb962d7 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 103
21 libsystem_pthread.dylib 0x00007fff785902eb _pthread_body + 126
22 libsystem_pthread.dylib 0x00007fff78593249 _pthread_start + 66
23 libsystem_pthread.dylib 0x00007fff7858f40d thread_start + 13
Segmentation fault: 11

@belkadan
Copy link
Contributor

belkadan commented Oct 7, 2019

:-( I know we fixed one of these but I guess we broke another one.

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Julian Rozentur (JIRA)

I see a simpler scenario:

swift
Welcome to Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7).
Type :help for assistance.
1> a <tab>

Segmentation fault: 11

@weissi
Copy link
Member

weissi commented Nov 10, 2019

CC @lhames

@lhames
Copy link
Contributor

lhames commented Nov 15, 2019

This doesn't look like a JIT bug: This is crashing down in code completion, not execution.

@swift-ci
Copy link
Collaborator Author

Comment by Hack Saw (JIRA)

Still true for Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

Not a problem in Swift version 5.1.3 (swift-5.1.3-RELEASE) Target: x86_64-unknown-linux-gnu

@swift-ci
Copy link
Collaborator Author

Comment by Hack Saw (JIRA)

Is this a problem for anyone any more? It works just fine on 5.3.2. I'd vote to close.

@swift-ci
Copy link
Collaborator Author

Comment by Perry Fraser (JIRA)

Hacksaw (JIRA User): Yeah, it's been fine for me—I'd say this is resolved.

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

No branches or pull requests

5 participants