From 46bb10ff2daefef41f982c02c2e8fd2edd8a5b9b Mon Sep 17 00:00:00 2001 From: Emily Deng Date: Thu, 6 Mar 2025 17:05:24 +0800 Subject: [PATCH] kfdtest: Fix DeviceSnapshot return fail error for KFDDBGTest.HitMemoryViolation For the case that the child goes to the second raise(SIGSTOP), and parent sends PTRACE_CONT, than child exits. Parent will assert at DeviceSnapshot, as in kfd_ioctl, couldn't get the mm from child pid. Signed-off-by: Emily Deng [ROCm/ROCR-Runtime commit: 91ef44d3eca0ea3b2c59b07dbdc20b04f34016e2] --- .../rocr-runtime/libhsakmt/tests/kfdtest/src/KFDDBGTest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDDBGTest.cpp b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDDBGTest.cpp index 5639795d54..940f0d8e21 100644 --- a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDDBGTest.cpp +++ b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDDBGTest.cpp @@ -584,9 +584,6 @@ TEST_F(KFDDBGTest, HitMemoryViolation) { ASSERT_NE(deviceId, -1); ASSERT_EQ(queryMask, memViolMask); - // Assume tracee queue has died and halted process - ptrace(PTRACE_CONT, childPid, NULL, NULL); - const std::vector gpuNodes = m_NodeInfo.GetNodesWithGPU(); uint32_t snapshotSize = gpuNodes.size(); struct kfd_dbg_device_info_entry deviceInfo[snapshotSize]; @@ -602,6 +599,8 @@ TEST_F(KFDDBGTest, HitMemoryViolation) { break; } } + // Assume tracee queue has died and halted process + ptrace(PTRACE_CONT, childPid, NULL, NULL); debug->Detach();