Garbage pointer dereference when using OTLP GRPC exporter with inacessible endpoint #3215
Labels
bug
Something isn't working
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Describe your environment
x86_64, Ubuntu-22.04, bazel 7.40, opentelemetry-cpp 1.16.0 and 1.18.0
Steps to reproduce
Lazily setup otel like so (my setup had a lot more indirection, this code doesn't actually crash for me) and run with
OTEL_EXPORTER_OTLP_ENDPOINT=127.0.0.1:1337
or some other address that isn't a valid endpoint.In my actual environment where it reproduces, I'm launching python then calling into a pybind11 module which I built which calls
otel_tracer()
above and creates a few spans. The crash occurs in the grpc exporter aftermain
returns, see below.What is the expected behavior?
Program exits normally
What is the actual behavior?
Crash in https://github.com/open-telemetry/opentelemetry-cpp/blob/main/sdk/include/opentelemetry/sdk/common/global_log_handler.h#L162
Additional context
gdb session:
Applying this patch prevents the destruction of the global handler and thus prevents it from crashing
The text was updated successfully, but these errors were encountered: