[Lldb-commits] [PATCH] D65163: Fix occasional hangs of VSCode testcases

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 23 12:06:09 PDT 2019


jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, stella.stamenova, gkistanova.
jankratochvil added a project: LLDB.
Herald added a reviewer: JDevlieghere.
Herald added a subscriber: lldb-commits.

On slower machines the vscode testcases were sometimes hanging:

  1910 ?        Sl     0:00          |   \_ /usr/bin/python /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/test/dotest.py -q --arch=x86_64 -s /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/lldb-test-traces --build-dir /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/lldb-test-build.noindex -S nm -u CXXFLAGS -u CFLAGS --executable /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/./bin/lldb --dsymutil /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/./bin/dsymutil --filecheck /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/./bin/FileCheck -C /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/./bin/clang --env ARCHIVER=/usr/bin/ar --env OBJCOPY=/usr/bin/objcopy --env LLVM_LIBS_DIR=/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/./lib /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint -p TestVSCode_setBreakpoints.py
  2649 ?        Sl     0:00          |       \_ /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/bin/lldb-vscode
  2690 ?        S      0:00          |           \_ /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/bin/lldb-server gdbserver --fd=9 --native-regs --setsid
  2708 ?        t      0:00          |               \_ /home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/build/lldb-test-build.noindex/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.test_functionality/a.out

Here is also a reproducer of the racy bug <https://people.redhat.com/jkratoch/vscode-reproduce.patch>.
I guess `request_continue` was probably originally intended to be synchronous but then it isn't and this code has been leftover there.
I think it is an obvious fix but I have requested a review.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65163

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py


Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -498,13 +498,7 @@
             'arguments': args_dict
         }
         response = self.send_recv(command_dict)
-        recv_packets = []
-        self.recv_condition.acquire()
-        for event in self.recv_packets:
-            if event['event'] != 'stopped':
-                recv_packets.append(event)
-        self.recv_packets = recv_packets
-        self.recv_condition.release()
+        # Caller must still call wait_for_stopped.
         return response
 
     def request_disconnect(self, terminateDebuggee=None):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65163.211345.patch
Type: text/x-patch
Size: 807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190723/8474b52a/attachment.bin>


More information about the lldb-commits mailing list