[VitisAI] fix dangling pointer#27949
Conversation
|
Hi @amd-genmingz Could you please sync this branch with main to make the DML CI check pass? |
There was a problem hiding this comment.
Pull request overview
This PR addresses a use-after-unload risk in the VitisAI EP loader by clearing cached function pointers immediately after unloading the onnxruntime_vitisai_ep dynamic library, preventing later accidental invocations of stale pointers.
Changes:
- Update
OrtVitisAIEpAPI::Clear()to set all resolved function pointers tonullptrafterUnloadDynamicLibrary. - Ensure the deinitialization function pointer is cleared as part of shutdown to avoid double-deinit calling into unloaded code.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
56a5096 to
8da6f4b
Compare
|
Hi @adrianlizarraga This request has been synchronized to main; please re-trigger CI checks. |
|
Hi @adrianlizarraga @a-akoval Can we trigger CI and then proceed with the merge process? |
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
set the pointer to nullptr immediately after
UnloadDynamicLibrary.Motivation and Context
After unload library, set the function pointer to nullptr to avoid a dangling pointer. Otherwise, the following scenario may cause errors:
In this scenario, the OrtVitisAIEpAPI will call
initialize_vitisai_eponce but calldeinitialize_vitisai_eptwice. During deinitialization, functionsdeinitialize_onnxruntime_vitisai_epare invoked, which leads to errors.