| Issue |
115618
|
| Summary |
[lldb] The test TestCancelAttach.py hangs on Windows host with Linux target
|
| Labels |
lldb
|
| Assignees |
|
| Reporter |
slydiman
|
Issue 1:
TestCancelAttach.py, line 33
The call `self.target.AttachToProcessWithName(lldb.SBListener(), "LLDB-No-Such-Process", True, self.error)` in the AttachThread never return in case of Windows host and Linux target.
Issue 2:
The test failed here
```
if thread.is_alive():
self.fail("The attach thread is alive after timeout interval")
```
but the main thread will still wait for the AttachThread until timeout 10 min.
The issue 1 is most important.
The callstack on local Windows is the following
```
return Status::FromErrorString("attach by name is not supported");
lldb_private::Process::DoAttachToProcessWithName(const char * process_name, const lldb_private::ProcessAttachInfo & attach_info) at \llvm-project\lldb\include\lldb\Target\Process.h(1011)
lldb_private::Process::Attach(lldb_private::ProcessAttachInfo & attach_info) at \llvm-project\lldb\source\Target\Process.cpp(2983)
lldb_private::PlatformWindows::Attach(lldb_private::ProcessAttachInfo & attach_info, lldb_private::Debugger & debugger, lldb_private::Target * target, lldb_private::Status & error) at \llvm-project\lldb\source\Plugins\Platform\Windows\PlatformWindows.cpp(562)
lldb_private::Target::Attach(lldb_private::ProcessAttachInfo & attach_info, lldb_private::Stream * stream) at \llvm-project\lldb\source\Target\Target.cpp(3526)
AttachToProcess(lldb_private::ProcessAttachInfo & attach_info, lldb_private::Target & target) at \llvm-project\lldb\source\API\SBTarget.cpp(94)
lldb::SBTarget::AttachToProcessWithName(lldb::SBListener & listener, const char * name, bool wait_for, lldb::SBError & error) at \llvm-project\lldb\source\API\SBTarget.cpp(519)
_wrap_SBTarget_AttachToProcessWithName(_object * self, _object * args) at \tools\lldb\bindings\python\LLDBWrapPython.cpp(65404)
```
The callstack in case of Windows host and Linux target is the following
```
m_events_condition.wait(lock);
lldb_private::Listener::GetEventInternal(const lldb_private::Timeout<std::ratio<1,1000000>> & timeout, lldb_private::Broadcaster * broadcaster, unsigned int event_type_mask, std::shared_ptr<lldb_private::Event> & event_sp) at \llvm-project\lldb\source\Utility\Listener.cpp(275)
lldb_private::Listener::GetEventForBroadcasterWithType(lldb_private::Broadcaster * broadcaster, unsigned int event_type_mask, std::shared_ptr<lldb_private::Event> & event_sp, const lldb_private::Timeout<std::ratio<1,1000000>> & timeout) at \llvm-project\lldb\source\Utility\Listener.cpp(300)
lldb_private::Process::GetStateChangedEvents(std::shared_ptr<lldb_private::Event> & event_sp, const lldb_private::Timeout<std::ratio<1,1000000>> & timeout, std::shared_ptr<lldb_private::Listener> hijack_listener_sp) at \llvm-project\lldb\source\Target\Process.cpp(980)
lldb_private::Process::WaitForProcessToStop(const lldb_private::Timeout<std::ratio<1,1000000>> & timeout, std::shared_ptr<lldb_private::Event> * event_sp_ptr, bool wait_always, std::shared_ptr<lldb_private::Listener> hijack_listener_sp, lldb_private::Stream * stream, bool use_run_lock, SelectMostRelevant select_most_relevant) at \llvm-project\lldb\source\Target\Process.cpp(690)
lldb_private::Target::Attach(lldb_private::ProcessAttachInfo & attach_info, lldb_private::Stream * stream) at \llvm-project\lldb\source\Target\Target.cpp(3551)
AttachToProcess(lldb_private::ProcessAttachInfo & attach_info, lldb_private::Target & target) at \llvm-project\lldb\source\API\SBTarget.cpp(94)
lldb::SBTarget::AttachToProcessWithName(lldb::SBListener & listener, const char * name, bool wait_for, lldb::SBError & error) at \llvm-project\lldb\source\API\SBTarget.cpp(519)
_wrap_SBTarget_AttachToProcessWithName(_object * self, _object * args) at \tools\lldb\bindings\python\LLDBWrapPython.cpp(65404)
```
Note `process_sp = platform_sp->Attach(attach_info, GetDebugger(), this, error);` at \llvm-project\lldb\source\Target\Target.cpp(3526)
runs gdbserver and puts `vAttachWait` command with `LLDB-No-Such-Process` to the event queue. But this packet never sent to the target. Something is wrong with listeners/broadcasters.
Unfortunately I cannot debug (compare) it on Linux host right now.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs