[Bug 40112] New: LLDB crashes (SEGV) by pressing ↑ in the first entry in print

Bug ID 40112
Summary LLDB crashes (SEGV) by pressing ↑ in the first entry in print
Product lldb
Version unspecified
Hardware PC
OS Linux
Status NEW
Severity enhancement
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter e.kawaschima+llvm@gmail.com
CC llvm-bugs@lists.llvm.org

Steps to Reproduce

%  lldb-7 -v
lldb version 7.0.1

% lldb-7 a.out  # do not have to exist
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) print
Enter expressions, then terminate with an empty line to evaluate:
  1: 

Pressing an arrow key (←, ↓ and →) is OK, but ↑ crashes lldb

(lldb) print
Enter expressions, then terminate with an empty line to evaluate:
/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7f21ebefc12f]
/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x22)[0x7f21ebefa632]
/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1(+0x9c6442)[0x7f21ebefc442]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0)[0x7f21eb32a0c0]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x5474a7)[0x7f21e995d4a7]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x547606)[0x7f21e995d606]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x547d90)[0x7f21e995dd90]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x54b709)[0x7f21e9961709]
/usr/lib/x86_64-linux-gnu/libedit.so.2(el_wgets+0x1a7)[0x7f21e83a96b7]
/usr/lib/x86_64-linux-gnu/libedit.so.2(el_gets+0x13)[0x7f21e83a4da3]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x54b2ad)[0x7f21e99612ad]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x4b9114)[0x7f21e98cf114]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x49cff6)[0x7f21e98b2ff6]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(+0x569941)[0x7f21e997f941]
/usr/lib/x86_64-linux-gnu/liblldb-7.so.1(_ZN4lldb10SBDebugger21RunCommandInterpreterEbb+0x34)[0x7f21e9768224]
lldb-7[0x40704c]
lldb-7[0x407667]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f21e87fa2e1]
lldb-7[0x403c9a]
Stack dump:
0.      Program arguments: lldb-7 a.out 
zsh: segmentation fault  lldb-7 a.out

If ↑ is pressed in the second or later entry, the problem does not happen.

clang and lldb are installed by apt (apt.llvm.org).
lldb-6.0 and lldb-8 have the same problem (they cannot coexist due to conflict
of dependencies).

George Rimar changed bug 40112

What Removed Added
Resolution FIXED
Status NEW RESOLVED

Comment # 3 on bug 40112 from George Rimar

r351313