Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

used uninitialized [-Werror=uninitialized] #37549

Closed
sergey-safarov opened this issue Dec 7, 2024 · 4 comments
Closed

used uninitialized [-Werror=uninitialized] #37549

sergey-safarov opened this issue Dec 7, 2024 · 4 comments
Labels
area/build stale stalebot believes this issue/PR has not been touched recently

Comments

@sergey-safarov
Copy link

Title: var used uninitialized [-Werror=uninitialized]

Description:
I compile master (a7758b8) sources on CentOS 9 using the command

bazel build -c opt envoy --subcommands --jobs 1 --verbose_failures --sandbox_debug

And got error

    inlined from 'Envoy::UnionStringBase<Validator>::UnionStringBase() [with Validator = Envoy::Http::HeaderStringValidator]' at ./envoy/common/union_string.h:66:23,
    inlined from 'Envoy::Http::HeaderString::HeaderString(Envoy::UnionString&&)' at source/common/http/header_map_impl.cc:44:54:
external/com_google_absl/absl/container/internal/inlined_vector.h:522:5: error: '<unnamed>.absl::lts_20240722::InlinedVector<char, 128, std::allocator<char> >::storage_.absl::lts_20240722::inlined_vector_internal::Storage<char, 128, std::allocator<char> >::data_' is used uninitialized [-Werror=uninitialized]
  522 |     data_ = other_storage.data_;
      |     ^~~~~
In file included from ./envoy/http/header_map.h:14,
                 from ./source/common/http/header_map_impl.h:12,
                 from source/common/http/header_map_impl.cc:1:
./envoy/common/union_string.h: In constructor 'Envoy::Http::HeaderString::HeaderString(Envoy::UnionString&&)':
./envoy/common/union_string.h:66:31: note: '<anonymous>' declared here
   66 |   UnionStringBase() : buffer_(InlinedStringVector()) {
      |                               ^~~~~~~~~~~~~~~~~~~~~
In file included from external/com_google_absl/absl/container/inlined_vector.h:53,
                 from external/com_google_absl/absl/strings/cord.h:80,
                 from bazel-out/aarch64-opt/bin/external/com_google_protobuf/src/google/protobuf/io/_virtual_includes/io/google/protobuf/io/coded_stream.h:112,
                 from bazel-out/aarch64-opt/bin/external/envoy_api/envoy/config/core/v3/base.pb.h:20,
                 from ./source/common/http/header_map_impl.h:11,
                 from source/common/http/header_map_impl.cc:1:

Full error message

@sergey-safarov sergey-safarov added bug triage Issue requires triage labels Dec 7, 2024
@wbpcode wbpcode added area/build and removed bug triage Issue requires triage labels Dec 13, 2024
@wbpcode
Copy link
Member

wbpcode commented Dec 13, 2024

Basically, I will suggest you to use our build image and ci scripts to build the binary which would get better experience.

@sergey-safarov
Copy link
Author

Just for your info.
This error is related to variable initialization and can be easily fixed in the source code.
As a workaround I used

--copt="-Wno-uninitialized" --cxxopt="-Wno-uninitialized"

This helps compile sources.
I think this needs to be reviewed by some devs to add variable initialization.

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Jan 13, 2025
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

2 participants