question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception: iertutil.dll Access violation reading location 0x0000000000000000

See original GitHub issue

Describe the bug Application crashes on exit at base.h loc 2088 with the following exception.

Exception thrown at 0x00007FFA74BC12AA (iertutil.dll) in App3.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

__declspec(noinline) void unconditional_release_ref() noexcept
{
    std::exchange(m_ptr, {})->Release(); // <- Here
}

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create a C++ WinUI 3 desktop application.
  2. Modify MainWindow.xaml to the following:
<Window
    x:Class="App3.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App3"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <MenuBar Name="TestMenuBar">
            <MenuBarItem Name="TestMenuItem" Title="Test"/>
        </MenuBar>
        <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
    </StackPanel>
</Window>
  1. Run the application in x64.
  2. Close the application.
  3. Exception is thrown.

Expected behavior App closes without exception.

Screenshots

image image

Version Info

NuGet package version:

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362) Yes
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context When run in x86 mode the following exception occurs:

Exception thrown at 0x6E0193DA (iertutil.dll) in App3.exe: 0xC0000005: Access violation reading location 0x00000000.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
AaronVivianocommented, Aug 18, 2020

@stevenbrix Indeed. Here you go:

iertutil.dll!Microsoft::WRL::ActivationFactory<Microsoft::WRL::Implements<Microsoft::WRL::FtmBase,Windows::Foundation::IUriRuntimeClassFactory>,Windows::Foundation::IUriEscapeStatics,Microsoft::WRL::CloakedIid<Windows::Foundation::Marshaling::Internal::IValueUnmarshalByPropertySet>,0>::Release()	Unknown
 	[Inline Frame] Microsoft.UI.Xaml.dll!ctl::ComPtr<ABI::Windows::Foundation::IUriRuntimeClassFactory>::InternalRelease() Line 270	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!ctl::ComPtr<ABI::Windows::Foundation::IUriRuntimeClassFactory>::{dtor}() Line 341	C++
 	Microsoft.UI.Xaml.dll!DirectUI::StaticStore::~StaticStore()	C++
 	Microsoft.UI.Xaml.dll!DirectUI::StaticStore::`scalar deleting destructor'(unsigned int)	C++
 	Microsoft.UI.Xaml.dll!DirectUI::StaticStore::Release() Line 60	C++
 	Microsoft.UI.Xaml.dll!xref_ptr<DirectUI::StaticStore>::DecrementRefCount() Line 220	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!xref_ptr<DirectUI::StaticStore>::{dtor}() Line 64	C++
 	Microsoft.UI.Xaml.dll!GetEventHelper(ctl::ComPtr<DirectUI::RoutedEvent> * field, KnownEventIndex index, const wchar_t * name, ABI::Microsoft::UI::Xaml::IRoutedEvent * * ppRoutedEvent) Line 166	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::StaticStore::GetPointerPressedEvent(ABI::Microsoft::UI::Xaml::IRoutedEvent * *) Line 237	C++
 	Microsoft.UI.Xaml.dll!DirectUI::UIElementFactory::get_PointerPressedEventImpl(ABI::Microsoft::UI::Xaml::IRoutedEvent * * ppValue) Line 2406	C++
 	[External Code]	
 	Microsoft.UI.Xaml.dll!DirectUI::TrackerTargetReference::Clear() Line 624	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::TrackerPtr<IUnknown>::Clear() Line 267	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!ctl::WeakReferenceSourceNoThreadId::RemovePtrValue(DirectUI::TrackerPtr<IUnknown> &) Line 235	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!ctl::WeakReferenceSourceNoThreadId::DeleteTrackerHandle(TrackerHandle__ *) Line 1093	C++
 	Microsoft.UI.Xaml.dll!ctl::interface_forwarder<ITrackerOwner,DirectUI::DependencyObject>::DeleteTrackerHandle(TrackerHandle__ * handle) Line 100	C++
 	[External Code]	
 	Microsoft.UI.Xaml.dll!DirectUI::TrackerTargetReference::Clear() Line 624	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::TrackerPtr<ABI::Windows::Foundation::Collections::IIterable<IInspectable *>>::{dtor}() Line 27	C++
 	Microsoft.UI.Xaml.dll!DirectUI::ItemCollection::~ItemCollection() Line 36	C++
 	[External Code]	
 	Microsoft.UI.Xaml.dll!ctl::ComBase::ReleaseImpl() Line 300	C++
 	Microsoft.UI.Xaml.dll!DirectUI::TrackerTargetReference::Clear() Line 624	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::TrackerPtr<ABI::Windows::Foundation::Collections::IObservableVector<IInspectable *>>::{dtor}() Line 27	C++
 	Microsoft.UI.Xaml.dll!DirectUI::ItemContainerGenerator::~ItemContainerGenerator() Line 68	C++
 	[External Code]	
 	Microsoft.UI.Xaml.dll!ctl::ComBase::ReleaseImpl() Line 300	C++
 	Microsoft.UI.Xaml.dll!DirectUI::TrackerTargetReference::Clear() Line 624	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::TrackerPtr<ABI::Microsoft::UI::Xaml::Controls::IItemContainerGenerator>::{dtor}() Line 27	C++
 	Microsoft.UI.Xaml.dll!DirectUI::ItemsControl::~ItemsControl() Line 64	C++
 	[External Code]	
 	Microsoft.UI.Xaml.dll!ctl::ComBase::ReleaseImpl() Line 300	C++
 	Microsoft.UI.Xaml.dll!DirectUI::TrackerTargetReference::Clear() Line 624	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::TrackerPtr<IUnknown>::Clear() Line 267	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!ctl::WeakReferenceSourceNoThreadId::RemovePtrValue(DirectUI::TrackerPtr<IUnknown> &) Line 235	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!ctl::WeakReferenceSourceNoThreadId::DeleteTrackerHandle(TrackerHandle__ *) Line 1093	C++
 	Microsoft.UI.Xaml.dll!ctl::interface_forwarder<ITrackerOwner,DirectUI::DependencyObject>::DeleteTrackerHandle(TrackerHandle__ * handle) Line 100	C++
 	[External Code]	
>	App3.exe!winrt::Windows::Foundation::IUnknown::unconditional_release_ref() Line 2088	C++
 	App3.exe!winrt::Windows::Foundation::IUnknown::release_ref() Line 2082	C++
 	App3.exe!winrt::Windows::Foundation::IUnknown::~IUnknown() Line 1996	C++
 	[External Code]	
 	App3.exe!winrt::impl::root_implements<winrt::App3::implementation::MainWindow,winrt::App3::MainWindow,winrt::composing,winrt::Microsoft::UI::Xaml::Markup::IComponentConnector>::NonDelegatingRelease() Line 7058	C++
 	App3.exe!winrt::impl::root_implements<winrt::App3::implementation::MainWindow,winrt::App3::MainWindow,winrt::composing,winrt::Microsoft::UI::Xaml::Markup::IComponentConnector>::Release() Line 6930	C++
 	App3.exe!winrt::implements<winrt::App3::implementation::MainWindow,winrt::App3::MainWindow,winrt::composing,winrt::Microsoft::UI::Xaml::Markup::IComponentConnector>::Release() Line 7503	C++
 	App3.exe!winrt::impl::produce_base<winrt::App3::implementation::MainWindow,winrt::App3::IMainWindow,void>::Release() Line 6599	C++
 	App3.exe!winrt::Windows::Foundation::IUnknown::unconditional_release_ref() Line 2088	C++
 	App3.exe!winrt::Windows::Foundation::IUnknown::release_ref() Line 2082	C++
 	App3.exe!winrt::Windows::Foundation::IUnknown::~IUnknown() Line 1996	C++
 	[External Code]	
 	App3.exe!winrt::impl::root_implements<winrt::App3::implementation::App,winrt::Microsoft::UI::Xaml::IApplicationOverrides,winrt::composing,winrt::Microsoft::UI::Xaml::Markup::IXamlMetadataProvider>::NonDelegatingRelease() Line 7058	C++
 	App3.exe!winrt::impl::root_implements<winrt::App3::implementation::App,winrt::Microsoft::UI::Xaml::IApplicationOverrides,winrt::composing,winrt::Microsoft::UI::Xaml::Markup::IXamlMetadataProvider>::Release() Line 6930	C++
 	App3.exe!winrt::implements<winrt::App3::implementation::App,winrt::Microsoft::UI::Xaml::IApplicationOverrides,winrt::composing,winrt::Microsoft::UI::Xaml::Markup::IXamlMetadataProvider>::Release() Line 7503	C++
 	App3.exe!winrt::impl::produce_base<winrt::App3::implementation::App,winrt::Microsoft::UI::Xaml::IApplicationOverrides,void>::Release() Line 6599	C++
 	Microsoft.UI.Xaml.dll!ctl::release_interface<DirectUI::FrameworkApplication>(DirectUI::FrameworkApplication * & pInterface) Line 137	C++
 	[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::FrameworkApplication::GlobalDeinit() Line 622	C++
 	Microsoft.UI.Xaml.dll!DeinitializeDll() Line 167	C++
 	Microsoft.UI.Xaml.dll!DllMain(HINSTANCE__ * hinstDLL, unsigned int fdwReason, void * __formal) Line 244	C++
 	[External Code]	
0reactions
stevenbrixcommented, Aug 18, 2020

@AaronViviano are you able to load symbols for Microsoft.ui.xaml.dll?

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# program with access violation in iertutil.dll at exit
Running procdump.exe I was able to get a dump of the crash, with this error: Unhandled exception at 0x00007FFB0FDDFCA0 (iertutil.dll) in ...
Read more >
Access violation reading location 0x00000000 when ...
Hi, I have developed a c# dll that makes http reqest using System.Net namespace. If I call the dll methods from an c#...
Read more >
Premiere crashing in multiple scenarios
Exception Parameters: Access violation reading location ... C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\AdobePSL.dll.
Read more >
exception thrown. Access violation reading Location
After running for almost half an hour my program throws an exception. dadc = GetDC(); dadc->FillRgn(); It throws exception at line 2.
Read more >
AE is crashing because of an opengl issue
Exception Parameters: Access violation reading location 0x0000000000000250. Exception Message: 3221225477 The instruction at 0x%p referenced ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found