Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Diagnostics.DiagnosticSource Causing Error Evaluating the function timedout #44503

Closed
b3hdad opened this issue Nov 11, 2020 · 41 comments
Closed

Comments

@b3hdad
Copy link

b3hdad commented Nov 11, 2020

Description

When I upgrade the package System.Diagnostics.DiagnosticSource from 4.7.1 to 5.0.0, I get the error saying:

Evaluating the function 'System.Diagnostics.TraceInternal.Listeners.get' timedout and needed to be aborted in a unsafe way. This may have corrupted the target process.

I undertand that this page shows how to disable the error but I still thought report it.

Currently I have stopped upgrading this package. Thank you for following up.

Configuration

.Net Framework 4.8
Windows 10
x64

@ghost
Copy link

ghost commented Nov 11, 2020

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.


Issue meta data
Issue content:

Description

When I upgrade the package System.Diagnostics.DiagnosticSource from 4.7.1 to 5.0.0, I get the error saying:

Evaluating the function 'System.Diagnostics.TraceInternal.Listeners.get' timedout and needed to be aborted in a unsafe way. This may have corrupted the target process.

I undertand that this page shows how to disable the error but I still thought report it.

Currently I have stopped upgrading this package. Thank you for following up.

Configuration

.Net Framework 4.8
Windows 10
x64

Issue author: b3hdad
Assignees: -
Milestone: -

@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Nov 11, 2020
@b3hdad
Copy link
Author

b3hdad commented Nov 11, 2020

Just wanted to add a bit more to this. I tried step 3, in the workaround link and still get the pop up error when I run the project. Only step 4 seems to prevent this error.

@tarekgh
Copy link
Member

tarekgh commented Nov 11, 2020

CC @noahfalk

@tommcdon
Copy link
Member

tommcdon commented Nov 13, 2020

@b3hdad To investigate help us investigate the expression evaluation timeout, it would be useful if you could send us a dump of the debuggee and debugger when the timeout occurs. These dumps can be automatically collected by enabling a VS specific regkey.

From an admin command prompt (while VS is closed), navigate to the Common7\IDE folder under your VS installation and run:

vsregedit set local HKCU AD7Metrics\Engine\{FB0D4648-F776-4980-95F8-BB7F36EBC1EE} FuncEvalAbortLoggingLevel dword 1

This should cause dumps of the debugger and the debuggee to be created in your temp directory, and if you share those dumps with us we can use them to investigate why the timeout is occurring. The dump collection can be disabled by rerunning the same command, but using "dword 0" instead of "dword 1".

One important note: that regkey will only enable dump collection for desktop framework applications. To enable collection for .NET Core applications replace {FB0D4648-F776-4980-95F8-BB7F36EBC1EE} with {2E36F1D4-B23C-435D-AB41-18E608940038}

To send the dumps to us, feel free to open a Visual studio feedback item and then attach the files to it and then send paste a link to the feedback item.

@fcorbeil
Copy link

The problem is related to ApplicationInsightsTraceListener. Removing it from the web.config "fixes" the problem...

<configuration>
  <system.diagnostics>
    <trace autoflush="true" indentsize="0">
      <listeners>
        <add name="myAppInsightsListener" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

@b3hdad
Copy link
Author

b3hdad commented Nov 13, 2020

@fcorbeil, yes, thank you, that fixed the issue. Will this affect my application insights? Should I put this back later on?

Also thanks to everyone following it up.

@fcorbeil
Copy link

@b3hdad, I confirm it'll disable your Application Insights... This is the reason why I added quotation marks on "fixes".

@b3hdad
Copy link
Author

b3hdad commented Nov 13, 2020

@fcorbeil, I see, thank you. Its early morning here on Saturday. Sorry, missed the quotation marks meaning. :)

@panuoksala
Copy link

Experiencing same problem when updated .NET Framework 4.6.1 project to use the latest AI nuget. Step #4 in the workaround link works for me too.

@b3hdad
Copy link
Author

b3hdad commented Nov 17, 2020

@panuoksala, will you be able to create the debug information for @tommcdon please? Working in environment subject to some regulations, I may not be able to get permissions soon enough to produce and post what is required.

@shirhatti
Copy link
Contributor

cc @cijothomas

@panuoksala
Copy link

What those dump should look like?
Got directories called like this after running the debug dia: Report.5918B293-AF6E-4B98-8028-8529BFF53A6F, 5918b293-af6e-4b98-8028-8529bff53a6f.PackageExtraction, VSTelem and VSTelemOut

@tommcdon
Copy link
Member

@panuoksala Whenever an evaluation is aborted a message will shown with the location and name of the dump files.

@karelkrivanek
Copy link

@tommcdon > One important note: that regkey will only enable dump collection for desktop framework applications. To enable collection for .NET Core applications replace "FB0D4648-F776-4980-95F8-BB7F36EBC1EE" with "2E36F1D4-B23C-435D-AB41-18E608940038"

Should there be different guid for webforms?

@tommcdon
Copy link
Member

@karelkrivanek I believe "FB0D4648-F776-4980-95F8-BB7F36EBC1EE" is the right guid, assuming that webforms is running on .NET Framework 4.x.

@gavinbarron
Copy link

When you say Temp directory do you mean the one at C:\Windows\Temp?

I have a .Net 4.7.2 WebApi project (not MVC) that has the same issue and I'm trying to get you some dumps to help diagnose this but can't find the dumps, or they were not created.

@panuoksala
Copy link

panuoksala commented Nov 26, 2020

@panuoksala Whenever an evaluation is aborted a message will shown with the location and name of the dump files.

This is the message:
image

I'm using Visual Studio 2019 Enterprise, project is .NET Framework 4.6.1 Web API project.

@tiaan-lg
Copy link

I experienced the issue when I updated Application insights nuget to 2.16 and it auto-updated this nuget to 5.0.0 as a dependency.

I can replicate the issue, but I'm also not sure where the dump files are located

@gavinbarron
Copy link

Not sure who posted and then removed the comment that the dumps are in %temp% but thanks to that person I have submitted a dump through the Visual Studio feedback tool.

@panuoksala
Copy link

Not sure who posted and then removed the comment that the dumps are in %temp% but thanks to that person I have submitted a dump through the Visual Studio feedback tool.

It was me. I tried to search for actual filenames, but wasn't able to find them, glad you got it and hopefully we can get this fixed now. I have the same reason for update as @tiaan-lg.

@tommcdon
Copy link
Member

Not sure who posted and then removed the comment that the dumps are in %temp% but thanks to that person I have submitted a dump through the Visual Studio feedback tool.

Thanks! Would it be possible to share a link to the community item?

For others commenting on the location of the dump. VS should show a dialog similar to this which contains the path to the dump:

image

@gavinbarron
Copy link

@tommcdon
Copy link
Member

tommcdon commented Dec 2, 2020

Here's the link: https://developercommunity2.visualstudio.com/t/Upgrading-to-SystemDiagnosticsDiagnost/1270524?port=1025&fsid=248584ff-4927-4143-a95c-37d3cd710d93&entry=myfeedback

FWIW: I didn't get the dialog you're showing here @tommcdon, I got the dialog that @panuoksala shows above.

Thanks for opening the community issue! Unfortunately it doesn't have the dump of the debuggee (iisexpress.exe or dotnet.exe). When setting the reg key, 1) double check that the curly braces are around the guid, 2) vsregedit is running in the right instance of VS (if you have multiple installations), 3) try closing VS first, run vsregedit, then restart VS.

vsregedit set local HKCU AD7Metrics\Engine\{FB0D4648-F776-4980-95F8-BB7F36EBC1EE} FuncEvalAbortLoggingLevel dword 1

Alternatively, if there is a small, reproducible test project, please feel free to send that along.

@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Dec 7, 2020
@tommcdon tommcdon added this to the 6.0.0 milestone Dec 7, 2020
@tommcdon tommcdon self-assigned this Dec 7, 2020
@ghost ghost removed the no-recent-activity label Dec 31, 2020
@fcorbeil
Copy link

I generated the dump and sent it using the "Reconsider" button at https://developercommunity2.visualstudio.com/t/Upgrading-to-SystemDiagnosticsDiagnost/1270524?port=1025&fsid=248584ff-4927-4143-a95c-37d3cd710d93&entry=myfeedback.

image

@fcorbeil
Copy link

Just let you know I have created a new Visual Studio feedback item : https://developercommunity2.visualstudio.com/t/SystemDiagnosticsTraceInternalListen/1299563?entry=myfeedback

Note 1 : I did this because sending a "Reconsider" feedback was done in less than a second with about 1.5GB of dump!?
Note 2 : Sending a new Visual Studio feedback item also took less than a second, I doubt it worked... :(

@tommcdon
Copy link
Member

tommcdon commented Jan 4, 2021

Just let you know I have created a new Visual Studio feedback item : https://developercommunity2.visualstudio.com/t/SystemDiagnosticsTraceInternalListen/1299563?entry=myfeedback

Thank you! I have received the dumps and we are investigating.

@parikshitsehgal
Copy link

image
VS 2019 - 4.7.1 - Getting this error after upgrading packages to latest

@ghost ghost added the no-recent-activity label Jan 22, 2021
@ghost
Copy link

ghost commented Jan 22, 2021

This issue has been automatically marked no recent activity because it has been marked as needs author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 more days. Any new comment (by anyone, not necessarily the author) will remove no recent activity

@panuoksala
Copy link

Still active and dumps are posted.

@ghost ghost removed the no-recent-activity label Jan 22, 2021
@MKGNZ
Copy link

MKGNZ commented Jan 25, 2021

@b3hdad, I confirm it'll disable your Application Insights... This is the reason why I added quotation marks on "fixes".

Still happening but I found out that it is only when debugging.
So I have removed it in web.config and then in Web.Realease.config I have:

<system.diagnostics>
        <trace autoflush="true" indentsize="0" xdt:Transform="InsertIfMissing">
            <listeners xdt:Transform="InsertIfMissing">
                <add name="myAppInsightsListener" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/>
            </listeners>
        </trace>
 </system.diagnostics>

@MKGNZ
Copy link

MKGNZ commented Jan 25, 2021

Just wanted to add a bit more to this. I tried step 3, in the workaround link and still get the pop up error when I run the project. Only step 4 seems to prevent this error.

Step 4 worked for me also but I lost the ability to Debug with "Edit & Continue" and the "Diagnostic Tools". So I removed it from the web.config and I did the above.

@cijothomas
Copy link
Contributor

Given its only occurring with ApplicationInsights enabled, please report this in https://github.com/Microsoft/ApplicationInsights-dotnet repo too. (ApplicationInsights team already have access to the dumps shared earlier.)

@panuoksala
Copy link

Done microsoft/ApplicationInsights-dotnet#2161

@Zapnologica
Copy link

I am also having this issue, is there any eta on the fix?

@ghost ghost added the no-recent-activity label Feb 16, 2021
@ghost
Copy link

ghost commented Feb 16, 2021

This issue has been automatically marked no recent activity because it has been marked as needs author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 more days. Any new comment (by anyone, not necessarily the author) will remove no recent activity

@ghost ghost removed the no-recent-activity label Feb 16, 2021
@vijayrkn
Copy link
Contributor

@cijothomas - Since there is an issue already created on the App Insights SDK GitHub repo with the information, do you need anything else to proceed with this? microsoft/ApplicationInsights-dotnet#2161

We have a developer community issue on the VS side - https://developercommunity2.visualstudio.com/t/SystemDiagnosticsTraceInternalListen/1299563, Should we just dupe it to the SDK issue?

@vijayrkn
Copy link
Contributor

vijayrkn commented Mar 1, 2021

@cijothomas - Ping on this. Is it okay to close the devcommunity ticket in favor of the sdk issue? microsoft/ApplicationInsights-dotnet#2161

@cijothomas
Copy link
Contributor

@vijayrkn Yes.

@ghost
Copy link

ghost commented Mar 16, 2021

This issue has been automatically marked no recent activity because it has been marked as needs author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 more days. Any new comment (by anyone, not necessarily the author) will remove no recent activity

@ghost ghost closed this as completed Mar 23, 2021
@ghost ghost removed the no-recent-activity label Apr 10, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 10, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests