WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Newest WindowsAppSdk crashes in Microsoft.ui.xaml.dll when published as MSIX

Open char8t opened this issue 1 year ago • 4 comments

Describe the bug

I have a MAUI Blazor Hybrid App for which I updated the SDK to version 1.5.240802000 (from the previous 1.3.x version). The app functions well so far, except when I publish it as an MSIX package. When I try to launch the app, it crashes within the Microsoft.ui.xaml.dll, causing it to force stop.

The Event Viewer provides two messages:

Name der fehlerhaften Anwendung: MedwinPortable.exe, Version: 1.0.0.0, Zeitstempel: 0x66960000
Name des fehlerhaften Moduls: Microsoft.ui.xaml.dll, Version: 3.1.5.0, Zeitstempel: 0xcd7cc268
Ausnahmecode: 0xc000027b
Fehleroffset: 0x00000000004051c5
ID des fehlerhaften Prozesses: 0x0x6058
Startzeit der fehlerhaften Anwendung: 0x0x1DAF30CF6103975
Pfad der fehlerhaften Anwendung: C:\Program Files\WindowsApps\E6421387-A514-4F00-AE4D-71187F79A1D7_0.7.4.0_x64__c02fszca6s19y\MedwinPortable.exe
Pfad des fehlerhaften Moduls: C:\Program Files\WindowsApps\E6421387-A514-4F00-AE4D-71187F79A1D7_0.7.4.0_x64__c02fszca6s19y\Microsoft.ui.xaml.dll
Berichtskennung: 07576a83-fa18-4052-aa1f-da9ad499b093
Vollständiger Name des fehlerhaften Pakets: E6421387-A514-4F00-AE4D-71187F79A1D7_0.7.4.0_x64__c02fszca6s19y
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: App
Fehlerbucket 1682340737426484359, Typ 5
Ereignisname: MoAppCrash
Antwort: Nicht verfügbar
CAB-Datei-ID: 0

Problemsignatur:
P1: E6421387-A514-4F00-AE4D-71187F79A1D7_0.7.4.0_x64__c02fszca6s19y
P2: praid:App
P3: 1.0.0.0
P4: 66960000
P5: StackHash12_026
P6: 0.0.0.0
P7: 00000000
P8: 80040154
P9: 0
P10: 

Angefügte Dateien:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.c51fe111-b99b-4cf1-87a8-5ea4fe1d24f5.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.cc148132-aa74-4fbd-9c38-26b378038d6a.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.8f88b827-ede4-4101-a12b-28b497308cc2.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.3f33bb5b-5b86-4f61-972e-e676e028c4f3.tmp.txt
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.eb120cd1-1df2-421c-b292-303a0c3bc80b.tmp.xml

Diese Dateien befinden sich möglicherweise hier:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_E6421387-A514-4F_2d73e48119c4b8de6e4d76e7d67a79d404aa5_d6885890_9ff2c231-6a0f-4768-9669-ebb21170805a

Analysesymbol: 
Es wird erneut nach einer Lösung gesucht: 0
Berichts-ID: 07576a83-fa18-4052-aa1f-da9ad499b093
Berichtstatus: 268435456
Bucket mit Hash: d594a4afc6792df7d758dffcbd796c87
CAB-Datei-Guid: 0

Steps to reproduce the bug

Probably any MAUI or WinUI3 template app with MSIX packaging will do

Expected behavior

A running app

Screenshots

No response

NuGet package version

Windows App SDK 1.5.6: 1.5.240802000

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

char8t avatar Aug 20 '24 14:08 char8t

Error code 0xc000027b indicates this was a stowed exception. Please see How to get a good callstack for crashes to get the stowed exception stack(s) so we can see the source of the error.

codendone avatar Aug 21 '24 04:08 codendone

Here is the output from Windbg:

Microsoft (R) Windows Debugger Version 10.0.22621.755 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.


Loading Dump File [C:\dumps\MedwinPortable.exe.4152.dmp]
User Mini Dump File with Full Memory: Only application data is available

Symbol search path is: srv*
Executable search path is: 
Windows 10 Version 22631 MP (8 procs) Free x64
Product: WinNt, suite: SingleUserTS
Edition build lab: 22621.1.amd64fre.ni_release.220506-1250
Machine Name:
Debug session time: Thu Aug 22 09:35:24.000 2024 (UTC + 2:00)
System Uptime: 0 days 0:28:41.459
Process Uptime: 0 days 0:00:03.000
................................................................
................................................................
.................
Loading unloaded module list
..
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(1038.2a00): Unknown exception - code c000027b (first/second chance not available)
For analysis of this file, run !analyze -v
KERNELBASE!RaiseFailFastException+0x152:
00007ffa`654406c2 0f1f440000      nop     dword ptr [rax+rax]
0:000> !PDE.dpx -dse
=========================================================================================
 PDE v11.3 - Copyright 2017 Andrew Richards
=========================================================================================
Start memory scan  : 0x000000c1d4f7c2a0 ($csp)
End memory scan    : 0x000000c1d4f80000 (User Stack Base)

0x000000c1d4f7c858 : 0x000000c1d4f7c980 :  !dse combase!STOWED_EXCEPTION_INFORMATION_V1
0x000000c1d4f7c860 : 0x00000252f69aff80 :  !dse combase!STOWED_EXCEPTION_INFORMATION_V1
0x000000c1d4f7c870 : 0x000000c1d4f7c980 :  !dse combase!STOWED_EXCEPTION_INFORMATION_V1
0x000000c1d4f7c980 : 0x00000252f69aff80 :  !dse combase!STOWED_EXCEPTION_INFORMATION_V1
0x000000c1d4f7caf0 : 0x00000252f69aff80 :  !dse combase!STOWED_EXCEPTION_INFORMATION_V1
0x000000c1d4f7cb88 : 0x00000252f69aff80 :  !dse combase!STOWED_EXCEPTION_INFORMATION_V1
*** WARNING: Unable to verify checksum for Microsoft.Maui.Controls.dll
*** WARNING: Unable to verify checksum for WinRT.Runtime.dll
*** WARNING: Unable to verify checksum for Microsoft.WinUI.dll
*** WARNING: Unable to verify checksum for Microsoft.Maui.dll
*** WARNING: Unable to verify checksum for MedwinPortable.dll
*** WARNING: Unable to verify checksum for MedwinPortable.exe

0:000> !PDE.dse 00000252f69aff80
Stowed Exception Array @ 0x00000252f69aff80

Stowed Exception #1 @ 0x00000252f6929c70
	0x80040154 (FACILITY_ITF - COM/OLE Interface Management): Klasse nicht registriert

	Stack	 : 0x252f6928c50
		7ff9835ae756 Microsoft_ui_xaml!DllMain+0xf8f86
		7ff9833f1312 Microsoft_ui_xaml!DllGetActivationFactory+0x26042
		7ff9833f0ffc Microsoft_ui_xaml!DllGetActivationFactory+0x25d2c
		7ff9833f0f9e Microsoft_ui_xaml!DllGetActivationFactory+0x25cce
		7ff9833f0e84 Microsoft_ui_xaml!DllGetActivationFactory+0x25bb4
		7ff9833f0df9 Microsoft_ui_xaml!DllGetActivationFactory+0x25b29
		7ff98342f8a7 Microsoft_ui_xaml!DllGetActivationFactory+0x645d7
		7ff98328a3c3 Microsoft_ui_xaml+0x9a3c3
		7ff983483792 Microsoft_ui_xaml!DllGetActivationFactory+0xb84c2
		7ff9833ee1d6 Microsoft_ui_xaml!DllGetActivationFactory+0x22f06
		7ff9833ee37e Microsoft_ui_xaml!DllGetActivationFactory+0x230ae
		7ff983466297 Microsoft_ui_xaml!DllGetActivationFactory+0x9afc7
		7ffa658282e1 user32!DispatchMessageW+0x741
		7ffa65827f9c user32!DispatchMessageW+0x3fc
		7ffa658352cc user32!CallNextHookEx+0x22c
		7ffa67b73fe4 ntdll!KiUserCallbackDispatcher+0x24
		7ffa65192294 win32u!NtUserCreateWindowEx+0x14
		7ffa65820960 user32!CreateWindowExW+0x520
		7ffa6582067c user32!CreateWindowExW+0x23c
		7ffa658204c2 user32!CreateWindowExW+0x82
		7ff983453b72 Microsoft_ui_xaml!DllGetActivationFactory+0x888a2
		7ff983454220 Microsoft_ui_xaml!DllGetActivationFactory+0x88f50
		7ff983453fdd Microsoft_ui_xaml!DllGetActivationFactory+0x88d0d
		7ff983453e00 Microsoft_ui_xaml!DllGetActivationFactory+0x88b30
		7ff98345395c Microsoft_ui_xaml!DllGetActivationFactory+0x8868c
		7ff9832d98f6 Microsoft_ui_xaml+0xe98f6
		7ff983359fb1 Microsoft_ui_xaml+0x169fb1
		7ff983359e56 Microsoft_ui_xaml+0x169e56
		7ff98335a118 Microsoft_ui_xaml+0x16a118
		7ff983358b7b Microsoft_ui_xaml+0x168b7b
		7ff926d667f5


char8t avatar Aug 22 '24 07:08 char8t

Thanks, @char8t. The good news is that the WinDbg output appears to be showing the correct stack. The stack is less useful because symbols didn't load for some reason (something we may need to take a look at that and refine in the instructions doc). But, since you're using latest 1.5, I could map this to CXamlIslandRoot::InitInputObjects hitting a failure when trying to create some Microsoft.UI.Input type.

Also, the output shows this is a "class not registered" error, evidently with the Microsoft.UI.Input type. Is your app using <WindowsAppSDKSelfContained>? Are you using a custom packaging project (WAPP) for the MSIX?

codendone avatar Aug 23 '24 04:08 codendone

Yes, I am using WindowsAppSDKSelfContained but only for the publishing process as MSIX. I guess that may be the reason why it works when running unpackaged in VS2022. Packaging to MSIX is done via command line:

dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:Platform=x64 -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:PublishReadyToRun=true

char8t avatar Aug 27 '24 11:08 char8t

I just updated my App to .NET 9 and the latest Windows App SDK and the issue is now gone. Thank you guys!

char8t avatar Nov 15 '24 12:11 char8t