Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DeviceASAN] Fix urKernelCreateWithNativeHandle segfault #2506

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AllanZyne
Copy link
Contributor

@AllanZyne AllanZyne commented Dec 24, 2024

LLVM: intel/llvm#16473

Since we can't get nullptr when calling getKernelInfo, I changed the return type of this function to reference.

To make it support "urKernelCreateXXX" APIs automatically, I changed getKernelInfo to getOrCreateKernelInfo, so that we needn't intercept "urKernelCreateXXX" anymore.

Sync those changes to msan.

@AllanZyne AllanZyne requested a review from a team as a code owner December 24, 2024 07:29
@github-actions github-actions bot added the loader Loader related feature/bug label Dec 24, 2024
m_KernelMap.emplace(Kernel,
std::make_shared<KernelInfo>(Kernel, IsInstrumented));
return UR_RESULT_SUCCESS;
std::make_unique<KernelInfo>(Kernel, IsInstrumented));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother using a unique_ptr if there is no ownership change? We can just use raw pointer here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to manually delete them if it's raw pointer. unique_ptr is more convenient here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we can just use the object created by the map. It should be deleted when being erased from then map.

@AllanZyne
Copy link
Contributor Author

@oneapi-src/unified-runtime-maintain, please add to 2025.1

@aarongreig aarongreig added the v0.11.x Include in the v0.11.x release label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
loader Loader related feature/bug v0.11.x Include in the v0.11.x release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants