[lldb-dev] [Bug 33992] New: Deadlock in "thread step-over" after other thread exits

via lldb-dev lldb-dev at lists.llvm.org
Sun Jul 30 06:41:18 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33992

            Bug ID: 33992
           Summary: Deadlock in "thread step-over" after other thread
                    exits
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: tberghammer at google.com
                CC: llvm-bugs at lists.llvm.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170730/e7ef6628/attachment.html>


More information about the lldb-dev mailing list