2016-02-03 79 views
1

在我们的Windows 10 UWP应用程序中,我们在随机页面导航期间遭受堆损坏。时序和位置总是不同,但结果相同,当Native调试打开时堆损坏,关闭时立即崩溃。堆腐败窗口10

以下是堆损坏时的调用堆栈,其中包含尽可能多的信息,因为我们可以从Visual Studio收集这些信息。

[email protected]() 
[email protected]() 
[email protected]() 
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) 
[email protected]() 
user32.dll!UserCallWinProcCheckWow() 
user32.dll!DispatchMessageWorker() 
[email protected]() 
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 * *) 
[email protected]@12() 
ntdll.dll!__RtlUserThreadStart() 
[email protected]() 

任何人都有机会遇到这个问题,或者接近问题并设法解决它?提前致谢。

编辑! 有一些新的信息!可悲的是没有锁定,但尚未取得进展... :)

原来,问题是由用于创建自适应接口VisualStateGroups造成如下所示:

<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> 

如果我停用上述statetrigger的应用程序不会崩溃,可悲的是我需要这种状态内的逻辑......任何可能的工作或解释我做错了什么?

+0

通常我们不会使用这种样式。你认为你想达到什么目的? –

+0

我想调整GridView的背景颜色,基于页面中控件上添加的IsSelectable属性的设置。 大部分我想知道为什么使用绑定来设置StateTrigger的值会导致堆损坏。我使用的设置不应该是那么奇怪,如果你问我... 任何反馈或工作将受到欢迎:) –

+0

@ GraceFeng-MSFT所以没有办法提供一个StateTrigger的值使用绑定在MVVM结构化应用? –

回答