SWDEV-558078 - Fix use-after-free in graph tests due to AsyncEventHandler (#1502)

This commit is contained in:
Ioannis Assiouras
2025-10-23 22:49:24 +01:00
zatwierdzone przez GitHub
rodzic 4942f3cae5
commit 602ea0be1e
4 zmienionych plików z 4 dodań i 3 usunięć
@@ -825,7 +825,6 @@ class GraphExec : public amd::ReferenceCountedObject, public Graph {
for (auto streams : parallel_streams_) {
for (auto stream : streams.second) {
if (stream != nullptr) {
stream->finish();
constexpr bool kForceDestroy = true;
hip::Stream::Destroy(stream, kForceDestroy);
}
+1 -1
Wyświetl plik
@@ -1253,7 +1253,7 @@ class ThreadTrace : public amd::HeapObject {
};
//! A device execution environment.
class VirtualDevice : public amd::HeapObject {
class VirtualDevice : public amd::ReferenceCountedObject {
public:
//! Construct a new virtual device for the given physical device.
VirtualDevice(amd::Device& device)
@@ -247,6 +247,7 @@ bool HsaAmdSignalHandler(hsa_signal_value_t value, void* arg) {
}
// Return false, so the callback will not be called again for this signal
gpu->release();
return false;
}
@@ -552,6 +553,7 @@ hsa_signal_t VirtualGPU::HwQueueTracker::ActiveSignal(hsa_signal_value_t init_va
}
}
gpu_.QueuedAsyncHandlers()++;
ts->gpu()->retain();
hsa_status_t result = Hsa::signal_async_handler(
prof_signal->signal_, HSA_SIGNAL_CONDITION_LT, init_value, &HsaAmdSignalHandler, ts);
if (HSA_STATUS_SUCCESS != result) {
@@ -184,7 +184,7 @@ class HostQueue : public CommandQueue {
}
}
void Release() const { delete virtualDevice_; }
void Release() const { virtualDevice_->release(); }
//! Get virtual device for the current thread
device::VirtualDevice* vdev() const { return virtualDevice_; }