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/libpthread.so.0+0x124d0)
 #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/liblldb.so.7svn+0xac9cfc)
 #5 0x00007f2bd1b66b77 lldb_private::Editline::TabCommand(int) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/liblldb.so.7svn+0xac9b77)
 #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/liblldb.so.7svn+0xacc00d)
 #7 0x00007f2bd06e2d33 el_wgets (/usr/lib/libedit.so.0+0x10d33)
 #8 0x00007f2bd06de2d4 el_gets (/usr/lib/libedit.so.0+0xc2d4)
 #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/liblldb.so.7svn+0xacb74d)
#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/liblldb.so.7svn+0xa24347)
#11 0x00007f2bd1ac1554 lldb_private::IOHandlerEditline::Run() (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/liblldb.so.7svn+0xa24554)
#12 0x00007f2bd1aa4d06 lldb_private::Debugger::ExecuteIOHandlers() (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/liblldb.so.7svn+0xa07d06)
#13 0x00007f2bd1aa908d lldb_private::Debugger::IOHandlerThread(void*) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/liblldb.so.7svn+0xa0c08d)
#14 0x00007f2bd1b71544 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) (/home/segabor/.swiftenv/versions/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a/usr/bin/../lib/liblldb.so.7svn+0xad4544)
#15 0x00007f2bd87ffa92 start_thread (/usr/lib/libpthread.so.0+0x7a92)
#16 0x00007f2bd0a4bcd3 __GI___clone (/usr/lib/libc.so.6+0xfacd3)
Segmentation fault (core dumped)

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

G√°bor

That's a bug in lldb or the Swift REPL, I'd file a bug at https://bugs.swift.org

Done https://bugs.swift.org/browse/SR-10584
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.

Terms of Service

Privacy Policy

Cookie Policy