devhome icon indicating copy to clipboard operation
devhome copied to clipboard

Application crashes at startup

Open andreadistefano opened this issue 1 year ago • 2 comments

Dev Home version

v0.137.141.0

Windows build number

10.0.22621.1702

Other software

No response

Steps to reproduce the bug

Start the application.

Expected result

The application starts.

Actual result

The application crashes without even opening a window. In the Windows event viewer, it logs an Error with the following information:

Faulting application name: DevHome.exe, version: 1.0.0.0, time stamp: 0x641cef7e
Faulting module name: Microsoft.UI.Xaml.dll, version: 3.1.3.0, time stamp: 0x87c36a2b
Exception code: 0xc000027b
Fault offset: 0x000000000035fb2c
Faulting process id: 0x0x4E58
Faulting application start time: 0x0x1D98E5BFAF89FDB
Faulting application path: C:\Program Files\WindowsApps\Microsoft.Windows.DevHome_0.137.141.0_x64__8wekyb3d8bbwe\DevHome.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.3_3000.851.1712.0_x64__8wekyb3d8bbwe\Microsoft.UI.Xaml.dll
Report Id: 34175ff5-2b0f-409d-acdf-847c1dee65b8
Faulting package full name: Microsoft.Windows.DevHome_0.137.141.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

Included System Information

No response

Included Extensions Information

No response

andreadistefano avatar May 24 '23 16:05 andreadistefano

I have the same issue so I tried running in with WinDbg attached and this is the errors that I get:

(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): CLR exception - code e0434352 (first chance)
(639c.95a0): Windows Runtime Originate Error - code 40080201 (first chance)
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FF8622FC07A: (caller: 00007FF8623015EF) ReturnHr(11) tid(95a0) 8007007E The specified module could not be found.
Microsoft.UI.Xaml.dll!00007FFF4782ABDE: 80131500 - onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FF8622FC07A: (caller: 00007FF86249CC72) ReturnHr(12) tid(95a0) 8007007E The specified module could not be found.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FF8622FC07A: (caller: 00007FF86249C64E) ReturnHr(13) tid(95a0) 8007007E The specified module could not be found.
ModLoad: 00007fff`d57e0000 00007fff`d5f17000   C:\WINDOWS\System32\DriverStore\FileRepository\nvmdig.inf_amd64_29b69e720c94d54e\Display.NvContainer\MessageBus.dll
ModLoad: 00007ff8`61160000 00007ff8`611d1000   C:\WINDOWS\System32\WS2_32.dll
ModLoad: 00007ff8`5e630000 00007ff8`5e65d000   C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
(639c.9570): C++ EH exception - code e06d7363 (first chance)
(639c.9570): C++ EH exception - code e06d7363 (first chance)
(639c.95a0): Unknown exception - code c000027b (!!! second chance !!!)
KERNELBASE!RaiseFailFastException+0x152:
00007ff8`602db2e2 0f1f440000      nop     dword ptr [rax+rax]

Callstack from WinDbg:

[0x0]   KERNELBASE!RaiseFailFastException + 0x152   
[0x1]   combase!RoFailFastWithErrorContextInternal2 + 0x4d9   
[0x2]   Microsoft_UI_Xaml!DirectUI::FrameworkApplication::StartDesktop + 0x1c39a8   
[0x3]   Microsoft_UI_Xaml!DirectUI::FrameworkApplicationFactory::Start + 0x6e   
[0x4]   0x7ffef61dea6d   
[0x5]   Microsoft_WinUI!ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start + 0x102   
[0x6]   DevHome_r2r + 0x25d178e   
[0x7]   coreclr!CallDescrWorkerInternal + 0x83   
[0x8]   coreclr!MethodDescCallSite::CallTargetWorker + 0x176   
[0x9]   coreclr!MethodDescCallSite::Call + 0xb   
[0xa]   coreclr!RunMainInternal + 0x11f   
[0xb]   coreclr!RunMain + 0xd2   
[0xc]   coreclr!Assembly::ExecuteMainMethod + 0x1c9   
[0xd]   coreclr!CorHost2::ExecuteAssembly + 0x1c6   
[0xe]   coreclr!coreclr_execute_assembly + 0xe2   
[0xf]   hostpolicy!coreclr_t::execute_assembly + 0x2a   
[0x10]   hostpolicy!run_app_for_context + 0x56b   
[0x11]   hostpolicy!run_app + 0x3c   
[0x12]   hostpolicy!corehost_main + 0x107   
[0x13]   hostfxr!execute_app + 0x2e9   
[0x14]   hostfxr!`anonymous namespace'::read_config_and_execute + 0xa6   
[0x15]   hostfxr!fx_muxer_t::handle_exec_host_command + 0x161   
[0x16]   hostfxr!fx_muxer_t::execute + 0x482   
[0x17]   hostfxr!hostfxr_main_startupinfo + 0xab   
[0x18]   apphost!exe_start + 0x8d8   
[0x19]   apphost!wmain + 0xab   
[0x1a]   apphost!invoke_main + 0x22   
[0x1b]   apphost!__scrt_common_main_seh + 0x10c   
[0x1c]   KERNEL32!BaseThreadInitThunk + 0x1d   
[0x1d]   ntdll!RtlUserThreadStart + 0x28   

DavidZidar avatar May 24 '23 19:05 DavidZidar

I get this as well. Never managed to open the app at all.

mdsharpe avatar May 25 '23 15:05 mdsharpe

Just to confirm, v0.2 still crashes on startup every time.

DavidZidar avatar Jun 21 '23 20:06 DavidZidar

Also v0.3 crashes on startup for me.

andreadistefano avatar Jul 20 '23 06:07 andreadistefano

Same issue for me on an azure virtual machine; however, I don't get any events. When I try to run devHome as an admin, from it's root path I get the following:

Program 'DevHome.exe' failed to run: Access is deniedAt line:1 char:1

gitunder avatar Jul 21 '23 12:07 gitunder

Runs fine on Windows 11 insider preview on my laptop, but not Windows 11 std with TPM/disabled install on my PC. Any chance it's doing some crypto/security setup at initialization that requires TPM?

PS - Until someone buys me a new PC this is the only way I can keep up with Windows.

jakenuts avatar Aug 02 '23 15:08 jakenuts

I have TPM enabled and it's crashing every time anyway.

DavidZidar avatar Aug 02 '23 15:08 DavidZidar

Still happens with 0.4.

mdsharpe avatar Aug 17 '23 07:08 mdsharpe

Kinda surprising that a Microsoft Development tool is completely borked for this long and there doesn't appear to be any real energy to resolve it. Installed every version since release and it has never gotten beyond the spinning cursor.

jakenuts avatar Aug 23 '23 05:08 jakenuts

Still not solved in v0.5, doesn't seem like anyone is looking in to this at all.

In case it helps with more info, I have a Windows 11 system, fully up to date. It's an AMD Ryzen CPU and I have plenty of RAM and SSD storage available. It's a development computer, it's well maintained. I have no similar issues with any other software from Microsoft or otherwise, just DevHome.

DavidZidar avatar Sep 22 '23 10:09 DavidZidar

I'm trying to debug the startup process using Visual Studio and I'm getting dependency injection validation exceptions.

PackageViewModel depends on missing IWinGetPackage

System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: DevHome.SetupFlow.ViewModels.PackageViewModel Lifetime: Transient ImplementationType: DevHome.SetupFlow.ViewModels.PackageViewModel': Unable to resolve service for type 'DevHome.SetupFlow.Models.IWinGetPackage' while attempting to activate 'DevHome.SetupFlow.ViewModels.PackageViewModel'.
 ---> System.InvalidOperationException: Unable to resolve service for type 'DevHome.SetupFlow.Models.IWinGetPackage' while attempting to activate 'DevHome.SetupFlow.ViewModels.PackageViewModel'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection`1 serviceDescriptors, ServiceProviderOptions options)

PackageCatalogViewModel depends on missing PackageCatalog

System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: DevHome.SetupFlow.ViewModels.PackageCatalogViewModel Lifetime: Transient ImplementationType: DevHome.SetupFlow.ViewModels.PackageCatalogViewModel': Unable to resolve service for type 'DevHome.SetupFlow.Models.PackageCatalog' while attempting to activate 'DevHome.SetupFlow.ViewModels.PackageCatalogViewModel'.
 ---> System.InvalidOperationException: Unable to resolve service for type 'DevHome.SetupFlow.Models.PackageCatalog' while attempting to activate 'DevHome.SetupFlow.ViewModels.PackageCatalogViewModel'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection`1 serviceDescriptors, ServiceProviderOptions options)

AddRepoViewModel depends on missing 'System.Collections.Generic.List`1[DevHome.SetupFlow.Models.CloningInformation]

System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: DevHome.SetupFlow.ViewModels.AddRepoViewModel Lifetime: Transient ImplementationType: DevHome.SetupFlow.ViewModels.AddRepoViewModel': Unable to resolve service for type 'System.Collections.Generic.List`1[DevHome.SetupFlow.Models.CloningInformation]' while attempting to activate 'DevHome.SetupFlow.ViewModels.AddRepoViewModel'.
 ---> System.InvalidOperationException: Unable to resolve service for type 'System.Collections.Generic.List`1[DevHome.SetupFlow.Models.CloningInformation]' while attempting to activate 'DevHome.SetupFlow.ViewModels.AddRepoViewModel'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection`1 serviceDescriptors, ServiceProviderOptions options)

Right after those exceptions the application crashes in a way I am unable to debug.

DavidZidar avatar Sep 29 '23 15:09 DavidZidar

I tried commenting out the following three lines and then the application actually started. So this does seem to be the actual problem. https://github.com/microsoft/devhome/blob/3fce7cddf1886c14ee90a4f84efb14eb61ac49af/tools/SetupFlow/DevHome.SetupFlow/Extensions/ServiceExtensions.cs#L51 https://github.com/microsoft/devhome/blob/3fce7cddf1886c14ee90a4f84efb14eb61ac49af/tools/SetupFlow/DevHome.SetupFlow/Extensions/ServiceExtensions.cs#L54 https://github.com/microsoft/devhome/blob/3fce7cddf1886c14ee90a4f84efb14eb61ac49af/tools/SetupFlow/DevHome.SetupFlow/Extensions/ServiceExtensions.cs#L127

DavidZidar avatar Sep 29 '23 15:09 DavidZidar

@cinnamon-msft Can you guys look into this? I think I have identified the problem, see above. This issue is not only blocking the use of the application Dev Home but is also blocking the use of Dev Drive.

DavidZidar avatar Sep 29 '23 15:09 DavidZidar

I just realized something. The thing that is crashing is the dependency injection validation which is a development only feature, it is not enabled in production. So I tried removing my DOTNET_ENVIRONMENT=Development environment variable and all of a sudden Dev Home runs just fine. This is quite an oversight on a development tool. Obviously dependency injection should be correctly configured which is it not.

I still can't get Dev Drive to show up though in the Windows settings for some reason. And I am no longer allowed to uninstall and reinstall Dev Home either.

DavidZidar avatar Sep 29 '23 20:09 DavidZidar

So I tried removing my DOTNET_ENVIRONMENT=Development environment variable and all of a sudden Dev Home runs just fine.

You found it! I also have a system environment variable for DOTNET_ENVIRONMENT = DEVELOPMENT for safety. As soon as I remove it, I can run Dev Home!

gpshonik avatar Sep 29 '23 20:09 gpshonik

Great! Should be easy for Microsoft to fix the issue now. I would open a PR but I'm not sure exactly which services should or need to be registered. I opened a separate issue for the Dev Drive problem I'm having.

DavidZidar avatar Sep 29 '23 20:09 DavidZidar

Thanks everyone for helping with the investigation! @DavidZidar, I was able to repro with the steps you've mentioned and pushed a fix to the main branch. Please feel free to validate from your end as well.

AmelBawa-msft avatar Oct 16 '23 17:10 AmelBawa-msft

@AmelBawa-msft Looks good to me! I had a look at the changes and tested it and it works on my end even with the environment variable. 🎉

DavidZidar avatar Oct 16 '23 19:10 DavidZidar

No longer crashing here, thanks 👍

mdsharpe avatar Oct 26 '23 10:10 mdsharpe

Can you guys look into this? I think I have identified the problem, see above. This issue is not only blocking the use of the application Dev Home but is also blocking the use of Dev Drive.

@DavidZidar Out of interest what about Dev Drive isn't working for you?

I am able to create them through the Settings app, but when I run fsutil devdrv query D: I get This is not a developer volume. which is odd and concerning.

mdsharpe avatar Oct 26 '23 10:10 mdsharpe

@mdsharpe Apparently there's a specific Windows Update patch that enables Dev Drive that I am not getting no matter how many times I check for updates (yes, I do follow the instructions). I opened a separate issue #1622, but I've realized it doesn't really have anything to with Dev Home. It's still not working though.

DavidZidar avatar Oct 26 '23 11:10 DavidZidar

Can you guys look into this? I think I have identified the problem, see above. This issue is not only blocking the use of the application Dev Home but is also blocking the use of Dev Drive.

@DavidZidar Out of interest what about Dev Drive isn't working for you?

I am able to create them through the Settings app, but when I run fsutil devdrv query D: I get This is not a developer volume. which is odd and concerning.

@mdsharpe - is your device an enterprise/IT managed device (eg: Intune, configmgr)? If so there is a bug that was just fixed in the latest cumulative update KB5031455.

Once this is applied, the drive should be mounted as a Dev Drive with Defender Performance Mode/Async scanning. If it is not recognized as a developer volume, it is being treated as a regular REFS drive and not getting async scanning.

AdamBraden avatar Oct 27 '23 03:10 AdamBraden

Thanks @DavidZidar and @AdamBraden, can confirm KB5031455 has fixed this for me.

mdsharpe avatar Oct 27 '23 10:10 mdsharpe

KB5031455 fixed my Dev Drive issue as well! 🎉

DavidZidar avatar Oct 27 '23 12:10 DavidZidar