[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-11 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

I assume something else changed in the meantime (maybe the extra locking added 
in #134759?) but now if I revert this change I always crash on `run`:

```
* thread #51, name = '', stop reason = 
EXC_BAD_ACCESS (code=1, address=0xfffed77f38f8)
frame #0: 0x00011332b66c 
liblldb.21.0.0git.dylib`lldb_private::DynamicRegisterInfo::IsReconfigurable(this=0xfffed77f383f)
 at DynamicRegisterInfo.cpp:682:55 [opt]
frame #1: 0x0001136046a8 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ThreadGDBRemote::ThreadGDBRemote(this=0x000121704098,
 process=0x00012880b400, tid=) at ThreadGDBRemote.cpp:48:40 
[opt]
frame #2: 0x0001135ec940 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(lldb_private::ThreadList&,
 lldb_private::ThreadList&) [inlined] void 
std::__1::allocator::construct[abi:nn190102](this=, __p=0x000121704098, __args=0x00012880b400, 
__args=) at allocator.h:165:24 [opt]
frame #3: 0x0001135ec930 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(lldb_private::ThreadList&,
 lldb_private::ThreadList&) [inlined] void 
std::__1::allocator_traits>::construct[abi:nn190102](__a=, __p=0x000121704098, __args=0x00012880b400, 
__args=) at allocator_traits.h:319:9 [opt]
  * frame #4: 0x0001135ec930 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(lldb_private::ThreadList&,
 lldb_private::ThreadList&) [inlined] 
std::__1::__shared_ptr_emplace>::__shared_ptr_emplace[abi:nn190102], 
0>(this=0x000121704080, __a=, __args=0x00012880b400, 
__args=) at shared_ptr.h:266:5 [opt]
frame #5: 0x0001135ec918 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(lldb_private::ThreadList&,
 lldb_private::ThreadList&) [inlined] 
std::__1::__shared_ptr_emplace>::__shared_ptr_emplace[abi:nn190102], 
0>(this=0x000121704080, __a=, __args=0x00012880b400, 
__args=) at shared_ptr.h:263:115 [opt]
frame #6: 0x0001135ec918 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(lldb_private::ThreadList&,
 lldb_private::ThreadList&) [inlined] 
std::__1::shared_ptr 
std::__1::allocate_shared[abi:nn190102], 
lldb_private::process_gdb_remote::ProcessGDBRemote&, unsigned long long&, 
0>(__a=, __args=0x00012880b400, __args=) at 
shared_ptr.h:845:51 [opt]
frame #7: 0x0001135ec90c 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(lldb_private::ThreadList&,
 lldb_private::ThreadList&) [inlined] 
std::__1::shared_ptr 
std::__1::make_shared[abi:nn190102](__args=0x00012880b400, __args=) at shared_ptr.h:853:10 [opt]
frame #8: 0x0001135ec90c 
liblldb.21.0.0git.dylib`lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(this=0x00012880b400,
 old_thread_list=, new_thread_list=0x00017d1cac28) at 
ProcessGDBRemote.cpp:1589:21 [opt]
frame #9: 0x000113349880 
liblldb.21.0.0git.dylib`lldb_private::Process::UpdateThreadListIfNeeded() 
[inlined] lldb_private::Process::UpdateThreadList(this=0x00012880b400, 
old_thread_list=, new_thread_list=0x00017d1cac28) at 
Process.cpp:1124:10 [opt]
frame #10: 0x000113349874 
liblldb.21.0.0git.dylib`lldb_private::Process::UpdateThreadListIfNeeded(this=0x00012880b400)
 at Process.cpp:1145:11 [opt]
frame #11: 0x0001133b4410 
liblldb.21.0.0git.dylib`lldb_private::ThreadList::SetShouldReportStop(this=0x00012880b750,
 vote=eVoteNo) at ThreadList.cpp:413:13 [opt]
frame #12: 0x000113350190 
liblldb.21.0.0git.dylib`lldb_private::Process::AttachCompletionHandler::PerformAction(this=0x60404330,
 event_sp=) at Process.cpp:2907:32 [opt]
frame #13: 0x00011334e858 
liblldb.21.0.0git.dylib`lldb_private::Process::HandlePrivateEvent(this=0x00012880b400,
 event_sp=std::__1::shared_ptr::element_type @ 
0x638ac900 strong=2 weak=2) at Process.cpp:3941:33 [opt]
```

https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-11 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

I put up a revert in #135408. I'm going to see if I can reproduce this myself 
on Linux. I want to see what happens if the statusline uses the public API 
mutex, I don't think it needs the private one at all. If I can't reproduce I 
might ask one of you to try out a small patch.

https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-11 Thread Pavel Labath via lldb-commits

labath wrote:

I can see this too, and can reproduce it pretty much 100% of the time. The 
`GetRunLock` hypothesis seems believable because the process launching code 
(Process::LaunchPrivate) is mucking around with the private state thread.

It's also possible this doesn't reproduce on darwin because it goes through a 
different launching code path (basically it never launches, only attaches).

I think we'll need to revert this for now, as it makes it more or less 
impossible to have a normal debug session (things actually work if you type 
"continue" after this error, but there's no indication that that is an option).

https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-10 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

Thanks for the report, @cmtice. I haven't seen this issue and I'm pretty 
baffled. I wonder if it has something to do with the implementation of 
GetRunLock:

```
ProcessRunLock &Process::GetRunLock() {
  if (m_private_state_thread.EqualsThread(Host::GetCurrentThread()))
return m_private_run_lock;
  else
return m_public_run_lock;
}
```

I presume that somehow we end up in situation where one is locked and the other 
is not. I'll try to do some investigating. 

https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-08 Thread via lldb-commits

https://github.com/jimingham approved this pull request.

LGTM too

https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Make sure the process is stopped when computing the symbol context (PR #134757)

2025-04-08 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan approved this pull request.


https://github.com/llvm/llvm-project/pull/134757
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits