[UR] ASan layer fix and test update#17826
Conversation
Two fixes for asan: * The test has been updated to run on all adapters and also skip HIP and OpenCL (which don't support the required VirtualMem functions). * GetShadowMemory has been changed to CreateShadowMemory. Previously, shadow memory had a static lifetime, while the Context that was used to construct it only had a lifetime of the `AsanInterceptor` object. It has been changed and now each `AsanInterceptor` creates its own shadow memory.
|
@intel/dpcpp-sanitizers-review Can I get this looked at when you get the chance? Just some fixes for issues I was having locally with the test. |
|
Please don't change shadow memory related codes, we did this on purpose. |
But the existing code creates a global object that has a different lifetime than the loader. We should, as a general rule, avoid static lifetime on objects because it creates unnecessary complexity when it comes to cleanup and loader reinitialization. Destructor ordering is a very major problem in SYCL, and we need to be careful about not making it worse. Can you explain why the ShadowMemory object needs to have a static lifetime? |
Okay, I understand what you want. @RossBrunton's modification is correct. |
|
@intel/llvm-gatekeepers Please merge. |
Two fixes for asan: * The test has been updated to run on all adapters and also skip HIP and OpenCL (which don't support the required VirtualMem functions). * GetShadowMemory has been changed to CreateShadowMemory. Previously, shadow memory had a static lifetime, while the Context that was used to construct it only had a lifetime of the `AsanInterceptor` object. It has been changed and now each `AsanInterceptor` creates its own shadow memory.
Two fixes for asan:
and OpenCL (which don't support the required VirtualMem functions).
shadow memory had a static lifetime, while the Context that was used
to construct it only had a lifetime of the
AsanInterceptorobject.It has been changed and now each
AsanInterceptorcreates its ownshadow memory.