Skip to content

Application crash - try to instrument by non-existing class #1469

Description

@Kielek

Bug Report

Symptom

Describe the bug
Instrumented application is crashing when you try to use non-existing bytecode instrumentation.


Xunit.Sdk.XunitException
Expected process.ExitCode to be 0 because Test application exited with non-zero exit code, but found -532462766 (difference of -532462766).
   at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message)
   at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc)
   at FluentAssertions.Numeric.NumericAssertions`2.Be(T expected, String because, Object[] becauseArgs)
   at IntegrationTests.Helpers.TestHelper.RunTestApplication(TestSettings testSettings) in C:\GitHub\opentelemetry-dotnet-instrumentation\test\IntegrationTests\Helpers\TestHelper.cs:line 170
   at IntegrationTests.Helpers.TestHelper.RunTestApplication(Int32 traceAgentPort, Int32 otlpTraceCollectorPort, Int32 metricsAgentPort, Int32 logsAgentPort, String arguments, String packageVersion, String framework, Int32 aspNetCorePort, Boolean enableStartupHook, Boolean enableClrProfiler) in C:\GitHub\opentelemetry-dotnet-instrumentation\test\IntegrationTests\Helpers\TestHelper.cs:line 140
   at IntegrationTests.SmokeTests.<SubmitMetrics>d__9.MoveNext() in C:\GitHub\opentelemetry-dotnet-instrumentation\test\IntegrationTests\SmokeTests.cs:line 146
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 264
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.ExecutionTimer.<AggregateAsync>d__4.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.ExceptionAggregator.<RunAsync>d__9.MoveNext() in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90

Platform: X64
Configuration: Debug
TargetFramework: net462
.NET Core: False
Found profiler at C:\GitHub\opentelemetry-dotnet-instrumentation\bin\tracer-home\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll.
Profiler DLL: C:\GitHub\opentelemetry-dotnet-instrumentation\bin\tracer-home\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll
[TestHttpListener]: Listening on 'http://localhost:59163/v1/metrics/'
MockLogsCollector healthz endpoint: http://localhost:59163/v1/metrics//healthz
Starting Application: C:\GitHub\opentelemetry-dotnet-instrumentation\test\test-applications\integrations\TestApplication.Smoke\bin\x64\Debug\net462\TestApplication.Smoke.exe
Found integrations at C:\GitHub\opentelemetry-dotnet-instrumentation\bin\tracer-home\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll.
ProcessName: TestApplication.Smoke
ProcessId: 19144
Exit Code: -532462766
StandardOutput:
Command line: 
Platform: x64
Environment variables:
	COR_ENABLE_PROFILING = 1
	COR_PROFILER = {918728DD-259F-4A6A-AC2B-B85E1B658318}
	COR_PROFILER_PATH = C:\GitHub\opentelemetry-dotnet-instrumentation\bin\tracer-home\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll
	OTEL_DOTNET_AUTO_DEBUG = 1
	OTEL_DOTNET_AUTO_HOME = C:\GitHub\opentelemetry-dotnet-instrumentation\bin\tracer-home
	OTEL_DOTNET_AUTO_INCLUDE_PROCESSES = TestApplication.Smoke.exe
	OTEL_DOTNET_AUTO_INTEGRATIONS_FILE = C:\GitHub\opentelemetry-dotnet-instrumentation\bin\tracer-home\integrations.json
	OTEL_DOTNET_AUTO_LOG_DIRECTORY = C:\GitHub\opentelemetry-dotnet-instrumentation\build_data\profiler-logs
	OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES = MyCompany.MyProduct.MyLibrary
	OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES = TestApplication.*
	OTEL_DOTNET_AUTO_TRACES_ENABLED_INSTRUMENTATIONS = HttpClient
	OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:59163
	OTEL_METRICS_EXPORTER = otlp
	OTEL_SERVICE_NAME = TestApplication.Smoke

StandardError:

Unhandled Exception: System.TypeLoadException: Could not load type 'OpenTelemetry.AutoInstrumentation.Instrumentations.Logger.LoggingBuilderIntegration' from assembly 'OpenTelemetry.AutoInstrumentation, Version=0.3.1.0, Culture=neutral, PublicKeyToken=c0db600a13f60b51'.
   at Microsoft.Extensions.Logging.LoggingBuilder..ctor(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.LoggingServiceCollectionExtensions.AddLogging(IServiceCollection services, Action`1 configure)
   at Microsoft.Extensions.Logging.LoggerFactory.Create(Action`1 configure)
   at TestApplication.Smoke.Program.EmitLogs()
   at TestApplication.Smoke.Program.Main(String[] args)

[MockMetricsCollector]: Shutting down.
[TestHttpListener]: Listener is shutting down.

Expected behavior
Application will log error instead of crashing.

Additional context
Add any other context about the problem here.

Reproduce

Steps to reproduce the behavior:

Execute IntegrationTests.SmokeTests.SubmitMetrics from #1421

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done/Cut

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions