Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FileLocksmith] Crashes for every folder that is locked by a particular process #32663

Open
PolarGoose opened this issue Apr 29, 2024 · 6 comments
Assignees
Labels
Issue-Bug Something isn't working Product-File Locksmith Refers to the File Locksmith utility Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Medium PowerToys is crashing Status-Reproducible This issue was reproduced by a maintainer

Comments

@PolarGoose
Copy link

Microsoft PowerToys version

0.80.1

Installation method

PowerToys auto-update

Running as admin

No

Area(s) with issue?

File Locksmith

Steps to reproduce

Reproducibility: 100%
Steps:

  1. Select any folder that is locked by a particular process, for example C:\Windows
  2. Click in the context menu Unlock with File Locksmith
  3. The File Locksmith will show up
  4. After about 10 seconds, the application will crash.

The crashdump: https://drive.google.com/file/d/1ThbTw4Hg2CQiLllmdbQvIKaBcH5Zwmv1/view?usp=sharing

✔️ Expected Behavior

No crash happens

❌ Actual Behavior

The application crashes.

Other Software

No response

@PolarGoose PolarGoose added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 29, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@davidegiacometti davidegiacometti added Product-File Locksmith Refers to the File Locksmith utility Severity-Medium PowerToys is crashing labels Apr 30, 2024
@davidegiacometti
Copy link
Collaborator

WinUI stowed exception:

PROCESS_NAME:  PowerToys.FileLocksmithUI.dll

ERROR_CODE: (NTSTATUS) 0xc000027b - An application-internal exception has occurred.

EXCEPTION_CODE_STR:  88000fa8

EXCEPTION_PARAMETER1:  0000021c97ea9290

EXCEPTION_PARAMETER2:  0000000000000034

FAULTING_THREAD:  ffffffff

STACK_TEXT:  
0000021c`80902c70 00007ff9`cb41b972 Microsoft_ui_xaml!CLayoutManager::UpdateLayout+0x29b832
0000021c`80902c78 00007ff9`cb17f785 Microsoft_ui_xaml!CCoreServices::NWDrawTree+0x1f5
0000021c`80902c80 00007ff9`cb179e8d Microsoft_ui_xaml!CCoreServices::NWDrawMainTree+0x14d
0000021c`80902c88 00007ff9`cb179d07 Microsoft_ui_xaml!CWindowRenderTarget::Draw+0x67
0000021c`80902c90 00007ff9`cb179c49 Microsoft_ui_xaml!CXcpBrowserHost::OnTick+0x59
0000021c`80902c98 00007ff9`cb26866a Microsoft_ui_xaml!CXcpDispatcher::Tick+0x8a
0000021c`80902ca0 00007ff9`cb268503 Microsoft_ui_xaml!CXcpDispatcher::OnReentrancyProtectedWindowMessage+0xa3
0000021c`80902ca8 00007ff9`cb267938 Microsoft_ui_xaml!CDeferredInvoke::DispatchQueuedMessage+0xc8
0000021c`80902cb0 00007ff9`cb267819 Microsoft_ui_xaml!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl ABI::Windows::Foundation::ITypedEventHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Microsoft::UI::Dispatching::DispatcherQueueTimer *,ABI::Microsoft::UI::Dispatching::IDispatcherQueueTimer *>,IInspectable *>::*)(ABI::Microsoft::UI::Dispatching::IDispatcherQueueTimer *,IInspectable *)>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,ABI::Windows::Foundation::ITypedEventHandler<ABI::+0x0
0000021c`80902cb8 00007ff9`f08671f7 CoreMessagingXP!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Microsoft::UI::Dispatching::DispatcherQueueTimer * __ptr64,Microsoft::UI::Dispatching::IDispatcherQueueTimer * __ptr64>,IInspectable * __ptr64>::*)(Microsoft::UI::Dispatching::IDispatcherQueueTimer * __ptr64,IInspectable * __ptr64) __ptr64>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,Windows::Foundation::ITypedEv+0x0
0000021c`80902cc0 00007ff9`f086254f CoreMessagingXP!Microsoft::WRL::InvokeTraits<-2>::InvokeDelegates<<lambda_1e854da9c9ccd42f6138c3b007a32877>,Windows::Foundation::ITypedEventHandler<Microsoft::UI::Dispatching::DispatcherQueueTimer * __ptr64,IInspectable * __ptr64> >+0x83
0000021c`80902cc8 00007ff9`f0867693 CoreMessagingXP!Microsoft::UI::Dispatching::DispatcherQueueTimer::TimerCallback+0xf3
0000021c`80902cd0 00007ff9`f08109fd CoreMessagingXP!CFlat::SehSafe::Execute<<lambda_a81ff790741c2a62f2197c2561f5fe49> >+0x21
0000021c`80902cd8 00007ff9`f0814a56 CoreMessagingXP!Microsoft::CoreUI::ActionCallback::ImportAdapter$+0x66
0000021c`80902ce0 00007ff9`f0800d99 CoreMessagingXP!Microsoft::CoreUI::Dispatch::TimeoutManager::Callback_OnDispatch+0x1a9
0000021c`80902ce8 00007ff9`f07ec880 CoreMessagingXP!Microsoft::CoreUI::Dispatch::Dispatcher::Callback_DispatchNextItem+0x1bc
0000021c`80902cf0 00007ff9`f07ec5ed CoreMessagingXP!Microsoft::CoreUI::Dispatch::Dispatcher::Callback_DispatchLoop+0x1b9
0000021c`80902cf8 00007ff9`f07dfd7c CoreMessagingXP!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop+0x164
0000021c`80902d00 00007ff9`f07e2c66 CoreMessagingXP!Microsoft::CoreUI::Dispatch::UserAdapter::DrainCoreMessagingQueue+0x15a
0000021c`80902d08 00007ff9`f07e2fdc CoreMessagingXP!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch+0x98
0000021c`80902d10 00007ff9`f08236a3 CoreMessagingXP!Microsoft::CoreUI::Dispatch::UserAdapter::DoWork+0xa7
0000021c`80902d18 00007ff9`f0823836 CoreMessagingXP!Microsoft::CoreUI::Dispatch::UserAdapter::HandleDispatchNotifyMessage+0x132
0000021c`80902d20 00007ff9`f0823dae CoreMessagingXP!Microsoft::CoreUI::Dispatch::UserAdapter::WindowProc+0x5e
0000021c`80902d28 00007ffa`30e38961 user32!UserCallWinProcCheckWow+0x2d1
0000021c`80902d30 00007ffa`30e3861c user32!DispatchClientMessage+0x9c
0000021c`80902d38 00007ffa`30e43b5d user32!_fnDWORD+0x3d
0000021c`80902d40 00007ffa`32bd33a4 ntdll!KiUserCallbackDispatcherContinue+0x0
0000021c`80902d48 00007ffa`307c1534 win32u!NtUserGetMessage+0x14
0000021c`80902d50 00007ffa`30e45e8a user32!GetMessageW+0x2a
0000021c`80902d58 00007ff9`cb314fb0 Microsoft_ui_xaml!DirectUI::FrameworkApplication::RunDesktopWindowMessageLoop+0x3c
0000021c`80902d60 00007ff9`cb315d3d Microsoft_ui_xaml!DirectUI::FrameworkApplication::StartDesktop+0x1fd
0000021c`80902d68 00007ff9`cb2e0840 Microsoft_ui_xaml!DirectUI::FrameworkApplicationFactory::Start+0x70


FAULTING_SOURCE_LINE:  C:\__w\1\s\dxaml\xcp\core\layout\layoutmanager.cpp

FAULTING_SOURCE_FILE:  C:\__w\1\s\dxaml\xcp\core\layout\layoutmanager.cpp

FAULTING_SOURCE_LINE_NUMBER:  469

FAULTING_SOURCE_SRV_COMMAND:  powershell -command "Invoke-WebRequest 'https://raw.githubusercontent.com/microsoft/microsoft-ui-xaml/3d10001ba8e12336cad392846b1030ba691b784a/dxaml/xcp/core/layout/LayoutManager.cpp' -OutFile '"C:\ProgramData\Dbg\src\TFS_COMMIT\ad6b41f8\dxaml\xcp\core\layout\LayoutManager.cpp"'"

FAULTING_SOURCE_CODE:  
No source found for 'C:\__w\1\s\dxaml\xcp\core\layout\layoutmanager.cpp'


SYMBOL_NAME:  Microsoft_ui_xaml!CLayoutManager::UpdateLayout+29b832

MODULE_NAME: Microsoft_ui_xaml

IMAGE_NAME:  Microsoft.ui.xaml.dll

STACK_COMMAND:  *** Stowed Exception v2 ***; .exr -1; dpp 0x21c97ea9290 L0x10; dt 0x21c80903c90 combase!STOWED_EXCEPTION_INFORMATION_V2 -r; dps 0x21c80902c70 L0x21 ; ** Pseudo Context ** StowedPseudo ** Value: 4 ** ; kb

FAILURE_BUCKET_ID:  STOWED_EXCEPTION_88000fa8_Microsoft.ui.xaml.dll!CLayoutManager::UpdateLayout

@joadoumie
Copy link
Contributor

I can't replicate this on the same version of PT. @davidegiacometti are you hitting the same error?

@davidegiacometti
Copy link
Collaborator

I usually use this utility on single files but I am able to reproduce a crash with a long list of results.
Anyway the generated dump have a different exception.
Repro is:

  • Run the utility on C:\Windows folder
  • Start scrolling from top to bottom
  • While scrolling expand some cards
  • Scroll from bottom to top
  • About 30 seconds of this and always crash for me

@joadoumie joadoumie added this to the PowerToys 0.82 milestone May 6, 2024
@joadoumie joadoumie removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label May 6, 2024
@gokcekantarci gokcekantarci self-assigned this May 13, 2024
@Jay-o-Way Jay-o-Way added the Status-Reproducible This issue was reproduced by a maintainer label May 30, 2024
@drawbyperpetual
Copy link
Collaborator

I can repro simply by opening the top 3 cards, which are system processes with lots of open file handles. The exception thrown is Microsoft.UI.Xaml.LayoutCycleException: "Layout cycle detected. Layout could not complete." As far as I can tell, this is usually a result of an internal WinUI bug. I've tried various fixes including upgrading and downgrading Microsoft.WindowsAppSDK, but none of them helped. But by simply removing the XAML data-template that shows the individual files of each process, the crash no longer seems to occur - or at the very least, I can now open 20-30 cards without crashing. So the bug is very likely related to having many lines of visible text open within a ListView.

@jaimecbernardo suggested showing the individual files within a modal dialog rather than as inline text and I've also run this by @niels9001. This indeed fixes the issue in my testing. I will create a PR for this.

@drawbyperpetual drawbyperpetual added the Status-In progress This issue or work-item is under development label Jul 12, 2024
@PolarGoose
Copy link
Author

@drawbyperpetual,

Fantastic. Thank you for investigating this problem. It is a pity that it cannot be fixed properly.
By the way, I created a similar tool ShowWhatProcessLocksFile before PowerToys existed.
It has the same GUI as the current FileLockSmith, but it uses WPF. It doesn't have any problems displaying long file lists in the ListView.

@jaimecbernardo jaimecbernardo added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-File Locksmith Refers to the File Locksmith utility Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Medium PowerToys is crashing Status-Reproducible This issue was reproduced by a maintainer
Projects
Status: No status
Development

No branches or pull requests

8 participants