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

Fix invalid use of dlopen() #2594

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

kbenzie
Copy link
Contributor

@kbenzie kbenzie commented Jan 21, 2025

When attempting to get a handle for the libOpenCL.so library in order to call dlsym() invalid arguments were set so dlopen() always returned null. This just happened to work due to the value of RTLD_DEFAULT being 0 so the dlsym() calls succeeded. This patch removes the invalid dlopen() usage and explicitly uses RTLD_DEFAULT instead of the null handle.

intel/llvm#16736

@kbenzie kbenzie requested a review from a team as a code owner January 21, 2025 14:47
@github-actions github-actions bot added the opencl OpenCL adapter specific issues label Jan 21, 2025
@kbenzie kbenzie force-pushed the benie/cl-core-functions-no-dlopen branch from 72f3ce1 to b9153f9 Compare January 22, 2025 16:14
kbenzie added a commit to kbenzie/intel-llvm that referenced this pull request Jan 22, 2025
When attempting to get a handle for the `libOpenCL.so` library in order
to call `dlsym()` invalid arguments were set so `dlopen()` always
returned null. This just happened to work due to the value of
`RTLD_DEFAULT` being 0 so the `dlsym()` calls succeeded. This patch
removes the invalid `dlopen()` usage and explicitly uses `RTLD_DEFAULT`
instead of the null `handle`.
@kbenzie kbenzie force-pushed the benie/cl-core-functions-no-dlopen branch from b9153f9 to 264d046 Compare January 23, 2025 16:11
kbenzie added a commit to kbenzie/intel-llvm that referenced this pull request Jan 23, 2025
kbenzie added a commit to kbenzie/intel-llvm that referenced this pull request Jan 24, 2025
@kbenzie kbenzie added the ready to merge Added to PR's which are ready to merge label Jan 27, 2025
@kbenzie kbenzie merged commit 3a1b4c7 into oneapi-src:main Jan 28, 2025
26 checks passed
@kbenzie kbenzie deleted the benie/cl-core-functions-no-dlopen branch January 28, 2025 15:17
kbenzie added a commit to kbenzie/intel-llvm that referenced this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opencl OpenCL adapter specific issues ready to merge Added to PR's which are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants