LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 14637 - Missing input prompt, "(lldb)" on Linux, lldb version 178
Summary: Missing input prompt, "(lldb)" on Linux, lldb version 178
Status: RESOLVED FIXED
Alias: None
Product: lldb
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: LLDB commit list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-18 15:25 PST by Sid Manning
Modified: 2020-11-04 11:27 PST (History)
7 users (show)

See Also:
Fixed By Commit(s):


Attachments
A compressed copy of my config.log (17.91 KB, application/x-gzip)
2012-12-18 15:25 PST, Sid Manning
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sid Manning 2012-12-18 15:25:19 PST
Created attachment 9725 [details]
A compressed copy of my config.log

llvm version: 170455
clang/lldb version: 170444

Compiled using gcc-4.7 on a Ubuntu 10.4 system.

This is a sample of my output, I issued 3 commands, "version", "version" and "apropos prompt":

(lldb) versionLLDB-178
LLDB-178
The following commands may relate to 'prompt':
breakpoint command add -- Add a set of commands to a breakpoint, to be executed
                          whenever the breakpoint is hit.
watchpoint command add -- Add a set of commands to a watchpoint, to be executed
                          whenever the watchpoint is hit.

The following settings variables may relate to 'prompt': 

auto-confirm -- If true all confirmation prompts will receive their default reply.
prompt -- The debugger command line prompt displayed for the user.


I've attached a gzip'd copy of my config.log in case that would help.
Comment 1 Daniel Malea 2013-02-20 15:25:52 PST
This bug seems to be causing some cases of TestCompletion to fail consistently when GCC is the test compiler... at least on the buildbot:

http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/2360/steps/test/logs/stdio


To anyone that's really annoyed by this bug, you can work-around it by issuing a Ctrl-C to in the LLDB utility (when the inferior is stopped) to get the prompt to show up again...
Comment 2 Matt Kopec 2013-02-25 17:59:55 PST
Although I wasn't able to reproduce this issue with the same commands as Sid, I was able to reproduce it like so:

Current executable set to 'a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 32 at main.cpp:57, address = 0x00000000004007d0
(lldb) r
Process 5288 launched: '/home/mkopec1/dev/llvm/tools/lldb/test/functionalities/abbreviation/a.out' (x86_64)
Process 5288 stopped
* thread #1: tid = 0x14a8, 0x00000000004007d0 a.out`main(argc=1, argv=0x00007fff16c44ec8) + 32 at main.cpp:57, stop reason = breakpoint 1.1
    frame #0: 0x00000000004007d0 a.out`main(argc=1, argv=0x00007fff16c44ec8) + 32 at main.cpp:57
   54  	
   55  	    int array[3];
   56  	
-> 57  	    array[0] = foo (1238, 78392);
   58  	    array[1] = foo (379265, 23674);
   59  	    array[2] = foo (872934, 234);
   60  	
t 1
* thread #1: tid = 0x14a8, 0x00000000004007d0 a.out`main(argc=1, argv=0x00007fff16c44ec8) + 32 at main.cpp:57, stop reason = breakpoint 1.1
    frame #0: 0x00000000004007d0 a.out`main(argc=1, argv=0x00007fff16c44ec8) + 32 at main.cpp:57
   54  	
   55  	    int array[3];
   56  	
-> 57  	    array[0] = foo (1238, 78392);
   58  	    array[1] = foo (379265, 23674);
   59  	    array[2] = foo (872934, 234);
   60  	


I traced this down to the NetBSD editline library (libedit). My system default has libedit 2.11 and upgrading to libedit 3.0 seems to resolve the problem of the missing lldb prompt. The lldb binary links against this library. Additionally, my mac system las libedit 3.0 by default and the problem doesn't reproduce there.
Comment 3 Michael Sartain 2013-05-13 20:56:57 PDT
I am not able to repro this using Sid's or Matt's repro steps. I'm on Ubuntu x64 12.04.2, and lldb is loading libedit.so.2.11 (2.11-20080614). I'm testing under Unity with gnome-terminal.

Matt: You're just doing a "b main", "r", "t 1", yes? What distro and window manager are you using?

If needed, can we pull a later version of Linux libedit into the lldb source tree and build using that static library? Arch uses this upstream version I believe: http://www.thrysoee.dk/editline/ ( found from https://www.archlinux.org/packages/core/i686/libedit/ )

Thanks!

----
mikesart@mikesart-rad:~/data/src/blah/build$ ~/data/src/llvm/build/bin/lldb --debug -f ./blah
Current executable set to './blah' (x86_64).
(lldb) b main
Breakpoint 1: where = blah`main + 4 [inlined] printf at blah.cpp:42, address = 0x0000000000438444
(lldb) r
Process 9378 launched: './blah' (x86_64)
Process 9378 stopped
* thread #1: tid = 0x24a2, 0x0000000000438444 blah`main [inlined] printf(__fmt=0x00000000004ac793) at stdio2.h:105, stop reason = breakpoint 1.1
    frame #0: 0x0000000000438444 blah`main [inlined] printf(__fmt=0x00000000004ac793) at stdio2.h:105
   102  __extern_always_inline int
   103  printf (__const char *__restrict __fmt, ...)
   104  {
-> 105    return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
   106  }
   107  # elif !defined __cplusplus
   108  #  define printf(...) \
(lldb) t 1
* thread #1: tid = 0x24a2, 0x0000000000438444 blah`main [inlined] printf(__fmt=0x00000000004ac793) at stdio2.h:105, stop reason = breakpoint 1.1
    frame #0: 0x0000000000438444 blah`main [inlined] printf(__fmt=0x00000000004ac793) at stdio2.h:105
   102  __extern_always_inline int
   103  printf (__const char *__restrict __fmt, ...)
   104  {
-> 105    return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
   106  }
   107  # elif !defined __cplusplus
   108  #  define printf(...) \
(lldb) version
lldb version 3.4 (http://llvm.org/svn/llvm-project/lldb/trunk revision 181741)
(lldb)
Comment 4 Matt Kopec 2013-05-14 16:16:00 PDT
I tried to repro this today using the same steps I wrote previously but was unable to. I'm running Ubuntu 12.10 64-bit, libedit 2.11-20080614-5, Unity and GNOME Terminal 3.6.0.

Coincidentally, there was a commit today, r181807, that may have fixed the issues that I was seeing in the past. I'm checking with the author to see if he is still seeing Linux prompt issues.
Comment 5 Daniel Malea 2013-05-14 16:23:23 PDT
Unable to repro locally either, with the same versions as Matt.

I removed the @expectedFail decorator on the tests affected by this bug. Will watch the buildbots to see if anything is still broken...and close this bug accordingly if nothing breaks.

Here's hoping this pesky issue has been fixed :)
Comment 6 Richard Mitton 2013-09-17 15:13:27 PDT
This still happens to me all the time (ubuntu 13.04 x64), from head.
Comment 7 Daniel Malea 2013-09-17 16:47:21 PDT
Indeed, this is still a problem with older libedit versions. TestStopHookMultipleThreads fails on the GCC buildbot because of this bug.

Our friend Sylvestre has updated the Ubuntu package of libedit, but it has not made it into 13.04 yet:

https://launchpad.net/ubuntu/+source/libedit


If all goes well, Ubuntu 13.10 should have the updated version and we will no longer run into this problem.
Comment 8 Richard Mitton 2013-09-25 13:48:39 PDT
Fixed (hopefully for good) with r191392. The fix does not require an update libedit.
Comment 9 Tim Jones 2013-10-11 04:36:59 PDT
Hi, this is still happening for me on Fedora 19 with trunk (r192427) as of today.

I'm using: libedit-devel-3.0-10.20121213cvs.fc19.x86_64

I can reproduce by just setting a breakpoint in main and running, the backtrace is shown for the thread, and no prompt is re-printed.

Should this bug be re-opened?
Comment 10 Richard Mitton 2013-10-11 13:53:20 PDT
<sigh> yeah, I guess so....
Comment 11 Tim Jones 2013-10-14 06:39:59 PDT
I've just noticed that the prompt is printed after all ... but, this is being done before the process has stopped, eg.:

$ lldb -- $(pwd)/test.gnu
Current executable set to '.../test.gnu' (x86_64).
(lldb) run
Process 15521 launched: '.../test.gnu' (x86_64)
(lldb) n = 1
n = 2
n = 3
n = 4
n = 5
Process 15521 exited with status = 0 (0x00000000) 
quit
$

As you can see from the above, the prompt is being printed straight after the 'Process X launches: ...' line where it should wait until the target's stopped (where the 'quit' command's been entered above).

Hope this helps!
Comment 12 labath 2015-09-21 11:07:51 PDT
Prompt handling was fixed a couple months back.