<html>
    <head>
      <base href="http://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Interrupting inferior during a getline causes the stream to fail"
   href="http://bugs.llvm.org/show_bug.cgi?id=32149">32149</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Interrupting inferior during a getline causes the stream to fail
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>malaperle@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>- 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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>