Closed snehilchopra closed 4 years ago
@pyohannes @reyang @maxgolov
I think the reason is that our Context
implementation is not memory safe. A gobal context_handler_
is initialized, but never de-initialized.
I will look into sanitizing and stabilizing the Context
part.
This affects all similar examples (e.g. the OTLP exporter example). As a workaround, I could add calls to span.End()
in the examples. What are your thoughts?
I've created an OTLP exporter example using explicit calls to span->End()
(https://github.com/open-telemetry/opentelemetry-cpp/pull/296). These calls should be removed once this issue is resolved.
BTW the zPages example is buggy too, which is related to running spans that don't end I believe
End()
calls are added for spans (this is required now). Also, #321 fixes the memory problems related to the global context_handler_
variable.
The simple example does not seem to be working. I believe this is because the span destructor is not being invoked, which in turn invokes the
span.End()
method.As a workaround, one has to explicitly call the
span.End()
method.However, this is causing a lot of memory leaks. I tried running the example with
bazel run --config=asan //example/simple:example_simple
, and the report is too long to be pasted here.I believe this has something to do with the newly implemented Runtime context, as per the report.
Any insights on this would be really appreciated, thanks!