REPL tab completion attempt crashes on Arch Linux

REPL in recent 5.1 snapshot behaves strangely on my Arch Linux box. When I ask for code completion after variable name, REPL crashes with core dump.

Here's a case

Welcome to Swift version 5.0-dev (LLVM 77814f897e, Swift ea80003b0c).
Type :help for assistance.
  1> let str = "apple"
str: String = "apple"
  2> print(str.
Available completions:
	allSatisfy(predicate: (Character) throws -> Bool(Character) throws -> Bool) -> Bool                                                                                                        
 #0 0x0000555adea34814 (lldb+0x22814)
 #1 0x0000555adea3290c (lldb+0x2090c)
 #2 0x0000555adea34da8 (lldb+0x22da8)
 #3 0x00007f2bd880a4d0 __restore_rt (/usr/lib/
 #4 0x00007f2bd1b66cfc PrintCompletion(_IO_FILE*, unsigned long, unsigned long, lldb_private::StringList&, lldb_private::StringList&) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
 #5 0x00007f2bd1b66b77 lldb_private::Editline::TabCommand(int) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
 #6 0x00007f2bd1b6900d lldb_private::Editline::ConfigureEditor(bool)::$_13::__invoke(editline*, int)(/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
 #7 0x00007f2bd06e2d33 el_wgets (/usr/lib/
 #8 0x00007f2bd06de2d4 el_gets (/usr/lib/
 #9 0x00007f2bd1b6874d lldb_private::Editline::GetLines(int, lldb_private::StringList&, bool&) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
#10 0x00007f2bd1ac1347 lldb_private::IOHandlerEditline::GetLines(lldb_private::StringList&, bool&) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
#11 0x00007f2bd1ac1554 lldb_private::IOHandlerEditline::Run() (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
#12 0x00007f2bd1aa4d06 lldb_private::Debugger::ExecuteIOHandlers() (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
#13 0x00007f2bd1aa908d lldb_private::Debugger::IOHandlerThread(void*) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
#14 0x00007f2bd1b71544 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/
#15 0x00007f2bd87ffa92 start_thread (/usr/lib/
#16 0x00007f2bd0a4bcd3 __GI___clone (/usr/lib/
Segmentation fault (core dumped)

Has anyone met this issue? How can it be fixed?


That's a bug in lldb or the Swift REPL, I'd file a bug at

Done [SR-10584] REPL crashes when triggering code completion with tab · Issue #4569 · apple/llvm-project · GitHub
Unfortunately I can't attach core dump file, JIRA does not allow adding bigger files than 10 MB

1 Like

I made a quick research and it turned out issue does not occur on latest Ubuntu LTS and Swift 5.0.1. Then I went on to limit the scope to libc6 / pthreads. Arch Linux uses a newer (cutting edge?b g]'/ d]'/ ) version, that might be a problem.

My experience with Arch so far that it is prone to have unstable / not well tested packages.

Bug apparently gone in recent 5.1 snapshot so I closed the ticket. Now tab completion works again.