-
Notifications
You must be signed in to change notification settings - Fork 764
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
Enabling RecordException on ASP.net throws System.AccessViolationException #3593
Comments
Getting this exception on startup after upgrading OpenTelemetry.Extensions.Hosting to 1.0.0-rc9.6 |
Getting it after bumping Reverting just |
I also encountered this after bumping instrumentation packages from See below for a minimal repro that consistently fails for My working theory is that it involves some of the dynamically built IL methods that are used to enumerate tags from activity events. This theory is based on those methods being the last ones my debugger could step to before the app crash. While trying to reproduce this, I found that the app crash reproduces when an Minimal repro<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<OutputType>exe</OutputType>
<TargetFrameworks>net48;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenTelemetry.Api" Version="1.4.0-alpha.2" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.0" />
</ItemGroup>
</Project> using System;
using System.Collections.Generic;
using System.Diagnostics;
using OpenTelemetry;
using OpenTelemetry.Trace;
Console.WriteLine("Starting");
using (Sdk.CreateTracerProviderBuilder().AddOtlpExporter().AddSource("some_activity_source").Build())
{
using var activitySource = new ActivitySource("some_activity_source");
using var activity = activitySource.StartActivity("some_activity");
activity?.AddEvent(new ActivityEvent(
"some_activity_event",
DateTimeOffset.UtcNow,
new ActivityTagsCollection(new KeyValuePair<string, object?>[]
{
new("some_activity_event_tag_0", "some_activity_event_tag_value_0"),
new("some_activity_event_tag_1", "some_activity_event_tag_value_1"),
new("some_activity_event_tag_2", "some_activity_event_tag_value_2")
})));
}
Console.WriteLine("Complete");
|
@austindrenski Hey I'm still looking into why this is happening, but FYI if you do this... <ItemGroup>
<PackageReference Include="OpenTelemetry.Api" Version="1.4.0-alpha.2" />
- <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.0" />
+ <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.4.0-alpha.2" />
</ItemGroup> ...then the sample project above starts to works fine. |
thanks for the workaround. I got the same error this morning |
We are treating this error as P0, and will be releasing 1.3.1 hotfix. Please expect the details and patch release by next Tuesday. |
Closing as the hotfix has been released. See #3629 |
Bug Report
List of [all OpenTelemetry NuGet
Runtime version: NET 6.0
Symptom
Get an exception:
What is the expected behavior?
The expected behavior would be to have exception details in trace.
If I disable RecordException everything works fine.
The text was updated successfully, but these errors were encountered: