Skip to content

Stowed 8007007E (0xc000027b) on some systems upon instantiating Microsoft.UI.Xaml.Window #8446

Description

@meruune

Describe the bug

I'm writing a Windows Desktop app using Windows App SDK with WinUI
(For additional context: you can see the repo here, project website here)
and some users reported some weird crashing issues, where the app would
just crash upon startup, not leaving any notice or additional crash logs.

This happens only on some machines (sadly, I cannot reproduce it myself)
but generally everything seems to be working fine, except for these few cases.
Tried to reproduce on a clean machine running Windows 19041, 19044 (Hyper-V)
but really couldn't get it to crash, neither did it send any debug break signals.

So, into the issue troubleshooting, running with WinDbg Preview attached,
all cases seem to be sharing the same crash point, 8007007E stowed under 0xc000027b
(Used both builtin features and PDE from the XAML crash debugging tutorial)

The WinDbg log from the first session (they agreed to share it for debugging purposes)
ends with the 0xc000027b exception code, and after clicking Go, c0000602 and the end.

Log lines right before the exception (running on Windows NT 10.0.22621.0) ``` D:\a\_work\1\s\dev\UndockedRegFreeWinRT\catalog.cpp(337)\Microsoft.WindowsAppRuntime.dll!00007FFCEF17B610: (caller: 00007FFCEF17E110) ReturnHr(1) tid(15734) 80004002 No such interface supported D:\a\_work\1\s\dev\UndockedRegFreeWinRT\urfw.cpp(244)\Microsoft.WindowsAppRuntime.dll!00007FFCEF17E0F4: (caller: 00007FFCDA0339DC) ReturnHr(2) tid(15734) 80004002 No such interface supported (1570c.14cd8): C++ EH exception - code e06d7363 (first chance) (1570c.14cd8): C++ EH exception - code e06d7363 (first chance) (1570c.14cd8): C++ EH exception - code e06d7363 (first chance) (1570c.14cd8): C++ EH exception - code e06d7363 (first chance) (1570c.14cd8): C++ EH exception - code e06d7363 (first chance) (1570c.14cd8): CLR exception - code e0434352 (first chance) (1570c.14cd8): C++ EH exception - code e06d7363 (first chance) (1570c.14cd8): CLR exception - code e0434352 (first chance) ModLoad: 00007ffd`c1520000 00007ffd`c1634000 C:\WINDOWS\System32\MSCTF.dll (1570c.15030): C++ EH exception - code e06d7363 (first chance) (1570c.15030): C++ EH exception - code e06d7363 (first chance) (1570c.15030): C++ EH exception - code e06d7363 (first chance) (1570c.15030): C++ EH exception - code e06d7363 (first chance) (1570c.15030): C++ EH exception - code e06d7363 (first chance) (1570c.15030): CLR exception - code e0434352 (first chance) (1570c.15030): C++ EH exception - code e06d7363 (first chance) (1570c.15030): CLR exception - code e0434352 (first chance) ModLoad: 00007ffd`72c50000 00007ffd`72c59000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.5\System.Diagnostics.FileVersionInfo.dll (1570c.15734): CLR exception - code e0434352 (first chance) ModLoad: 00007ffc`df950000 00007ffc`df9ff000 C:\Users\[User]\Downloads\Amethyst-04292023\Amethyst-04292023\System.ComponentModel.Composition.dll ModLoad: 00007ffc`e1ad0000 00007ffc`e1aec000 C:\Users\[User]\Downloads\Amethyst-04292023\Amethyst-04292023\Microsoft.Windows.AppNotifications.Projection.dll Microsoft.ui.xaml.dll!00007FFCD9FFE4A9: 8007007E - The specified module could not be found. (1570c.15734): Unknown exception - code c000027b (!!! second chance !!!) KERNELBASE!RaiseFailFastException+0x152: 00007ffd`bfa37cd2 0f1f440000 nop dword ptr [rax+rax] 0:000> g WARNING: Continuing a non-continuable exception (1570c.15734): Unknown exception - code c0000602 (!!! second chance !!!) KERNELBASE!RaiseFailFastException+0x152: 00007ffd`bfa37cd2 0f1f440000 nop dword ptr [rax+rax] ```

The WinDbg log from the second session (they agreed to share it for debugging purposes)
is from a different machine, but also ends in these two exception codes, however,
this time clicking Go allowed further execution

Log lines right before the exception (running on Windows NT 10.0.19045.0) ``` D:\a\_work\1\s\dev\UndockedRegFreeWinRT\catalog.cpp(337)\Microsoft.WindowsAppRuntime.dll!00007FFAF8D90ABE: (caller: 00007FFAF8D9356A) ReturnHr(1) tid(8fe4) 80004002 No such interface supported D:\a\_work\1\s\dev\UndockedRegFreeWinRT\urfw.cpp(244)\Microsoft.WindowsAppRuntime.dll!00007FFAF8D93551: (caller: 00007FFA82831460) ReturnHr(2) tid(8fe4) 80004002 No such interface supported ModLoad: 00000170`c87f0000 00000170`c8836000 D:\Programs\Amethyst\System.ComponentModel.Composition.dll ModLoad: 00000170`c8840000 00000170`c8852000 D:\Programs\Amethyst\Microsoft.Windows.AppNotifications.Projection.dll ModLoad: 00007ffb`1d3c0000 00007ffb`1d3ca000 D:\Programs\Amethyst\System.IO.Compression.ZipFile.dll ModLoad: 00000170`c8860000 00000170`c8868000 D:\Programs\Amethyst\System.Runtime.Loader.dll ModLoad: 00007ffb`64690000 00007ffb`646bd000 C:\WINDOWS\SYSTEM32\iphlpapi.dll ModLoad: 00007ffb`67110000 00007ffb`67119000 C:\WINDOWS\System32\NSI.dll ModLoad: 00007ffb`5eaa0000 00007ffb`5eab9000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL ModLoad: 00007ffb`5ea40000 00007ffb`5ea5f000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL ModLoad: 00007ffb`646c0000 00007ffb`647b3000 C:\WINDOWS\SYSTEM32\DNSAPI.dll ModLoad: 00007ffb`62f20000 00007ffb`62f2d000 C:\WINDOWS\SYSTEM32\WINNSI.DLL (7634.8fe4): Unknown exception - code c000027b (!!! second chance !!!) KERNELBASE!RaiseFailFastException+0x152: 00007ffb`65fa57f2 0f1f440000 nop dword ptr [rax+rax] 0:000> g WARNING: Continuing a non-continuable exception (7634.8fe4): Unknown exception - code c0000602 (!!! second chance !!!) KERNELBASE!RaiseFailFastException+0x152: 00007ffb`65fa57f2 0f1f440000 nop dword ptr [rax+rax] 0:000> g WARNING: Continuing a non-continuable exception ```

I'm attaching a memory dump for this crash collected using these guidelines,
also shared in terms of the agreement regarding debugging the issue.

The crash happens while trying to instantiate a new Microsoft.UI.Xaml.Window's base,
where the constructor of the derived MainWindow class isn't even being called yet.
This is really weird, so if there's any more info needed, I'll be happy to try to provide it.

The application is unpackaged, self-contained, sets WindowsAppSDKSelfContained, and isn't being trimmed.
Additionally, the same issue seems to be happening for most Windows App SDK versions tested, currently.

Steps to reproduce the bug

As described before, I can't really reproduce this on my own machine.
I've attached WinDbg logs and a memory dump, if that even helps in this case.

The described crash happens when the application is trying to instantiate Microsoft.UI.Xaml.Window
(as I said, the constructor of the derived MainWindow class isn't even being called at that point)

The detailed crash stack pointed at DragBarWindow, but I guess it's just the base,
and anyway, the memory dump attached upper should show the same stack trace too.

Expected behavior

XAML shouldn't crash the app, and this exception cannot be caught using
in-app crash handlers because it invokes FailFast that surpasses them.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.3.0: 1.3.230331000

Windows version

Windows 11 (22H2): Build 22621, Windows 10 (21H2): Build 19044

Additional context

I've probably forgotten about some basic things to this report anyway,
please say if there's anything more I could try doing to troubleshooting this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions