[llvm-bugs] [Bug 32149] New: Interrupting inferior during a getline causes the stream to fail

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 6 06:39:57 PST 2017


http://bugs.llvm.org/show_bug.cgi?id=32149

            Bug ID: 32149
           Summary: Interrupting inferior during a getline causes the
                    stream to fail
           Product: lldb
           Version: 4.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: malaperle at gmail.com
                CC: llvm-bugs at lists.llvm.org

- macOS 10.12.3
- LLDB from trunk or lldb-360.1.70 (Xcode 8.2.1)

1. Create an executable with this code:

#include <iostream>
#include <string>

int main() {
        while (std::cin.good()) {
                std::string Line;
                std::getline(std::cin, Line);
        }
        return 0;
}

2. Start debugging it with LLDB (lldb a.out)
3. "run"
4. Once it starts running, interrupt it (Ctrl-C)
5. Once it's stopped, do "continue"

Process terminates!

If I look at the error state bits of the stream, the fail and eof bits are set.

This bug is particularly an issue for me as I am trying to debug clangd (part
of clang-tools-extra) which spends much of its time waiting for input on stdin.
If I try to attach to it, it interrupt it then when I resume, it terminates.

Interestingly, on Linux with LLDB 3.8, this problem doesn't occur.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170306/259efc48/attachment.html>


More information about the llvm-bugs mailing list