Actually terminate (clean up) the Microsoft UIA Abstraction remote operations library on NVDA exit.#16222
Merged
Conversation
…erations librry on NVDA exit.
ed1dab2 to
0258db7
Compare
Contributor
|
@michaelDCurran please modify the issue number being fixed (twice) in the initial description. #16072 and not #16074. |
Member
Author
|
@CyrilleB79 oops, thanks. I've fixed this up now. |
seanbudd
previously approved these changes
Feb 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #16072
Summary of the issue:
As seen in a dump file provided by @irrah68 when debugging #16072 , NVDA can hang on exit while trying to destruct an instance of the CUIAutomation8 COMClass object:
Details
win32u.dll!_NtUserMsgWaitForMultipleObjectsEx@20() Unknown user32.dll!MsgWaitForMultipleObjectsEx() Unknown combase.dll!CCliModalLoop::BlockFn(void * * ahEvent, unsigned long cEvents, unsigned long * lpdwSignaled) Line 2116 C++ combase.dll!ClassicSTAThreadWaitForHandles(unsigned long dwFlags, unsigned long dwTimeout, unsigned long cHandles, void * * pHandles, unsigned long * pdwIndex) Line 54 C++ combase.dll!CoWaitForMultipleHandles(unsigned long dwFlags, unsigned long dwTimeout, unsigned long cHandles, void * * pHandles, unsigned long * lpdwindex) Line 126 C++ combase.dll!CGIPTable::_RevokeInterfaceFromGlobal(unsigned long dwCookie, bool bPostedRevoke, bool waitIfBusy) Line 1010 C++ combase.dll!CGIPTable::RevokeInterfaceFromGlobal(unsigned long dwCookie) Line 935 C++ uiautomationcore.dll!ViewManagerEventTracker::Uninitialize(void) Unknown uiautomationcore.dll!ClientEventManager::~ClientEventManager(void) Unknown uiautomationcore.dll!CUIAutomation::~CUIAutomation(void) Unknown uiautomationcore.dll!ATL::CComObject::`scalar deleting destructor'(unsigned int) Unknown uiautomationcore.dll!ATL::CComObject::Release(void) Unknown [Inline Frame] UIARemote.dll!wil::com_ptr_t::{dtor}() Line 260 C++ [Inline Frame] UIARemote.dll!wil::object_without_destructor_on_shutdown>::{dtor}() Line 2209 C++ UIARemote.dll!UiaOperationAbstraction::`anonymous namespace'::`dynamic atexit destructor for 'g_automation''() C++ ucrtbase.dll!(void)() Unknown ucrtbase.dll!__crt_seh_guarded_call::operator()<,(void) &,(void)>() Unknown ucrtbase.dll!__execute_onexit_table() Unknown UIARemote.dll!__scrt_dllmain_uninitialize_c() Line 398 C++ UIARemote.dll!dllmain_crt_process_detach(const bool is_terminating) Line 182 C++Description of user facing changes
NVDA is less likely to hang on NvDA exit.
Description of development approach
cleanupfunction toUIARemote.dllwhich calls the UIA abstraction remote operations library'scleanupfunction. This function frees all remote contexts, but most importantly, releases the CUIAutomation8 COMClass object which was passed in on initialization.terminatefunction toUIAHandler/remote.pywhich calls UIARemote.dll'scleanupfunction.UIAHandler.remtoe.terminate, ensuring that the UIA abstraction remote ops library is correctly cleaned up in the UIA MTA thread, where it was originally initialized.Testing strategy:
cleanupmethod.Known issues with pull request:
None known.
Code Review Checklist: