SWDEV-558078 - Fix use-after-free in graph tests due to AsyncEventHandler (#1502)
This commit is contained in:
zatwierdzone przez
GitHub
rodzic
4942f3cae5
commit
602ea0be1e
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user