<html>
    <head>
      <base href="https://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 - Deadlock in "thread step-over" after other thread exits"
   href="https://bugs.llvm.org/show_bug.cgi?id=33992">33992</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Deadlock in "thread step-over" after other thread exits
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>tberghammer@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Compile the following program with "clang++ -std=c++11 t.cpp -g -pthread":
#include <iostream>
#include <thread>

void foo() {
  std::cout << 1 << std::endl;
  std::cout << 2 << std::endl;
}

int main() {
  std::thread t1(foo);
  std::thread t2(foo);

  t2.join();
  t1.join();
}

* Set a breakpoint at foo ("breakpoint set -n foo")
* Start running the application and expect both thread to hit the breakpoint
during the same stop. If it isn't happen (possible) then start the application
again or continue the other threads until we have 2 threads stopped at the
breakpoint.
* Continue 1 of the threads using "thread continue 2" (2 is the thread index)
* The continued thread will exit, but LLDB won't get any new stop reason so it
won't go back to a state where the application considered to be stopped
(working as intended)
* Hit "Ctrl-C" to stop the application. At this point thread 3 expected to be
still at the breakpoint.
* Select thread 3 using "thread select 3"
* Try to execute "thread step-over" what will deadlock/livelock somewhere
inside LLDB and won't return. If we interrupt the thread again with "Ctrl-C" it
seems to be stuck at the same breakpoint even though we asked it to continue.</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>