forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 9
.stack_sizes section output is incorrect #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
JordiChauzi
pushed a commit
that referenced
this issue
Nov 27, 2019
print a diagnostic error if such a node is lowered. Ref #1
JordiChauzi
pushed a commit
that referenced
this issue
Nov 27, 2019
If no installed package is found, fallback to the UPMEM_HOME environment variable. Ref #1
JordiChauzi
pushed a commit
that referenced
this issue
Nov 27, 2019
JordiChauzi
pushed a commit
that referenced
this issue
Nov 27, 2019
In case of a leaf function, we do not move the Stack Pointer. To do so previously, we tricked the MachineFrameInfo by setting the StackSize to 0. This worked, but when emiting the .stack_sizes section, the information was incorrect. Now StackSize in MachineFrameInfo is always correct. We are using the MachineFrameInfo::hasCalls method to check if we need to change the offset when doing stack accesses (in DPUMachineFunctionInfo::getOffsetFromFrameIndex). fix #1
JordiChauzi
pushed a commit
that referenced
this issue
Aug 5, 2020
print a diagnostic error if such a node is lowered. Ref #1
JordiChauzi
pushed a commit
that referenced
this issue
Aug 5, 2020
If no installed package is found, fallback to the UPMEM_HOME environment variable. Ref #1
JordiChauzi
pushed a commit
that referenced
this issue
Aug 5, 2020
JordiChauzi
pushed a commit
that referenced
this issue
Aug 5, 2020
In case of a leaf function, we do not move the Stack Pointer. To do so previously, we tricked the MachineFrameInfo by setting the StackSize to 0. This worked, but when emiting the .stack_sizes section, the information was incorrect. Now StackSize in MachineFrameInfo is always correct. We are using the MachineFrameInfo::hasCalls method to check if we need to change the offset when doing stack accesses (in DPUMachineFunctionInfo::getOffsetFromFrameIndex). fix #1
JordiChauzi
pushed a commit
that referenced
this issue
Dec 4, 2020
print a diagnostic error if such a node is lowered. Ref #1
JordiChauzi
pushed a commit
that referenced
this issue
Dec 4, 2020
If no installed package is found, fallback to the UPMEM_HOME environment variable. Ref #1
JordiChauzi
pushed a commit
that referenced
this issue
Dec 4, 2020
JordiChauzi
pushed a commit
that referenced
this issue
Dec 4, 2020
In case of a leaf function, we do not move the Stack Pointer. To do so previously, we tricked the MachineFrameInfo by setting the StackSize to 0. This worked, but when emiting the .stack_sizes section, the information was incorrect. Now StackSize in MachineFrameInfo is always correct. We are using the MachineFrameInfo::hasCalls method to check if we need to change the offset when doing stack accesses (in DPUMachineFunctionInfo::getOffsetFromFrameIndex). fix #1
wwolff42
added a commit
that referenced
this issue
Mar 8, 2024
A DpuContext, wrapper of backends's `struct dpu_context_t` is constructed for every LLDB Dpu instance. These instances cover a full rank. Currently, a DpuContext instance is partialialy initialize at the first StopThreads call (i.e. when LLDB stop threads for investigation) on which Dpu is currently allocated. When LLDB resume threads with ResumeThreads call, it tries to resume threads from all LLDB::Dpu instance. Though, this does not correspond to the number of requested Dpus. Hence, LLDB manipulates unitialized object. This commit fixes those report from `valgrind`: ``` ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182A1E: lldb_private::dpu::DpuContext::ContextReadyForResumeOrStep() (DpuContext.cpp:153) ==17528== by 0x180C68: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:295) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x180C6F: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:295) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C220: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x489E135: ci_debug_teardown_dpu (ufi_debug.c:443) ==17528== by 0x488B339: dpu_finalize_fault_process_for_dpu (dpu_debug.c:120) ==17528== by 0x182C1C: lldb_private::dpu::DpuContext::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*) (DpuContext.cpp:120) ==17528== by 0x180C9B: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:308) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x489E140: ci_debug_teardown_dpu (ufi_debug.c:443) ==17528== by 0x488B339: dpu_finalize_fault_process_for_dpu (dpu_debug.c:120) ==17528== by 0x182C1C: lldb_private::dpu::DpuContext::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*) (DpuContext.cpp:120) ==17528== by 0x180C9B: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:308) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ```
wwolff42
added a commit
that referenced
this issue
Mar 8, 2024
In internal API, a {bkp, mem, dma}_fault_thread_index are declared as `dpu_thread_t` a.k.a `uint8_t`. In LLDB::Dpu::GetThreadState, shortcut variables are declared as `uint32_t`. This commit synchronize both to fix those report from `valgrind`: ``` ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182126: lldb_private::dpu::Dpu::GetThreadState(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, lldb::StopReason&, bool) (Dpu.cpp:785) ==17528== by 0x18024D: lldb_private::process_dpu::ThreadDpu::GetStopReason(lldb_private::ThreadStopInfo&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (ThreadDpu.cpp:46) ==17528== by 0x1B1E6F: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(unsigned long) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3D10: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReasonForState(lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3E3C: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped(lldb_private::NativeProcessProtocol*) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3F59: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::ProcessStateChanged(lldb_private::NativeProcessProtocol*, lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x15E373: lldb_private::NativeProcessProtocol::SynchronouslyNotifyProcessStateChanged(lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x15E8F9: lldb_private::NativeProcessProtocol::SetState(lldb::StateType, bool) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x17DA15: lldb_private::process_dpu::ProcessDpu::InterfaceTimerCallback() (ProcessDpu.cpp:366) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182126: lldb_private::dpu::Dpu::GetThreadState(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, lldb::StopReason&, bool) (Dpu.cpp:785) ==17528== by 0x18024D: lldb_private::process_dpu::ThreadDpu::GetStopReason(lldb_private::ThreadStopInfo&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (ThreadDpu.cpp:46) ==17528== by 0x1B0599: GetJSONThreadsInfo(lldb_private::NativeProcessProtocol&, bool) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B85C4: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jThreadsInfo(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A6E56: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), void lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::RegisterMemberFunctionHandler<lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS>(StringExtractorGDBRemote::ServerPacketType, lldb_private::process_ gdb_remote::GDBRemoteCommunication::PacketResult (lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::*)(StringExtractorGDBRemote&))::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C220: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1473B2: main (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ```
wwolff42
added a commit
that referenced
this issue
Mar 8, 2024
* dpu: llvm: lldb: DpuContext: fix initialization ordering A DpuContext, wrapper of backends's `struct dpu_context_t` is constructed for every LLDB Dpu instance. These instances cover a full rank. Currently, a DpuContext instance is partialialy initialize at the first StopThreads call (i.e. when LLDB stop threads for investigation) on which Dpu is currently allocated. When LLDB resume threads with ResumeThreads call, it tries to resume threads from all LLDB::Dpu instance. Though, this does not correspond to the number of requested Dpus. Hence, LLDB manipulates unitialized object. This commit fixes those report from `valgrind`: ``` ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182A1E: lldb_private::dpu::DpuContext::ContextReadyForResumeOrStep() (DpuContext.cpp:153) ==17528== by 0x180C68: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:295) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x180C6F: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:295) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C220: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x489E135: ci_debug_teardown_dpu (ufi_debug.c:443) ==17528== by 0x488B339: dpu_finalize_fault_process_for_dpu (dpu_debug.c:120) ==17528== by 0x182C1C: lldb_private::dpu::DpuContext::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*) (DpuContext.cpp:120) ==17528== by 0x180C9B: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:308) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x489E140: ci_debug_teardown_dpu (ufi_debug.c:443) ==17528== by 0x488B339: dpu_finalize_fault_process_for_dpu (dpu_debug.c:120) ==17528== by 0x182C1C: lldb_private::dpu::DpuContext::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*) (DpuContext.cpp:120) ==17528== by 0x180C9B: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:308) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ``` * dpu: llvm: lldb: Dpu: fix type mismatch In internal API, a {bkp, mem, dma}_fault_thread_index are declared as `dpu_thread_t` a.k.a `uint8_t`. In LLDB::Dpu::GetThreadState, shortcut variables are declared as `uint32_t`. This commit synchronize both to fix those report from `valgrind`: ``` ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182126: lldb_private::dpu::Dpu::GetThreadState(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, lldb::StopReason&, bool) (Dpu.cpp:785) ==17528== by 0x18024D: lldb_private::process_dpu::ThreadDpu::GetStopReason(lldb_private::ThreadStopInfo&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (ThreadDpu.cpp:46) ==17528== by 0x1B1E6F: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(unsigned long) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3D10: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReasonForState(lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3E3C: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped(lldb_private::NativeProcessProtocol*) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3F59: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::ProcessStateChanged(lldb_private::NativeProcessProtocol*, lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x15E373: lldb_private::NativeProcessProtocol::SynchronouslyNotifyProcessStateChanged(lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x15E8F9: lldb_private::NativeProcessProtocol::SetState(lldb::StateType, bool) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x17DA15: lldb_private::process_dpu::ProcessDpu::InterfaceTimerCallback() (ProcessDpu.cpp:366) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182126: lldb_private::dpu::Dpu::GetThreadState(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, lldb::StopReason&, bool) (Dpu.cpp:785) ==17528== by 0x18024D: lldb_private::process_dpu::ThreadDpu::GetStopReason(lldb_private::ThreadStopInfo&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (ThreadDpu.cpp:46) ==17528== by 0x1B0599: GetJSONThreadsInfo(lldb_private::NativeProcessProtocol&, bool) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B85C4: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jThreadsInfo(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A6E56: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), void lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::RegisterMemberFunctionHandler<lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS>(StringExtractorGDBRemote::ServerPacketType, lldb_private::process_ gdb_remote::GDBRemoteCommunication::PacketResult (lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::*)(StringExtractorGDBRemote&))::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C220: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1473B2: main (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ``` * dpu: llvm: lldb: fix memory leak The Dpu specifics d'tor wasn't or not well implemented. This commit fix those `valgrind` report: ``` ==17528== 288,802 (96 direct, 288,706 indirect) bytes in 1 blocks are definitely lost in loss record 187 of 187 ==17528== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==17528== by 0x17F451: lldb_private::process_dpu::ProcessDpu::Factory::Launch(lldb_private::ProcessLaunchInfo&, lldb_private::NativeProcessProtocol::NativeDelegate&, lldb_private::MainLoop&) const (ProcessDpu.cpp:103) ==17528== by 0x1AA7B9: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x149271: handle_launch(lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS&, llvm::ArrayRef<llvm::StringRef>) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C19D: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1473B2: main (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ``` or ``` ==32349== 280,107 (96 direct, 280,011 indirect) bytes in 1 blocks are definitely lost in loss record 149 of 149 ==32349== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==32349== by 0x17F72B: lldb_private::process_dpu::ProcessDpu::Factory::Attach(unsigned long, lldb_private::NativeProcessProtocol::NativeDelegate&, lldb_private::MainLoop&) const (ProcessDpu.cpp:202) ==32349== by 0x1AA199: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::AttachToProcess(unsigned long) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==32349== by 0x148FA9: handle_attach_to_pid(lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS&, unsigned long) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==32349== by 0x14906A: handle_attach(lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==32349== by 0x14C65B: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==32349== by 0x1473B2: main (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ```
wwolff42
added a commit
that referenced
this issue
Mar 8, 2024
A DpuContext, wrapper of backends's `struct dpu_context_t` is constructed for every LLDB Dpu instance. These instances cover a full rank. Currently, a DpuContext instance is partialialy initialize at the first StopThreads call (i.e. when LLDB stop threads for investigation) on which Dpu is currently allocated. When LLDB resume threads with ResumeThreads call, it tries to resume threads from all LLDB::Dpu instance. Though, this does not correspond to the number of requested Dpus. Hence, LLDB manipulates unitialized object. This commit fixes those report from `valgrind`: ``` ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182A1E: lldb_private::dpu::DpuContext::ContextReadyForResumeOrStep() (DpuContext.cpp:153) ==17528== by 0x180C68: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:295) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x180C6F: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:295) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C220: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x489E135: ci_debug_teardown_dpu (ufi_debug.c:443) ==17528== by 0x488B339: dpu_finalize_fault_process_for_dpu (dpu_debug.c:120) ==17528== by 0x182C1C: lldb_private::dpu::DpuContext::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*) (DpuContext.cpp:120) ==17528== by 0x180C9B: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:308) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x489E140: ci_debug_teardown_dpu (ufi_debug.c:443) ==17528== by 0x488B339: dpu_finalize_fault_process_for_dpu (dpu_debug.c:120) ==17528== by 0x182C1C: lldb_private::dpu::DpuContext::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*) (DpuContext.cpp:120) ==17528== by 0x180C9B: lldb_private::dpu::Dpu::ResumeThreads(llvm::SmallVector<unsigned int, 8u>*, bool) (Dpu.cpp:308) ==17528== by 0x18069C: lldb_private::dpu::DpuRank::ResumeDpus() (DpuRank.cpp:125) ==17528== by 0x17DDEB: lldb_private::process_dpu::ProcessDpu::Detach() (ProcessDpu.cpp:460) ==17528== by 0x17D339: lldb_private::process_dpu::ProcessDpu::Kill() (ProcessDpu.cpp:512) ==17528== by 0x1A8E70: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_k(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A904D: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers()::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_priv ate::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ```
wwolff42
added a commit
that referenced
this issue
Mar 8, 2024
In internal API, a {bkp, mem, dma}_fault_thread_index are declared as `dpu_thread_t` a.k.a `uint8_t`. In LLDB::Dpu::GetThreadState, shortcut variables are declared as `uint32_t`. This commit synchronize both to fix those report from `valgrind`: ``` ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182126: lldb_private::dpu::Dpu::GetThreadState(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, lldb::StopReason&, bool) (Dpu.cpp:785) ==17528== by 0x18024D: lldb_private::process_dpu::ThreadDpu::GetStopReason(lldb_private::ThreadStopInfo&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (ThreadDpu.cpp:46) ==17528== by 0x1B1E6F: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(unsigned long) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3D10: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReasonForState(lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3E3C: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped(lldb_private::NativeProcessProtocol*) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B3F59: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::ProcessStateChanged(lldb_private::NativeProcessProtocol*, lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x15E373: lldb_private::NativeProcessProtocol::SynchronouslyNotifyProcessStateChanged(lldb::StateType) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x15E8F9: lldb_private::NativeProcessProtocol::SetState(lldb::StateType, bool) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x17DA15: lldb_private::process_dpu::ProcessDpu::InterfaceTimerCallback() (ProcessDpu.cpp:366) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== ==17528== Conditional jump or move depends on uninitialised value(s) ==17528== at 0x182126: lldb_private::dpu::Dpu::GetThreadState(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, lldb::StopReason&, bool) (Dpu.cpp:785) ==17528== by 0x18024D: lldb_private::process_dpu::ThreadDpu::GetStopReason(lldb_private::ThreadStopInfo&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (ThreadDpu.cpp:46) ==17528== by 0x1B0599: GetJSONThreadsInfo(lldb_private::NativeProcessProtocol&, bool) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1B85C4: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jThreadsInfo(StringExtractorGDBRemote&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A6E56: std::_Function_handler<lldb_private::process_gdb_remote::GDBRemoteCommunication::PacketResult (StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&), void lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::RegisterMemberFunctionHandler<lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS>(StringExtractorGDBRemote::ServerPacketType, lldb_private::process_ gdb_remote::GDBRemoteCommunication::PacketResult (lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::*)(StringExtractorGDBRemote&))::{lambda(StringExtractorGDBRemote, lldb_private::Status&, bool&, bool&)#1}>::_M_invoke(std::_Any_data const&, StringExtractorGDBRemote&, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x19839D: lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(lldb_private::Timeout<std::ratio<1l, 1000000l> >, lldb_private::Status&, bool&, bool&) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1A8A74: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::DataAvailableCallback() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1597DE: lldb_private::MainLoop::ProcessReadObject(int) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1598A3: lldb_private::MainLoop::RunImpl::ProcessEvents() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x159CCF: lldb_private::MainLoop::Run() (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x14C220: main_gdbserver(int, char**) (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ==17528== by 0x1473B2: main (in /scratch/wwolff/dpu_tools_rework_testsuite/bin/lldb-server-dpu) ```
yberthier
pushed a commit
that referenced
this issue
Jan 29, 2025
The IR/MIR pseudo probe intrinsics don't get materialized into real machine instructions and therefore they don't incur runtime cost directly. However, they come with indirect cost by blocking certain optimizations. Some of the blocking are intentional (such as blocking code merge) for better counts quality while the others are accidental. This change unblocks perf-critical optimizations that do not affect counts quality. They include: 1. IR InstCombine, sinking load operation to shorten lifetimes. 2. MIR LiveRangeShrink, similar to #1 3. MIR TwoAddressInstructionPass, i.e, opeq transform 4. MIR function argument copy elision 5. IR stack protection. (though not perf-critical but nice to have). Reviewed By: wmi Differential Revision: https://reviews.llvm.org/D95982
yberthier
pushed a commit
that referenced
this issue
Jan 29, 2025
print a diagnostic error if such a node is lowered. Ref #1
yberthier
pushed a commit
that referenced
this issue
Jan 29, 2025
If no installed package is found, fallback to the UPMEM_HOME environment variable. Ref #1
yberthier
pushed a commit
that referenced
this issue
Jan 29, 2025
yberthier
pushed a commit
that referenced
this issue
Jan 29, 2025
In case of a leaf function, we do not move the Stack Pointer. To do so previously, we tricked the MachineFrameInfo by setting the StackSize to 0. This worked, but when emiting the .stack_sizes section, the information was incorrect. Now StackSize in MachineFrameInfo is always correct. We are using the MachineFrameInfo::hasCalls method to check if we need to change the offset when doing stack accesses (in DPUMachineFunctionInfo::getOffsetFromFrameIndex). fix #1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the clang option
-fstack-size-section
, the section.stack_sizes
is added in the object file.The contents of this section are a list of tuples, composed of an IRAM offset (pointer size, 4 bytes for us) and a size (encoded as an unsigned LEB128).
In the case of a DPU program, the offsets seem OK, but the sizes are 0 for the leaf functions.
The text was updated successfully, but these errors were encountered: