GetAppLocalTempDirectory leaks a RoInitialize call
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- operating-systems
Research direction
Start in lib/utils/utils.cpp at Microsoft::Applications::Events::GetAppLocalTempDirectory and inspect the RoInitialize call and its surrounding control flow. Read the linked RoInitialize guidance, then verify that successful initialization is properly balanced and that Application Verifier no longer reports AVRF_STOP_THREADPOOL_DIRTY_COM_STATE.
Written by the indexing model from the issue text.
Description
In Microsoft::Applications::Events::GetAppLocalTempDirectory (lib/utils/utils.cpp), we have this block of code:
auto hr = RoInitialize(RO_INIT_MULTITHREADED) /* Ignoring result from call toRoInitialize as either initialzation is successful, or else already * initialized and it should be ok to proceed in both the scenarios */ UNREFERENCED_PARAMETER(hr);
If you call RoInitialize without a matching call to RoUninitialize, you leak the com initialization on this thread. See the guidance at https://learn.microsoft.com/en-us/windows/win32/api/roapi/nf-roapi-roinitialize:
Each successful call to RoInitialize, including those that return S_FALSE, must be balanced by a corresponding call to RoUninitialize.
This is caught by Application Verifier as AVRF_STOP_THREADPOOL_DIRTY_COM_STATE.
- Dominant language
- C
- Stars
- 102
- Forks
- 66
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/cpp_client_telemetry
-
C API enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/cpp_client_telemetry#1504 ·
-
bug
microsoft/cpp_client_telemetry#1437 · 1 assignee ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/cpp_client_telemetry#1413 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/cpp_client_telemetry#1391 ·
All issues in microsoft/cpp_client_telemetry
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·