TracerContext construction might result in a terminate

Open Beginner friendly
#4,684 2 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@akshat-lakhera is already working on this.

Since Oct 12, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
observability

Research direction

The problem is the TracerContext constructor in sdk/src/trace/tracer_context.cc, around line 38 at the linked commit, which is marked noexcept but can throw std::bad_alloc, so an allocation failure calls std::terminate. Start by reading that constructor and the members it allocates, then decide whether to drop the noexcept specifier or handle the allocation failure. Done means the constructor's exception behaviour matches its declaration and the project's existing tests still pass.

Written by the indexing model from the issue text.

Description

triage/accepted
Dominant language
C++
Stars
1.4k
Forks
663
Avg merge
1d 10h
Merged PRs (30d)
44

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from open-telemetry/opentelemetry-cpp

All issues in open-telemetry/opentelemetry-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.