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

[PT Run] System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception at startup #5414

Closed
Matada opened this issue Aug 1, 2020 · 22 comments
Assignees
Labels
Issue-Bug Something isn't working Priority-0 Bugs that we consider release-blocking/recall-class (P0) Resolution-External External issue, unrelated to PowerToys
Milestone

Comments

@Matada
Copy link

Matada commented Aug 1, 2020

β„Ή Computer information

  • Windows build number: 10.0.19041.388
  • PowerToys version: v0.20.0
  • PowerToy module: Application start

πŸ“ Provide detailed reproduction steps (if any)

  1. Close PT
  2. Run PT

βœ”οΈ Expected result

PT Run without unexpected errors.

❌ Actual result

Version: 1.0.0
OS Version: Microsoft Windows NT 10.0.19041.0
IntPtr Length: 8
x64: True
Date: 08/01/2020 07:30:35
Exception:
System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at _CxxThrowException(Void* , _s__ThrowInfo* )
at interop.KeyboardHook.Start()
at interop.HotkeyManager..ctor()
at PowerLauncher.ViewModel.MainViewModel..ctor(Settings settings)
at PowerLauncher.App.<>c__DisplayClass16_0.b__1()
at Wox.Infrastructure.Stopwatch.Normal(String message, Action action)
at PowerLauncher.App.OnStartup(Object sender, StartupEventArgs e)
at System.Windows.Application.OnStartup(StartupEventArgs e)
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

From Event viewer:

Application: PowerLauncher.exe CoreCLR Version: 4.700.20.20201 .NET Core Version: 3.1.4 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException: Object reference not set to an instance of an object. at PowerLauncher.App.<>c__DisplayClass22_0.b__0() at Wox.Infrastructure.Stopwatch.Normal(String message, Action action) at PowerLauncher.App.Dispose(Boolean disposing) at PowerLauncher.App.Dispose() at PowerLauncher.App.Main(String[] args)

From PT Run Logs:
2020-08-01-PT-Run-issue.txt

πŸ“· Screenshots

Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form

@Matada Matada added the Issue-Bug Something isn't working label Aug 1, 2020
@ghost ghost added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Aug 1, 2020
@crutkas
Copy link
Member

crutkas commented Aug 3, 2020

Also have from the logs

System.NullReferenceException: Object reference not set to an instance of an object.
   Source: PowerLauncher
   TargetAssembly: PowerLauncher, Version=0.20.0.0, Culture=neutral, PublicKeyToken=null
   TargetModule: PowerLauncher.dll
   TargetSite: Void <Dispose>b__0()
   at PowerLauncher.App.<>c__DisplayClass22_0.<Dispose>b__0()
   at Wox.Infrastructure.Stopwatch.Normal(String message, Action action)
   at PowerLauncher.App.Dispose(Boolean disposing)
   at PowerLauncher.App.Dispose()
   at PowerLauncher.App.Main(String[] args)

@crutkas
Copy link
Member

crutkas commented Aug 3, 2020

bottom is #5537

@crutkas crutkas changed the title [PT Run] Exception thrown during app start [PT Run] System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception at startup Aug 3, 2020
@crutkas crutkas added Hot Fix Items we will product an out-of-band release for and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Aug 3, 2020
@crutkas
Copy link
Member

crutkas commented Aug 7, 2020

#5611 shows this happens on Shortcut guide and FZ editor well.

@crutkas crutkas added the Priority-0 Bugs that we consider release-blocking/recall-class (P0) label Aug 7, 2020
@arjunbalgovind
Copy link
Contributor

arjunbalgovind commented Aug 7, 2020

@crutkas I'm not sure if two are related, but they could be. There's not enough info from the exception log about whether the exception was thrown from SetWindowsHookEx failing or not.
Edit: Just noticed #5611 shows the same error message for PT Run as well, so most likely related.

@Matada can you check if other PowerToys like Shortcut guide or Keyboard Manager are working for you?

@crutkas
Copy link
Member

crutkas commented Aug 7, 2020

believe #4323 is same issue as this as well.

@Matada
Copy link
Author

Matada commented Aug 8, 2020

Shortcut Guide enabled in Settings part and:

  • holding Windows Key doesn't work
  • alternative works fine ( Win + Shift + ? )

Keyboard Manager not working:

  • click on Remap a key ( Settings ) doesn't work
  • click on Remap a shortcut ( Settings ) doesn't work

@crutkas crutkas added this to the InVEST-2009 milestone Sep 1, 2020
@arjunbalgovind arjunbalgovind self-assigned this Sep 1, 2020
@crutkas crutkas removed the Hot Fix Items we will product an out-of-band release for label Sep 3, 2020
@arjunbalgovind arjunbalgovind added the Status-In progress This issue or work-item is under development label Sep 8, 2020
@arjunbalgovind
Copy link
Contributor

@ryanbodrug-microsoft @crutkas Should I mark this as fix-committed? In #6454 I added in code to show a more detailed error message and log telemetry for it, so while the issue isn't actually fixed, we will need to wait for user feedback once they use a build with that change. Other option is to share an unsigned build from current master with the users facing this issue.

@crutkas
Copy link
Member

crutkas commented Sep 10, 2020

See if they are willing to get an unsigned build to test quickly.

@arjunbalgovind
Copy link
Contributor

@Matada @kevinctech @JDNielsen93 @karthik20 @swpknl We are still trying to debug this error however we haven't been able to reproduce it yet. Would you be willing to try an unsigned build of PowerToys with more detailed error messages so that we can get more information on this error?

@kevinctech
Copy link

We are still trying to debug this error however we haven't been able to reproduce it yet. Would you be willing to try an unsigned build of PowerToys with more detailed error messages so that we can get more information on this error?

@arjunbalgovind Yes

@karthik20
Copy link

@Matada @kevinctech @JDNielsen93 @karthik20 @swpknl We are still trying to debug this error however we haven't been able to reproduce it yet. Would you be willing to try an unsigned build of PowerToys with more detailed error messages so that we can get more information on this error?

@arjunbalgovind , I installed the new version on a new Surface 3 laptop on a clean slate and it works as expected(all firmware and updates installed). I guess it might not be something directly to do with PowerToys but rather some Firmware/Windows 10 update? I speak for myself here at the moment. May be resetting the Windows might work?

@Matada
Copy link
Author

Matada commented Sep 12, 2020

@Matada @kevinctech @JDNielsen93 @karthik20 @swpknl We are still trying to debug this error however we haven't been able to reproduce it yet. Would you be willing to try an unsigned build of PowerToys with more detailed error messages so that we can get more information on this error?

Yes.

@Matada
Copy link
Author

Matada commented Sep 12, 2020

Shortcut Guide enabled in Settings part and:

  • holding Windows Key doesn't work
  • alternative works fine ( Win + Shift + ? )

Keyboard Manager not working:

  • click on Remap a key ( Settings ) doesn't work
  • click on Remap a shortcut ( Settings ) doesn't work

Those two are fixed and working fine on v0.21.1. Thanks.

@arjunbalgovind
Copy link
Contributor

@kevinctech @Matada @swpknl @JDNielsen93 @karthik20 can you try installing this unsigned build on the system where you got this error and let us know what error messages appear? Before installing this version please uninstall the release version.

PowerToys-issue5414-unsigned-0.21.2-x64.zip

@kevinctech
Copy link

@arjunbalgovind
Upon startup, 2 windows FancyZones and Keyboard Manager appear with "SetWindowsHookEx failed with error 1431: The hook procedure is not installed"
When I open settings and click on Color Picker, FancyZones or PowerToys Run, a window PowerToys - Interop appears with "SetWindowsHookEx failed with error 0: The operation completed successfully." When PowerToys Run is enabled with the default Alt+Space shortcut, the shortcut does not work.

On a related note, since PowerToys is basically unusable for me, I have been using Flow Launcher (based on Wox) instead and the Alt+Space hotkey works fine there.

PT Run log file attached:
2020-09-15.txt

@Matada
Copy link
Author

Matada commented Sep 15, 2020

Retest on v0.21.2
Recreation steps as in defect description + I go through Setting menu clicking on each one.
Same errors as commented by @kevinctech, but

  • SetWindowsHookEx failed with error 1431 - just after reinstall and restart and then never appeared again. I can't recreate.
  • SetWindowsHookEx failed with error 0 - always during Startup, after click on menu: PowerToys Run, FancyZones, Color Picker

PT Run Logs:
2020-09-15.txt

@arjunbalgovind
Copy link
Contributor

@kevinctech @Matada are there any third-party apps installed on your system which could be blocking hooks? Like an antivirus/firewall, some secure environment app or some form of virtualization? Trying to identify similarities between your systems.

@kevinctech
Copy link

@arjunbalgovind The app I suspect is a corporate client by SentryBay that wraps a Citrix receiver app. However, I also use Flow Launcher and DisplayFusion and the hotkeys for both apps work fine.

@Matada
Copy link
Author

Matada commented Sep 17, 2020

@arjunbalgovind I can confirm the same observation as @kevinctech described.
Even after uninstalling app from SentryBay (contains some Keyboard Filter Driver) exception not appears for Release v0.21.1.

@swpknl
Copy link

swpknl commented Sep 17, 2020

I also have a corporate client by SentryBay installed in my PC. I get the following error when I start PowerToys: SetWindowsHookEx failed with error 1431: The hook procedure is not installed. This popup came thrice.
Then a new popup with SetWindowsHookEx failed with error 0: The operation completed successfully.

After opening the settings for PowerToys when I go to ColorPicker, Fancy Run or PowerToys Run, another popup shows, SetWindowsHookEx failed with error 0: The operation completed successfully.

PFA the logs.
2020-09-17.txt

@arjunbalgovind
Copy link
Contributor

@kevinctech, the hotkeys for those two apps work because they use the RegisterHotkey API and not keyboard hooks. The disadvantage of using RegisterHotkey is that you can't set up hotkeys which use the Windows key (like Win+Space).

@arjunbalgovind
Copy link
Contributor

Since the issue is with a third party corporate client (SentryBay) we can't resolve this from our end. We recommend looking into whether the corporate client has some option for "trusted apps" and allowing PowerToys as an exception. PowerToys settings, Keyboard Manager, FancyZones, Shortcut Guide, PowerToys Run and ColorPicker use keyboard hooks, so none of these would work as expected.

@arjunbalgovind arjunbalgovind added Resolution-External External issue, unrelated to PowerToys and removed Status-In progress This issue or work-item is under development labels Sep 17, 2020
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 Priority-0 Bugs that we consider release-blocking/recall-class (P0) Resolution-External External issue, unrelated to PowerToys
Projects
None yet
Development

No branches or pull requests

6 participants