Skip to content

[UR][ASAN] Possible nullptr dereference #18333

@AlexeySachkov

Description

@AlexeySachkov

auto PI = getProgramInfo(Program);
bool IsInstrumented = PI->isKernelInstrumented(Kernel);

In the snippet above PI is a shared_ptr which could be nullptr:

std::shared_ptr<ProgramInfo> getProgramInfo(ur_program_handle_t Program) {
std::shared_lock<ur_shared_mutex> Guard(m_ProgramMapMutex);
if (m_ProgramMap.find(Program) != m_ProgramMap.end()) {
return m_ProgramMap[Program];
}
return nullptr;
}

Perhaps we don't ever expect it to be nullptr and there is no issue, but in that case we should add an assert statement to asan_interceptor.cpp to indicate that.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions