【发布时间】:2019-11-02 23:40:28
【问题描述】:
我的 UWP 应用程序在调试和发布时意外崩溃。它不依赖于移动鼠标或键盘上的按键。它可以工作几分钟或几小时,然后在 Windows.UI.Xaml.dll 中崩溃,有时在 SharedLibrary.dll 中。有趣的是,它在 64 OS Windows 上经常崩溃,但在 32 Windows 上却很少崩溃。 我在 Windows 10.0.17763 和 10.0.17134 中进行了测试。 在我的调试配置计算机上,它总是在 Windows.UI.Xaml.dll!ctl::ComObject::AddRef() 中崩溃 在 Outdoor.UWP.exe 中的 0x00007FF868934853 (Windows.UI.Xaml.dll) 处引发异常:0xC0000005:访问冲突读取位置 0x0000000000000008。 堆栈跟踪
Windows.UI.Xaml.dll!ctl::ComObject::AddRef() 第 83 行 C++ [内嵌框架] Windows.UI.Xaml.dll!ctl::addref_interface(DirectUI::DependencyObject *) 第 121 行 C++ Windows.UI.Xaml.dll!DirectUI::DependencyObject::AddRefForPeerReferenceHelper() 第 2585 行 C++ [内嵌框架] Windows.UI.Xaml.dll!DirectUI::DependencyObject::SetExpectedReferenceOnPeer(CDependencyObject *) 第 4001 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CFxCallbacks::FrameworkCallbacks_SetExpectedReferenceOnPeer(CDependencyObject *) 第 1101 行 C++ Windows.UI.Xaml.dll!CDependencyObject::SetExpectedReferenceOnPeer() 第 2847 行 C++ Windows.UI.Xaml.dll!CDependencyObject::OnParentChange(CDependencyObject * pOldParent, CDependencyObject * pParent, bool hasAtLeastOneParent) 第 1623 行 C++ Windows.UI.Xaml.dll!CMultiParentShareableDependencyObject::AddParent(CDependencyObject * pNewParent, bool fPublic, void(*)(CDependencyObject *, DirtyFlags::Value) pfnNewParentRenderChangedHandler) 第 53 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CDOCollection::ChangeParent(CDependencyObject *) 第 1081 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CDOCollection::SetChildParent(CDependencyObject * fPublic, CDependencyObject *) 第 1193 行 C++ Windows.UI.Xaml.dll!CDOCollection::Append(CDependencyObject * pObject, unsigned int * pnIndex) 第 536 行 C++ Windows.UI.Xaml.dll!CStateTriggerCollection::Append(CDependencyObject * object, unsigned int * index) 第 48 行 C++ Windows.UI.Xaml.dll!CVisualStateManager2::FaultInStateTriggers(CVisualStateGroupCollection * groupCollection, CustomWriterRuntimeObjectCreator & creator) 第 612 行 C++ Windows.UI.Xaml.dll!CVisualStateManager2::FaultInChildren(CVisualStateGroupCollection * groupCollection) 第 339 行 C++ Windows.UI.Xaml.dll!CVisualStateGroupCollection::EnsureFaultedIn() 第 255 行 C++ Windows.UI.Xaml.dll!Jupiter::VisualStateManager::DeferredNameScopeEntry::TryGetOrCreateElement(bool * shouldRetryLookup) 第 36 行 C++ Windows.UI.Xaml.dll!Jupiter::NameScoping::NameScopeTableEntry::TryGetElement(bool * shouldRetry) 第 90 行 C++ Windows.UI.Xaml.dll!Jupiter::NameScoping::StandardNameScopeTable::TryGetElementImpl(const xstring_ptr_view & name, bool * shouldRetry) 第 23 行 C++ [内嵌框架] Windows.UI.Xaml.dll!Jupiter::NameScoping::NameScopeTable::TryGetElement(const xstring_ptr_view &) 第 38 行 C++ Windows.UI.Xaml.dll!Jupiter::NameScoping::NameScopeRoot::GetNamedObjectIfExists(const xstring_ptr_view & name, const CDependencyObject * nameScopeOwner, Jupiter::NameScoping::NameScopeType nameScopeType) 第 57 行 C++ Windows.UI.Xaml.dll!CCoreServices::ClearNamedObject(const xstring_ptr_view & strName, const CDependencyObject * pNamescopeOwner, CDependencyObject * originalEntry) 第 135 行 C++ Windows.UI.Xaml.dll!CDependencyObject::UnregisterName(CDependencyObject * pNamescopeOwner) 第 761 行 C++ Windows.UI.Xaml.dll!CDependencyObject::LeaveImpl(CDependencyObject * pNamescopeOwner, LeaveParams 参数) 第 1189 行 C++ Windows.UI.Xaml.dll!CVisualStateGroup::LeaveImpl(CDependencyObject * pNamescopeOwner, LeaveParams params) 第 64 行 C++ Windows.UI.Xaml.dll!CDependencyObject::Leave(CDependencyObject * pNamescopeOwner, LeaveParams params) 第 1122 行 C++ Windows.UI.Xaml.dll!CDOCollection::ChildLeave(CDependencyObject * pChild, CDependencyObject * pNamescopeOwner, LeaveParams params, unsigned int fCanProcessEnterLeave) 第 401 行 C++ Windows.UI.Xaml.dll!CDOCollection::LeaveImpl(CDependencyObject * pNamescopeOwner, LeaveParams params) 第 208 行 C++ Windows.UI.Xaml.dll!CVisualStateGroupCollection::LeaveImpl(CDependencyObject * namescopeOwner, LeaveParams params) 第 183 行 C++ Windows.UI.Xaml.dll!CDependencyObject::Leave(CDependencyObject * pNamescopeOwner, LeaveParams params) 第 1122 行 C++ Windows.UI.Xaml.dll!CDependencyObject::LeaveObjectProperty(CDependencyObject * pDO, CDependencyObject * namescopeOwner, LeaveParams 参数) 第 1415 行 C++ Windows.UI.Xaml.dll!CDependencyObject::LeaveSparseProperties(CDependencyObject * namescopeOwner, LeaveParams params) 第 1386 行 C++ Windows.UI.Xaml.dll!CDependencyObject::LeaveImpl(CDependencyObject * pNamescopeOwner, LeaveParams 参数) 第 1224 行 C++ Windows.UI.Xaml.dll!CUIElement::LeaveImpl(CDependencyObject * pNamescopeOwner, LeaveParams 参数) 第 1676 行 C++ Windows.UI.Xaml.dll!CFrameworkElement::LeaveImpl(CDependencyObject * pNamescopeOwner, LeaveParams 参数) 第 2539 行 C++ Windows.UI.Xaml.dll!CDependencyObject::Leave(CDependencyObject * pNamescopeOwner, LeaveParams params) 第 1122 行 C++ Windows.UI.Xaml.dll!CDOCollection::ChildLeave(CDependencyObject * pChild, CDependencyObject * pNamescopeOwner, LeaveParams params, unsigned int fCanProcessEnterLeave) 第 401 行 C++ Windows.UI.Xaml.dll!CDOCollection::Neat(int bBreak) 第 852 行 C++ Windows.UI.Xaml.dll!CCollection::Destroy() 第 23 行 C++ Windows.UI.Xaml.dll!CCollection::Clear() 第 63 行 C++ Windows.UI.Xaml.dll!CUIElementCollection::RemoveAllElements(unsigned int bTryUnloadingElements) 第 1378 行 C++ Windows.UI.Xaml.dll!CUIElement::~CUIElement() 第 387 行 C++ Windows.UI.Xaml.dll!CPage::`标量删除析构函数'(unsigned int) C++ [内嵌框架] Windows.UI.Xaml.dll!CDependencyObject::ReleaseImpl(unsigned int) 第 406 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CDependencyObject::Release() 第 68 行 C++ Windows.UI.Xaml.dll!DirectUI::DependencyObject::DisconnectFrameworkPeerCore() 第 508 行 C++ [内联框架] Windows.UI.Xaml.dll!DirectUI::DependencyObject::DisconnectFrameworkPeer(unsigned int) 第 547 行 C++ Windows.UI.Xaml.dll!DirectUI::DependencyObject::OnFinalRelease() 第 405 行 C++ Windows.UI.Xaml.dll!ctl::ComBase::ReleaseImpl() 第 299 行 C++ [内嵌框架] Windows.UI.Xaml.dll!ctl::ComBase::ReleaseDirect() 第 113 行 C++ [内嵌框架] Windows.UI.Xaml.dll!ctl::release_interface_inner(ctl::WeakReferenceSourceNoThreadId *) 第 62 行 C++ Windows.UI.Xaml.dll!DirectUI::UIAffinityReleaseQueue::DoCleanup(unsigned char bSync, unsigned char * completed) 第 195 行 C++ Windows.UI.Xaml.dll!DirectUI::UIAffinityReleaseQueue::BuildTree(unsigned char * returnValue) 第 44 行 C++ Windows.UI.Xaml.dll!DirectUI::BuildTreeService::BuildTrees(bool * pWorkLeft) 第 111 行 C++ Windows.UI.Xaml.dll!AgCoreCallbacks::FrameworkCallbacks_PhasedWorkDistributor_PerformWork(unsigned int * pWorkleft) 第 560 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CFxCallbacks::FrameworkCallbacks_PhasedWorkDistributor_PerformWork(unsigned int *) 第 1131 行 C++ Windows.UI.Xaml.dll!CCoreServices::NWDrawTree(HWWalk * pHWWalk, CWindowRenderTarget * pRenderTarget, VisualTree * pVisualTree, unsigned int forceRedraw, XRECT_WH * prcDirtyRect) 第 6982 行 C++ Windows.UI.Xaml.dll!CCoreServices::NWDrawMainTree(CWindowRenderTarget * pIRenderTarget, bool fForceRedraw, XRECT_WH * prcDirtyRect) 第 6723 行 C++ Windows.UI.Xaml.dll!CWindowRenderTarget::Draw(CCoreServices * fForceRedraw, unsigned int prcDirtyRect, XRECT_WH *) 第 137 行 C++ Windows.UI.Xaml.dll!CXcpBrowserHost::OnTick() 第 538 行 C++ Windows.UI.Xaml.dll!CXcpDispatcher::Tick() 第 1446 行 C++ Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND__ * msg, unsigned int lParam, unsigned int64) 第 1046 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CXcpDispatcher::ProcessMessage(HWND *) 第 887 行 C++ Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) 第 836 行 C++ Windows.UI.Xaml.dll!CDeferredInvoke::DispatchQueuedMessage(bool * dispatchedWork, bool * hasMoreWork) 第 299 行 C++ [内嵌框架] Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallback() 第 1531 行 C++ Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallbackStatic(void * myUserData) 第 1523 行 C++ CoreMessaging.dll!00007ff88ec472bc() 未知 CoreMessaging.dll!00007ff88ec6863d() 未知 CoreMessaging.dll!00007ff88ec4c150() 未知 CoreMessaging.dll!00007ff88ec4b270() 未知 CoreMessaging.dll!00007ff88ec4a175() 未知 CoreMessaging.dll!00007ff88ec49fac() 未知 user32.dll!00007ff89301ca66() 未知 user32.dll!00007ff89301c78c() 未知 user32.dll!00007ff89302fa83() 未知 ntdll.dll!00007ff894ee3494() 未知 win32u.dll!00007ff8916610c4() 未知 user32.dll!00007ff89301e4e2() 未知 user32.dll!00007ff89301e3be() 未知 Windows.UI.dll!00007ff888bb5232() 未知 Windows.UI.dll!00007ff888bb502e() 未知 Windows.UI.dll!00007ff888bb4edb() 未知 Windows.UI.Xaml.dll!CJupiterWindow::RunCoreWindowMessageLoop() 第 1246 行 C++ [内联框架] Windows.UI.Xaml.dll!CJupiterControl::RunMessageLoop() 第 1024 行 C++ Windows.UI.Xaml.dll!DirectUI::DXamlCore::RunMessageLoop() 第 2446 行 C++ twinapi.appcore.dll!00007ff88f574c2a() 未知 twinapi.appcore.dll!00007ff88f547a66() 未知 SHCore.dll!00007ff8931dc315() 未知 kernel32.dll!00007ff892087974() 未知 ntdll.dll!00007ff894eaa271() 未知
请帮帮我。
我从 XAML 中删除了“{x:Null}”,在我所有 IValueConverter 的 ConvertBack 方法中将抛出 NotImplementedException 更改为 DependencyProperty.UnsetValue。但这并没有解决我的问题。
【问题讨论】:
-
请提供minimal reproducible example以获取更多诊断信息。
-
我找到了难以置信的解决方案。请参阅下面的评论。