-
Notifications
You must be signed in to change notification settings - Fork 135
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
Memory leaks in libOpenCL.so.1!khrIcdVendorAdd #157
Comments
Thanks for reporting the issue.
Adding termination to the loader nonetheless may present a risk that user application (less likely) or libraries (more likely) would break, especially those that rely on I think this topic needs to be addressed, but needs careful discussion/consideration. It should be noted that race conditions in shared libraries loading/unloading is not a subject I am particularly confident discussing, so everything I say here should be taken with a grain of salt. note: ocl-icd is behaving similarly. note: the layer infrastructure may be able to help here: we could add a no-op stub/layer once we enter de-initialization (and either always return SUCCESS or a dedicated error code?). This should prevent segfaults inside the loader. I think CUDA has a similar mechanism. |
Any updates on this issue? |
Is there any update on fixing this issue? Thanks! |
How can we fix this issue? |
fixes: KhronosGroup#157 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
Created PR with fix: #217 |
One item we briefly discussed in last week's teleconference: We recently added the ability to have "loader extensions" (see the ICD loader info PR #188). Could we add a similar "loader extension" that allows an application to safely and explicitly de-initialize the ICD loader on the application's schedule, rather than de-initializing the ICD loader implicitly when the ICD loader is unloaded? This isn't a perfect solution because it requires an explicit call to "clean up", but it avoids some of the unloading race condition concerns described above. |
We meet the same issue on Windows. Load the library, call |
Any update for this issue? Thanks! |
Intel Inspector detects memory leaks for two allocations in khrIcdVendorAdd():
Looking at the code in icd.c is seems that vendor structure is initialized and added into
khrIcdVendors
global list, but there is no explicit deinitialization function that would free those elements. Probably one of the options to fix that issue would be to add a function with_attribute_((destructor))
on Linux orDllMain()
handler on Windows to handle library unload event and deallocate those blocks.The text was updated successfully, but these errors were encountered: