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

PowerToys Run crashes upon entering a character #17710

Closed
1 task
armak opened this issue Apr 12, 2022 · 10 comments
Closed
1 task

PowerToys Run crashes upon entering a character #17710

armak opened this issue Apr 12, 2022 · 10 comments
Labels
Issue-Bug Something isn't working Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Priority-2 Bug that is medium priority Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT) Status-No recent activity no activity in the past 5 days when follow up's are needed

Comments

@armak
Copy link

armak commented Apr 12, 2022

Microsoft PowerToys version

"0.57.2"

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

  1. Trigger the PowerToys Run prompt
  2. Enter any single character

✔️ Expected Behavior

I expect to be able to enter the next character.

❌ Actual Behavior

PowerToys Run freezes ("stops responding") immediately.

I should note though that this seems to not strictly be tied to character entry, but something in the query handling system locking up under specific conditions. For an example, if I copy the text "GitHub" onto my clipboard and paste it into PowerToys Run, that does not trigger this behavior, and I can freely continue entering text in it. However, if I start erasing characters, once I get down to just to the prompt just containing "Git", PowerToys Run freezes. Similarly, if I copy paste the string "Microsoft" into the prompt, it just freezes immediately.

If I disable the "Program" plugin for PowerToys Run, then I'm able to enter any three characters until it freezes upon entering the third.

This behavior also doesn't occur immediately. After restarting my PC, it takes hours, or possibly days for this behavior to start occurring, and cannot be avoided until the system is once again restarted. I also use PowerToys Run in the same configuration on two other PCs, on which I haven't been able to replicate the issue.

PowerToysReport_2022-04-13-01-14-42.zip

Event viewer "Error" example:

The program PowerToys.PowerLauncher.exe version 0.57.2.0 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance control panel.
 Process ID: 48b4
 Start Time: 01d84eba4f9eca91
 Termination Time: 7
 Application Path: C:\Program Files\PowerToys\modules\launcher\PowerToys.PowerLauncher.exe
 Report Id: 8b508f04-8728-4751-aa7b-1d579b379de4
 Faulting package full name: 
 Faulting package-relative application ID: 
 Hang type: Unknown

Here's also two dump files I managed to create earlier (they seem to only spawn very sporadically, and not consistently when this crash occurs).
PowerToys.PowerLauncher.exe.44648.zip
PowerToys.PowerLauncher.exe(1).44648.zip

Other Software

No response

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

armak commented Apr 12, 2022

This issue is also in reference to earlier #17132

@jaimecbernardo
Copy link
Collaborator

Thanks for opening this issue.
So, it looks like there's an error loading an image, and then there's a sort of stack recursion trying to open many exception windows. Like the opening of the exception Window causing another exception to be triggered.

Then at the Window the error seems to be "Not enough quota is available to process this command", indicating there might be too much memory being spent.

So this happens always and reliably with the same query? (Microsoft)
This is happening while loading an icon so there might be some corrupted icon that is causing this crash?

Could you please monitor Resource Monitor to check if the memory just keeps growing in a strange way?

image

This is the stacktrace which seems to cause the original exception:

Wox.Infrastructure.dll!Wox.Infrastructure.Image.WindowsThumbnailProvider.GetHBitmap(string fileName, int width, int height, Wox.Infrastructure.Image.ThumbnailOptions options) Line 111
	at C:\a\_work\1\s\src\modules\launcher\Wox.Infrastructure\Image\WindowsThumbnailProvider.cs(111)
Wox.Infrastructure.dll!Wox.Infrastructure.Image.WindowsThumbnailProvider.GetThumbnail(string fileName, int width, int height, Wox.Infrastructure.Image.ThumbnailOptions options) Line 82
	at C:\a\_work\1\s\src\modules\launcher\Wox.Infrastructure\Image\WindowsThumbnailProvider.cs(82)
Wox.Infrastructure.dll!Wox.Infrastructure.Image.ImageLoader.LoadInternal(string path, bool loadFullImage) Line 189
	at C:\a\_work\1\s\src\modules\launcher\Wox.Infrastructure\Image\ImageLoader.cs(189)
Wox.Infrastructure.dll!Wox.Infrastructure.Image.ImageLoader.Load(string path, bool loadFullImage) Line 218
	at C:\a\_work\1\s\src\modules\launcher\Wox.Infrastructure\Image\ImageLoader.cs(218)
PowerToys.PowerLauncher.dll!PowerLauncher.ViewModel.ResultViewModel.Image.get() Line 207
	at C:\a\_work\1\s\src\modules\launcher\PowerLauncher\ViewModel\ResultViewModel.cs(207)

@armak
Copy link
Author

armak commented Apr 14, 2022

Yes, if I have the "Program" plugin enabled, the string "Microsoft" causes the crash reliably. It's not the only such string though, for an example "Adobe" triggers it as well. Disabling the "Program" plugin prevents this; the issue clearly seems to be related to displaying the results themselves, as for an example trying to calculate "1+1" (or any other valid calculation) also triggers the crash.

The memory usage does not seem to very meaningfully. Upon opening the prompt, PowerToys Run uses in around 100MB of RAM ("Commit (KB)"), and triggering the crash doesn't significantly affect this; it goes up by a megabyte or two, but I also saw it decrease by similar amounts as well.

This is happening while loading an icon so there might be some corrupted icon that is causing this crash?

This seems extremely plausible, since the conditions wherein the crash occurs, also has explorer.exe (or some other shell related component) a bit "stuck", it being quite unresponsive in terms of file system operations such as moving, copying or deleting files, and Windows Explorer also being unable to generate or display any new thumbnails. This is a common occurrence with Windows however, and previously PowerToys Run was not affected (nor was Wox, which I had been using for a long time prior, which I understand is the bases for PowerToys Run).

@franky920920 franky920920 added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Apr 14, 2022
@jaimecbernardo
Copy link
Collaborator

The calculator tidbit is interesting. Does it also occur if you use the activation keyword =? (=1+1)
For Program, does it occur if you use the activation keyword .? (.Microsoft)
(assuming you still have these activation keywords set in Settings for these plugins)

@armak
Copy link
Author

armak commented Apr 14, 2022

Yes, this is exactly the behavior. If I remove both from the global results, the strings "1+1" or "Microsoft" don't trigger the crash, but using the respective activation prefixes for both still do (i.e. "=1+1" or ".Microsoft").

@Jay-o-Way Jay-o-Way added Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT) Run-Plugin Things that relate with PowerToys Run's plugin interface labels Apr 16, 2022
@jaimecbernardo jaimecbernardo added Priority-2 Bug that is medium priority and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 18, 2022
@jaimecbernardo jaimecbernardo added this to To do in 0.58 Release via automation Apr 18, 2022
@jaimecbernardo jaimecbernardo added the Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. label Apr 18, 2022
@jaimecbernardo jaimecbernardo added this to To do in 0.59 Release via automation May 13, 2022
@jaimecbernardo jaimecbernardo removed this from To do in 0.58 Release May 13, 2022
@BlackHoleFox
Copy link

BlackHoleFox commented May 20, 2022

I don't have much to contribute but I'm also encountering this exact issue. Typing a variable number of characters soft-crashes the launcher.

Info:
Windows 10 Pro x86
PowerToys version v0.58.0

I have two suspicious things in my logs:

Image loading exception:

[2022-05-20 17:55:10.1813] [ERROR] [C:\a\_work\1\s\src\modules\launcher\Wox.Infrastructure\Image\ImageLoader.cs::205]
-------------------------- Begin exception --------------------------
Message: Failed to get thumbnail for C:\Music\<Soundtrack Folder Name>

Exception full name  : System.Runtime.InteropServices.InvalidComObjectException
Exception message    : Error while extracting thumbnail for C:\Music\<Soundtrack Folder Name>
Exception stack trace:
   at Wox.Infrastructure.Image.WindowsThumbnailProvider.GetHBitmap(String fileName, Int32 width, Int32 height, ThumbnailOptions options)
   at Wox.Infrastructure.Image.WindowsThumbnailProvider.GetThumbnail(String fileName, Int32 width, Int32 height, ThumbnailOptions options)
   at Wox.Infrastructure.Image.ImageLoader.LoadInternal(String path, Boolean loadFullImage)
Exception source     : Wox.Infrastructure
Exception target site: IntPtr GetHBitmap(System.String, Int32, Int32, Wox.Infrastructure.Image.ThumbnailOptions)
Exception HResult    : -2146233049

Exception full name  : System.Runtime.InteropServices.COMException
Exception message    : The data necessary to complete this operation is not yet available. (0x8000000A)
Exception stack trace:

Exception source     : 
Exception target site: 
Exception HResult    : -2147483638
-------------------------- End exception --------------------------

[2022-05-20 17:55:10.3455] [INFO] [C:\a\_work\1\s\src\modules\launcher\Wox.Plugin\PluginPair.cs::124]
Load cost for <Calculator> is <1ms>

<snip/>

Some program indexing failures (don't seem to be fatal but uh, just in case?)

-------------------------- Begin exception --------------------------
Message: 	Error status: UNKNOWN
		Program path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Software Bisque\TheSkyX First Light\View TheSkyX Application Support Files Folder.lnk
		Exception thrown in called method: Void Resolve(Accessibility._RemotableHandle ByRef, SLR_FLAGS)
		Possible interpretation of the error: |An unexpected error occurred in the calling method LnkProgram at C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Software Bisque\TheSkyX First Light\View TheSkyX Application Support Files Folder.lnk
		Possible resolution: Not yet known

Exception full name  : System.Runtime.InteropServices.COMException
Exception message    : The data is invalid. (0x8007000D)
Exception stack trace:
   at Microsoft.Plugin.Program.Programs.ShellLinkHelper.IShellLinkW.Resolve(_RemotableHandle& hwnd, SLR_FLAGS fFlags)
   at Microsoft.Plugin.Program.Programs.ShellLinkHelper.RetrieveTargetPath(String path)
   at Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram(String path)
Exception source     : Microsoft.Plugin.Program
Exception target site: Void Resolve(Accessibility._RemotableHandle ByRef, SLR_FLAGS)
Exception HResult    : -2147024883
-------------------------- End exception --------------------------


[2022-05-20 18:09:45.7049] [INFO] [C:\a\_work\1\s\src\modules\launcher\Plugins\Microsoft.Plugin.Program\Storage\Win32ProgramRepository.cs::248]
Indexed 2552 win32 applications

<snip/>

@jaimecbernardo
Copy link
Collaborator

@BlackHoleFox , Thanks for the added info. Any chance you can try to backup "C:\Music<Soundtrack Folder Name>" into a zip file and check if that makes the error go away while that folder is not there? You can extract it back afterwards.

@BlackHoleFox
Copy link

I haven't been able to reproduce this for a bit but if it starts happening again consistently I'll try it.

@jaimecbernardo
Copy link
Collaborator

@armak , Does 0.59.1 make this better? /needinfo

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 22, 2022
@jaimecbernardo jaimecbernardo removed this from To do in 0.59 Release Jun 22, 2022
@jaimecbernardo jaimecbernardo added this to To do in 0.60 Release via automation Jun 22, 2022
@ghost ghost added the Status-No recent activity no activity in the past 5 days when follow up's are needed label Jun 27, 2022
@ghost
Copy link

ghost commented Jun 27, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.

@ghost ghost closed this as completed Jul 3, 2022
0.60 Release automation moved this from To do to Done Jul 3, 2022
This issue was closed.
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 Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Priority-2 Bug that is medium priority Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT) Status-No recent activity no activity in the past 5 days when follow up's are needed
Projects
No open projects
Development

No branches or pull requests

5 participants