VS2015 因“A new guard page..."崩溃刚编辑源代码时 [英] VS2015 crashing with "A new guard page..." when just editing source code

查看:74
本文介绍了VS2015 因“A new guard page..."崩溃刚编辑源代码时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

Visual Studio 2015 不断因此错误而崩溃:

无法为堆栈创建新的保护页

背景:

在其他上下文中已经有一些关于此错误的问题,但它们似乎都与在 Visual Studio 中与遗留 COM 代码或设计器工具的互操作有关.我只是想编辑一个 C# 源文件.

我还注意到,当错误对话框弹出时,但在我单击确定"之前,许多 Visual Studio 进程在任务管理器中看起来仍然正常.devenvPerfWatsonVsHubMicrosoft.VsHub.Server.HttpHost 都仍在运行并且有波动的工作设置、句柄和线程统计信息.VBCSCompilerMSBuild 仍在运行,但没有波动(这通常是不运行构建时的情况).

VS2015 Update 1 和升级到 Update 3 后均出现问题.

问题出在 Code Contracts v1.9,尝试卸载并重新安装 CC 1.9 没有效果.

可能的修复方法?

安装了 CC v1.10-RC2 并且我已经工作了几分钟而没有 VS 崩溃.

将在以下任一情况下发布跟进:

  • 发生更多崩溃,或者最好
  • 我完成了一整天的工作而没有崩溃

解决方案

我是否认为这是 Roslyn 的问题?

我认为 Roslyn 不太可能是导致此问题的直接原因.特别是因为这块数据.

<块引用>

当我在 ccdocgen 中使用 VS2013 时,构建时偶尔会出现错误,但它只会崩溃 ccdocgen,而不是 VS

Roslyn 直到 VS2015 才发布.在此之前,编译器是一段完全不同的代码(本机与托管).虽然这两个编译器可能都有相同的错误,但这种特定类型的问题不太可能.

我认为这更有可能是代码合同的问题.尤其是 Roslyn 和本机编译器,会生成导致代码契约问题的相同 IL 序列.

我将把此事通知代码合同团队,看看他们的分析是什么.

The Problem:

Visual Studio 2015 keeps crashing with this error:

A new guard page for the stack cannot be created

Background:

There are already a few questions out there regarding this error in other contexts, but they all appear to be related to interoperating with legacy COM code or designer tools in Visual Studio. I am just trying to edit a C# source file.

Windows service / A new guard page for the stack cannot be created

A new guard page for the stack cannot be created

Previously, I've only seen this error when using the Code Contracts XML documentation tool ccdocgen.exe. When I was using VS2013 with ccdocgen, the error came up occasionally when building, but it would only crash ccdocgen, not VS. After upgrading to VS2015 I've seen it very frequently when building anything that uses anonymous methods if I'm using ccdocgen, but until now it was still only crashing ccdocgen and not VS. Also worth pointing out is that the error dialog looks slightly different when the error is thrown on build by ccdocgen.

Context:

The solution I'm currently working on uses Code Contracts for pre-conditions and post-conditions, but does not utilize the static checker at all. I am getting this error while editing code, just doing simple things like typing, selecting text, using Ctrl+C or Ctrl+X. Since that's started, I've disabled all of the Code Contracts tools on the project I'm currently working on (but not in the entire solution), but the error is still coming up sporadically.

Based on answers to other questions regarding this error message, it is caused by a stack overflow somewhere. Since this error is happening when just editing text, and I've only run into it since I've moved to VS2015, my assumption is that it is related to some background parsing that Roslyn is doing.

Some Code: Edit: I got the error with both versions of this property commented out, so that's not it.

This is the member that I believe is causing the issue:

public DataView JoinedRecords =>
    (from r1 in Table1.AsEnumerable()
    join r2 in Table2.AsEnumerable()
           on r1.Field<int>("ID") equals r2.Field<int>("ID")
    where r2.Field<bool>("IsPending")
    select r1)
    .CopyToDataTable().AsDataView();

If I drop the query syntax, it throws errors less frequently:

public DataView JoinedRecords =>
    query = Table1.AsEnumerable()
        .Join(Table2.AsEnumerable(),
            r1 => r1.Field<int>("ID"),
            r2 => r2.Field<int>("ID"),
            (r1, r2) => r1)
        .CopyToDataTable().AsDataView();

Questions:

  • Has anyone else had this issue?
  • Am I right in believing this is a Roslyn issue?
  • How can I get more data on the crash? Is there a handy VS error log I can find?
  • Am I missing something?

Edit: Additional troubleshoot steps

As suggested by this post (Visual Studio 2015 Not Working), I used the crash recorder to send the issue to Microsoft.

I also ran VS with the /log argument and found 2 errors in the log, but they don't sound very relevant.

<entry>
    <record>563</record>
    <time>2016/06/29 16:00:08.841</time>
    <type>Error</type>
    <source>Extension Manager</source>
    <description>Extension will not be loaded because an extension with the same ID &apos;Microsoft.Windows.DevelopmentKit.Desktop&apos; is already loaded at C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.0\DESKTOP SDK\...</description>
    <path>C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.1\DESKTOP SDK\</path>
  </entry>
  <entry>
    <record>564</record>
    <time>2016/06/29 16:00:09.587</time>
    <type>Error</type>
    <source>Color Theme Service</source>
    <description>The color &apos;Popup&apos; in category &apos;de7b1121-99a4-4708-aedf-15f40c9b332f&apos; does not exist.     </description>
  </entry>


Edit 2: More details

Error dialog:

I also noticed, when the error dialog pops up, but before I click 'OK', many of the Visual Studio processes still look normal in the Task Manager. devenv, PerfWatson, VsHub, and Microsoft.VsHub.Server.HttpHost are all still running and have fluctuating Working Set, Handles, and Threads stats. VBCSCompiler and MSBuild are still running, but without fluctuations (which is normally the case when not running a build).

Edit:

Issue occurred on both VS2015 Update 1 and after upgrading to Update 3.

Issue has been with Code Contracts v1.9, tried uninstall and re-install of CC 1.9 to no effect.

Possible Fix?

Installed CC v1.10-RC2 and I've been working for a few minutes without VS crashing.

Will post follow-up when either:

  • More crashes happen, or preferably
  • I get through an entire day of work without crashes

解决方案

Am I right in believing this is a Roslyn issue?

I think that it's unlikely Roslyn is the direct cause of this problem. In particular because of this piece of data.

When I was using VS2013 with ccdocgen, the error came up occasionally when building, but it would only crash ccdocgen, not VS

Roslyn didn't ship until VS2015. Before that the compiler was a completely different piece of code (native vs. managed). While it's possible both compilers had the same bug here it's unlikely for this specific type of issue.

I think it's more likely an issue with Code Contracts. In particular Roslyn, and the native compiler, produce the same sequence of IL that is causing an issue with Code Contracts.

I'm going to notify the Code Contracts team about this and see what their analysis is.

这篇关于VS2015 因“A new guard page..."崩溃刚编辑源代码时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆