open-telemetry / open-telemetry/opentelemetry-cpp

[ETW] ETW log exporter possible memory ownership issues

Open
#3,418 3 comments 0 reactions 1 assignee View on GitHub

@ThomsonTan is already working on this.

Since May 16, 2025.

bug Stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

This is not confirmed with testing, only a suspicion raised by code review.

The ostream log exporter has memory ownership issues that can lead to crashes.

See related:

  • #3135
  • #2651
  • #3417
  • #3147

It turns out (seen by code review) that file etw_logger.h uses exactly the same pattern,
so it should be subject to the same issues.

  std::unordered_map<std::string, opentelemetry::common::AttributeValue> attributes_map_;
  opentelemetry::common::AttributeValue body_ = opentelemetry::nostd::string_view();

attributes_map_ and body_ can contain stale pointers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.