microsoft / microsoft/usersim

CXPlat must initialize all sub-components prior to enabling fault injection

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
105
Forks
34
Avg merge
3d 39m
Merged PRs (30d)
5

Description

        [2]              : "cxplat_fault_injection_inject_fault + 67 D:\a\ebpf-for-windows\ebpf-for-windows\external\usersim\cxplat\src\cxplat_winuser\fault_injection.cpp 408" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
        [3]              : "cxplat_allocate + 111 D:\a\ebpf-for-windows\ebpf-for-windows\external\usersim\cxplat\src\cxplat_winuser\memory_winuser.cpp 89" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
        [4]              : "_get_processor_group_info + 174 D:\a\ebpf-for-windows\ebpf-for-windows\external\usersim\cxplat\src\cxplat_winuser\processor_winuser.cpp 29" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
        [5]              : "cxplat_winuser_initialize_processor_info + 94 D:\a\ebpf-for-windows\ebpf-for-windows\external\usersim\cxplat\src\cxplat_winuser\processor_winuser.cpp 48" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
        [6]              : "cxplat_initialize + 598 D:\a\ebpf-for-windows\ebpf-for-windows\external\usersim\cxplat\src\cxplat_winuser\cxplat_winuser.cpp 162" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
        [7]              : "usersim_platform_initiate + 68 D:\a\ebpf-for-windows\ebpf-for-windows\external\usersim\src\platform_user.cpp 56" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]

The above stack shows how #143 caused a regression. The cxplat_winuser_initialize_processor_info itself is getting fault-injected and cxplat is failing to initialize. It goes to cxplat cleaup path - where it is trying to wait on the rundown_ref object which is not intialized and hence throws an exception.

01 VCRUNTIME140D!_CxxThrowException
02 usersim!_rundown_ref_table::wait_for_rundown_ref
03 usersim!cxplat_wait_for_rundown_protection_release
04 usersim!cxplat_wait_for_preemptible_work_items_complete
05 usersim!usersim_platform_terminate
06 usersim!usersim_platform_initiate
07 usersim!DllMain

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at cxplat_winuser.cpp in cxplat_initialize and trace the initialization and cleanup paths through processor_winuser.cpp, fault_injection.cpp, and usersim_platform_terminate. Reproduce the fault-injected processor initialization path and verify cleanup does not wait on an uninitialized rundown_ref; completion should cover the regression described in the stack traces.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.