Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Uwp 堆损坏windows 10_Uwp_Heap Corruption_Visualstates_Adaptive Ui - Fatal编程技术网

Uwp 堆损坏windows 10

Uwp 堆损坏windows 10,uwp,heap-corruption,visualstates,adaptive-ui,Uwp,Heap Corruption,Visualstates,Adaptive Ui,在我们的Windows10UWP应用程序中,我们在随机页面导航过程中遇到堆损坏。时间和位置总是不同的,但结果是相同的,打开本机调试时堆损坏,关闭调试时立即崩溃 下面是堆损坏时的调用堆栈,其中包含了我们从VisualStudio收集到的尽可能多的信息 ntdll.dll!_RtlReportCriticalFailure@8() ntdll.dll!_RtlpHeapHandleError@4() ntdll.dll!_RtlpLogHeapFailure@24() ntdll.dll!RtlSi

在我们的Windows10UWP应用程序中,我们在随机页面导航过程中遇到堆损坏。时间和位置总是不同的,但结果是相同的,打开本机调试时堆损坏,关闭调试时立即崩溃

下面是堆损坏时的调用堆栈,其中包含了我们从VisualStudio收集到的尽可能多的信息

ntdll.dll!_RtlReportCriticalFailure@8()
ntdll.dll!_RtlpHeapHandleError@4()
ntdll.dll!_RtlpLogHeapFailure@24()
ntdll.dll!RtlSizeHeap()
Windows.UI.Xaml.dll!XcpAllocation::OSMemoryFree(void * pAddress=0x0b4164f0)
Windows.UI.Xaml.dll!ctl::SupportErrorInfo::`scalar deleting destructor'(unsigned int)
Windows.UI.Xaml.dll!ctl::ComBase::OnFinalRelease()
Windows.UI.Xaml.dll!ctl::ComBase::ReleaseImpl()
Windows.UI.Xaml.dll!DirectUI::UIAffinityReleaseQueue::DoCleanup(unsigned char bSync='\0', unsigned char * pbCompleted=0x058ff5af)
Windows.UI.Xaml.dll!DirectUI::UIAffinityReleaseQueue::BuildTree(unsigned char * returnValue=0x058ff5f2)
Windows.UI.Xaml.dll!DirectUI::BuildTreeService::BuildTrees(bool * pWorkLeft=0x058ff62b)
Windows.UI.Xaml.dll!AgCoreCallbacks::FrameworkCallbacks_PhasedWorkDistributor_PerformWork(unsigned int * pWorkleft=0x058ff6a4)
Windows.UI.Xaml.dll!CCoreServices::NWDrawTree(HWWalk * pHWWalk=0x0082cab8, ICoreRenderTarget * pIRenderTarget=0x008fb444, VisualTree * pVisualTree=0x00886668, unsigned int forceRedraw=0, XRECT_WH * prcDirtyRect=0x058ff7f8)
Windows.UI.Xaml.dll!CCoreServices::NWDrawMainTree(ICoreRenderTarget * pIRenderTarget=0x008fb444, bool fForceRedraw=false, XRECT_WH * prcDirtyRect=0x058ff7f8)
Windows.UI.Xaml.dll!CWindowRenderTarget::Draw(CCoreServices * pCore=0x008f2ea0, unsigned int fForceRedraw=0, XRECT_WH * prcDirtyRect=0x058ff7f8)
Windows.UI.Xaml.dll!CXcpBrowserHost::OnTick()
Windows.UI.Xaml.dll!CXcpDispatcher::Tick()
Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND__ * msg=1026, unsigned int lParam=0, unsigned int hr=0x058ff41c, long reentrancyGuard)
Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND__ * hwnd=0x001906aa, unsigned int msg=1026, unsigned int wParam=0, long lParam=0)
user32.dll!__InternalCallWinProc@20()
user32.dll!UserCallWinProcCheckWow()
user32.dll!DispatchMessageWorker()
user32.dll!_DispatchMessageW@4()
Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessMessage(int bDrainQueue=1, int * pbAnyMessages=0x00000000)
Windows.UI.dll!Windows::UI::Core::CDispatcher::WaitAndProcessMessages(void * hEventWait=0x00000000)
Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessEvents(Windows::UI::Core::CoreProcessEventsOption options=CoreProcessEventsOption_ProcessUntilQuit)
Windows.UI.Xaml.dll!CJupiterWindow::RunCoreWindowMessageLoop()
Windows.UI.Xaml.dll!CJupiterControl::RunMessageLoop()
Windows.UI.Xaml.dll!DirectUI::DXamlCore::RunMessageLoop()
Windows.UI.Xaml.dll!DirectUI::FrameworkView::Run()
twinapi.appcore.dll!Windows::ApplicationModel::Core::CoreApplicationView::Run(void)
twinapi.appcore.dll!Microsoft::WRL::Details::Make<struct Microsoft::WRL::Details::InvokeHelper<struct Windows::Foundation::IAsyncActionCompletedHandler,class <lambda_e4b1934750ab38adfb74f12296e81f29>,2>,class <lambda_e4b1934750ab38adfb74f12296e81f29> &>(class <lambda_e4b1934750ab38adfb74f12296e81f29> &)
SHCore.dll!CallerIdentity::GetCallingProcessHandle(unsigned long,enum RUNTIMEBROKER_CALLERIDENTITY_CHECK,void * *)
kernel32.dll!@BaseThreadInitThunk@12()
ntdll.dll!__RtlUserThreadStart()
ntdll.dll!__RtlUserThreadStart@8()
ntdll.dll_RtlReportCriticalFailure@8()
ntdll.dll_RtlpHeapHandleError@4()
ntdll.dll_RtlpLogHeapFailure@24()
ntdll.dll!RtlSizeHeap()
Windows.UI.Xaml.dll!XcpAllocation::OSMemoryFree(void*pAddress=0x0b4164f0)
Windows.UI.Xaml.dll!ctl::SupportErrorInfo::`scalar deleting析构函数'(无符号整数)
Windows.UI.Xaml.dll!ctl::ComBase::OnFinalRelease()
Windows.UI.Xaml.dll!ctl::ComBase::ReleaseImpl()
Windows.UI.Xaml.dll!DirectUI::UIAffinityReleaseQueue::DoCleanup(无符号字符bSync='\0',无符号字符*pbCompleted=0x058ff5af)
Windows.UI.Xaml.dll!DirectUI::UIAffinityReleaseQueue::BuildTree(无符号字符*returnValue=0x058ff5f2)
Windows.UI.Xaml.dll!DirectUI::BuildTreeService::BuildTrees(bool*pWorkLeft=0x058ff62b)
Windows.UI.Xaml.dll!AgCoreCallbacks::FrameworkCallbacks\u PhasedWorkDistributor\u PerformWork(unsigned int*pWorkleft=0x058ff6a4)
Windows.UI.Xaml.dll!CCoreServices::NWDrawTree(HWWalk*pHWWalk=0x0082cab8,ICorerRenderTarget*pIRenderTarget=0x008fb444,VisualTree*pVisualTree=0x00886668,unsigned int-forceRedraw=0,XRECT_-WH*prcDirtyRect=0x058ff7f8)
Windows.UI.Xaml.dll!CCoreServices::NWDrawMainTree(ICoreRenderTarget*pIRenderTarget=0x008fb444,bool fForceRedraw=false,XRECT_WH*prcDirtyRect=0x058ff7f8)
Windows.UI.Xaml.dll!CWindowRenderTarget::Draw(CCoreServices*pCore=0x008f2ea0,unsigned int-fForceRedraw=0,XRECT\u WH*prcDirtyRect=0x058ff7f8)
Windows.UI.Xaml.dll!CXcpBrowserHost::OnTick()
Windows.UI.Xaml.dll!CXcpDispatcher::Tick()
Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND_*msg=1026,无符号整数lParam=0,无符号整数hr=0x058ff41c,长reentrancyGuard)
Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND_uuu*HWND=0x001906aa,无符号int msg=1026,无符号int wParam=0,长LPRAM=0)
user32.dll__InternalCallWinProc@20()
user32.dll!UserCallWinProcCheckWow()
user32.dll!DispatchMessageWorker()
user32.dll_DispatchMessageW@4()
Windows.UI.dll!Windows::UI::Core::CDDispatcher::ProcessMessage(int-bDrainQueue=1,int*pbAnyMessages=0x00000000)
Windows.UI.dll!Windows::UI::Core::CDispatcher::WaitAndProcessMessages(void*hEventWait=0x00000000)
Windows.UI.dll!Windows::UI::Core::CDDispatcher::ProcessEvents(Windows::UI::Core::CoreProcessEventsOptions=CoreProcessEventsOptions\U ProcessUntilQuit)
Windows.UI.Xaml.dll!CJupiterWindow::RunCoreWindowMessageLoop()
Windows.UI.Xaml.dll!CJupiterControl::RunMessageLoop()
Windows.UI.Xaml.dll!DirectUI::DXamlCore::RunMessageLoop()
Windows.UI.Xaml.dll!DirectUI::FrameworkView::Run()
twinapi.appcore.dll!Windows::ApplicationModel::Core::CoreApplicationView::Run(无效)
twinapi.appcore.dll!Microsoft::WRL::Details::Make(类&)
SHCore.dll!CallerIdentity::GetCallingProcessHandle(无符号长,枚举RUNTIMEBROKER\u CallerIdentity\u检查,void**)
内核32.dll@BaseThreadInitThunk@12()
ntdll.dll__RtlUserThreadStart()
ntdll.dll__RtlUserThreadStart@8()
有没有可能有人遇到过这个问题,或者接近这个问题并设法解决了呢?提前谢谢

编辑! 得到一些新信息!遗憾的是,目前还没有解决方案,但取得了进展……:)

结果表明,问题是由用于创建自适应界面的VisualStateGroup引起的,如下所示:

<Style TargetType="controls:CollectionView">
    <Setter Property="RelativePanel.AlignLeftWithPanel" Value="True"/>
    <Setter Property="RelativePanel.AlignRightWithPanel" Value="True"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="controls:CollectionView">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <GridView x:Name="List" 
                              Grid.Row="1" 
                              BorderBrush="Black" 
                              ItemsSource="{TemplateBinding ItemsSource}"
                              ItemTemplate="{TemplateBinding ItemTemplate}"
                              SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem, Mode=TwoWay}"
                              ShowsScrollingPlaceholders="False"
                              Background="Transparent"
                              RelativePanel.AlignLeftWithPanel="True"
                              RelativePanel.AlignRightWithPanel="True">
                    </GridView>

                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup>
                            <VisualState x:Name="UnSelectable">
                                <VisualState.StateTriggers>
                                    **<StateTrigger IsActive="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsNotSelectable}"/>**
                                </VisualState.StateTriggers>

                                <VisualState.Setters>
                                    <Setter Target="List.Background" Value="#AAAAAA"/>
                                    <Setter Target="List.IsHitTestVisible" Value="False"/>
                                </VisualState.Setters>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

****
如果我禁用上述状态触发器,应用程序将不会崩溃,不幸的是,我需要在这个状态内的逻辑。。。任何可能的解决方法或解释我做错了什么?

对于您的场景,可以解决问题,或者您可以使用为您的
GridView
设计两个不同的
Datatemplate


将ItemTemplateSelector用于
ItemsControl

通常我们不使用这种样式。您希望在视图中实现什么?我正在尝试根据页面控件上添加的IsSelectable属性的设置调整GridView的背景色。我最想知道的是,为什么使用绑定来设置StateTrigger的值会导致堆损坏。如果你问我,我使用的设置应该不会那么奇怪。。。欢迎您提供任何反馈或解决方法:)@GraceFeng MSFT因此无法使用MVVM结构化应用程序中的绑定提供StateTrigger及其值?那么,您的意思是您的页面中有一个
GridView
,每个项目都有“IsSelectable”属性?您想根据
IsSelectable
属性更改
GridView
每个项目的
背景颜色吗?很抱歉延迟响应,我没有看到它。@GraceFeng MSFT CollectionView具有IsSelectable属性,因此绑定到TemplateParent(CollectionView),它在其StateSetters中操纵GridView。但这确实是我想要实现的,实际目标是修改GridView中项目的背景,但这是我的第一步