Skip to content

Commit be88bcc

Browse files
rbramand-xilinxrbramand
and
rbramand
authored
Fix seg fault when xrt::device is created in a loop in pcie hw_emu flow (#8832) (#8835)
Signed-off-by: rbramand <[email protected]> Co-authored-by: rbramand <[email protected]> (cherry picked from commit e2cdce8)
1 parent 482e76c commit be88bcc

File tree

1 file changed

+4
-1
lines changed
  • src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim

1 file changed

+4
-1
lines changed

src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim/shim.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,10 @@ namespace xclhwemhal2 {
26752675
// Shim object creation doesn't follow xclOpen/xclClose.
26762676
// The core device must correspond to open and close, so
26772677
// create here rather than in constructor
2678-
mCoreDevice = xrt_core::hwemu::get_userpf_device(this, mDeviceIndex);
2678+
// Also create it only for the first time as in further
2679+
// iterations device is cached and returned
2680+
if (!mCoreDevice)
2681+
mCoreDevice = xrt_core::hwemu::get_userpf_device(this, mDeviceIndex);
26792682

26802683
device_handles::add(this);
26812684
}

0 commit comments

Comments
 (0)