SWDEV-377782 - Fix segmentation fault for hipLaunchKernel
- If fat binary doesn't contain code object for current gfx then inside FatBinaryInfo::ExtractFatBinary(), valid FatBinaryDeviceInfo address isn't stored in vector fatbin_dev_info_
- This raises segmentation fault during hipLaunchKernel
Change-Id: I21017338d91edbd5d9cc2d37277f66558198a129
[ROCm/clr commit: 348698ed30]
This commit is contained in:
@@ -23,13 +23,15 @@ FatBinaryInfo::FatBinaryInfo(const char* fname, const void* image) : fdesc_(amd:
|
||||
fname_ = std::string();
|
||||
}
|
||||
|
||||
fatbin_dev_info_.resize(g_devices.size());
|
||||
fatbin_dev_info_.resize(g_devices.size(), nullptr);
|
||||
}
|
||||
|
||||
FatBinaryInfo::~FatBinaryInfo() {
|
||||
|
||||
for (auto& fbd: fatbin_dev_info_) {
|
||||
delete fbd;
|
||||
for (auto* fbd: fatbin_dev_info_) {
|
||||
if (fbd != nullptr) {
|
||||
delete fbd;
|
||||
}
|
||||
}
|
||||
|
||||
if (fdesc_ > 0) {
|
||||
@@ -298,6 +300,10 @@ hipError_t FatBinaryInfo::AddDevProgram(const int device_id) {
|
||||
DeviceIdCheck(device_id);
|
||||
|
||||
FatBinaryDeviceInfo* fbd_info = fatbin_dev_info_[device_id];
|
||||
if (fbd_info == nullptr) {
|
||||
return hipErrorInvalidKernelFile;
|
||||
}
|
||||
|
||||
// If fat binary was already added, skip this step and return success
|
||||
if (fbd_info->add_dev_prog_ == false) {
|
||||
amd::Context* ctx = g_devices[device_id]->asContext();
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user