open-telemetry / open-telemetry/opentelemetry-cpp

trace.FastRandomNumberGeneratorTest.GenerateUniqueNumbers fails for alpine linux

Open
#3,062 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe your environment

Alpine Linux Edge, on different architectures (see below)

Steps to reproduce

I tried to update the alpine packages for opentelemetry-cpp from 1.11 to 1.16, unfortunately I get this issue with all supported platforms:

https://gitlab.alpinelinux.org/svrnm/aports/-/pipelines/258676

/builds/svrnm/aports/testing/opentelemetry-cpp/src/opentelemetry-cpp-1.16.1/sdk/test/common/fast_random_number_generator_test.cc:20: Failure
Value of: values.insert(random_number_generator()).second
  Actual: false
Expected: true

To reproduce I have the following code prepared, and I was able to reproduce the issue locally

https://github.com/svrnm/otel-abuild

What is the expected behavior?

The test should succeed.

What is the actual behavior?

Te thest is failing.

Additional context

I tried to fix the issue myself, I have a few findings but none of them helped me to find a final solution:

  • The issue shows up when GCC14 is used (in alpine edge), but does not show up with GCC13 (with alpine non-edge)
  • When I add some code to output the number in the test.cc file it's always 0

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.

Research direction

Start with sdk/test/common/fast_random_number_generator_test.cc and run trace.FastRandomNumberGeneratorTest.GenerateUniqueNumbers on Alpine Linux Edge with GCC14, then compare the result with GCC13. Investigate why values.insert(random_number_generator()) returns false and why the generated value is always 0; done means the test succeeds on the affected supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.