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

Missing input prompt, "(lldb)" on Linux, lldb version 178 #15009

Closed
llvmbot opened this issue Dec 18, 2012 · 13 comments
Closed

Missing input prompt, "(lldb)" on Linux, lldb version 178 #15009

llvmbot opened this issue Dec 18, 2012 · 13 comments
Labels
bugzilla Issues migrated from bugzilla lldb

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 18, 2012

Bugzilla Link 14637
Resolution FIXED
Resolved on Nov 04, 2020 11:27
Version unspecified
OS Linux
Attachments A compressed copy of my config.log
Reporter LLVM Bugzilla Contributor
CC @emaste,@labath

Extended Description

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 20, 2013

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...

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 26, 2013

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.outmain(argc=1, argv=0x00007fff16c44ec8) + 32 at main.cpp:57, stop reason = breakpoint 1.1 frame #​0: 0x00000000004007d0 a.outmain(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.outmain(argc=1, argv=0x00007fff16c44ec8) + 32 at main.cpp:57, stop reason = breakpoint 1.1 frame #​0: 0x00000000004007d0 a.outmain(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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented May 14, 2013

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 blahmain [inlined] printf(__fmt=0x00000000004ac793) at stdio2.h:105, stop reason = breakpoint 1.1 frame #​0: 0x0000000000438444 blahmain [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 blahmain [inlined] printf(__fmt=0x00000000004ac793) at stdio2.h:105, stop reason = breakpoint 1.1 frame #​0: 0x0000000000438444 blahmain [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)

@llvmbot
Copy link
Collaborator Author

llvmbot commented May 14, 2013

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented May 14, 2013

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 :)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 17, 2013

This still happens to me all the time (ubuntu 13.04 x64), from head.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 17, 2013

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 25, 2013

Fixed (hopefully for good) with r191392. The fix does not require an update libedit.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 11, 2013

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?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 11, 2013

yeah, I guess so....

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 14, 2013

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!

@labath
Copy link
Collaborator

labath commented Sep 21, 2015

Prompt handling was fixed a couple months back.

@emaste
Copy link
Member

emaste commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#17228

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla lldb
Projects
None yet
Development

No branches or pull requests

3 participants