[Lldb-commits] [lldb] [lldb] Fix unbounded recursion on an empty thread list (PR #227396)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 30 06:09:47 PDT 2026


DavidSpickett wrote:

This test is flakey on our bot, but somehow "fails" without failing locally.

https://lab.llvm.org/buildbot/#/builders/59/builds/38172
```
Traceback (most recent call last):
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 713, in run
    self._receive(data)
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 733, in _receive
    self._handlePacket(packet)
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 826, in _handlePacket
    response = self.responder.respond(packet)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 218, in respond
    response = self._respond_impl(packet)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 233, in _respond_impl
    return self.vCont(packet)
           ^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 386, in vCont
    raise self.UnexpectedPacketException()
lldbsuite.test.gdbclientutils.MockGDBServerResponder.UnexpectedPacketException
FAIL: LLDB (/home/buildbot/workspace/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_thread_list_goes_empty (TestEmptyThreadList.TestEmptyThreadList.test_thread_list_goes_empty)
Log Files:
 - /home/buildbot/workspace/lldb-aarch64-ubuntu/build/lldb-test-build/functionalities/gdb_remote_client/TestEmptyThreadList/Failure_test_thread_list_goes_empty.log
======================================================================
FAIL: test_thread_list_goes_empty (TestEmptyThreadList.TestEmptyThreadList.test_thread_list_goes_empty)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestEmptyThreadList.py", line 58, in test_thread_list_goes_empty
    self.assertState(process.GetState(), lldb.eStateStopped)
  File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 3117, in assertState
    self.fail(self._formatMessage(msg, error))
AssertionError: exited (10) != stopped (5)
Config=aarch64-/home/buildbot/workspace/lldb-aarch64-ubuntu/build/bin/clang
----------------------------------------------------------------------
Ran 1 test in 0.043s

FAILED (failures=1)
```
On the bot it's getting a different state.

Locally, it's something to do with handling vCont:
```
Traceback (most recent call last):
  File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 713, in run
    self._receive(data)
  File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 733, in _receive
    self._handlePacket(packet)
  File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 826, in _handlePacket
    response = self.responder.respond(packet)
  File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 218, in respond
    response = self._respond_impl(packet)
  File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 233, in _respond_impl
    return self.vCont(packet)
  File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/gdbclientutils.py", line 386, in vCont
    raise self.UnexpectedPacketException()
lldbsuite.test.gdbclientutils.MockGDBServerResponder.UnexpectedPacketException
PASS: LLDB (/home/davspi01/build-llvm-aarch64/bin/clang-aarch64) :: test_thread_list_goes_empty (TestEmptyThreadList.TestEmptyThreadList)
----------------------------------------------------------------------
```
But note that it's not actually marked as a failure in this case, and sometimes it passes without any problems.

https://github.com/llvm/llvm-project/pull/227396


More information about the lldb-commits mailing list