envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Fedora 40: failed build clang-18

Open sergey-safarov opened this issue 1 year ago • 1 comments

Title: failed build clang-18

Description:

# Configuration: d2d36f7223a1fa7547585a5bb7c060ae8de42789d063e83ecc43af51817ff2b9
# Execution platform: @local_config_platform//:host
ERROR: /home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/external/com_github_google_tcmalloc/tcmalloc/BUILD:296:11: Compiling tcmalloc/transfer_cache.cc failed: (Exit 1): process-wrapper failed: error executing command 
  (cd /home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/1881/execroot/envoy && \
  exec env - \
    BAZEL_COMPILER=clang \
    BAZEL_CXXOPTS='-stdlib=libc++' \
    BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a \
    BAZEL_LINKOPTS=-lm:-pthread \
    CC=clang \
    CXX=clang++ \
    CXXFLAGS='-stdlib=libc++' \
    LDFLAGS='-stdlib=libc++' \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /home/build/.cache/bazel/_bazel_build/install/bbf286e15fff7eb9e40ed42b3c5965d3/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/1881/stats.out' /usr/bin/clang-18 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-stdlib=libc++' -MD -MF bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.d '-frandom-seed=bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.o' -gsplit-dwarf -g '-DBAZEL_CURRENT_REPOSITORY="com_github_google_tcmalloc"' -iquote external/com_github_google_tcmalloc -iquote bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc -iquote external/com_google_absl -iquote bazel-out/aarch64-opt/bin/external/com_google_absl '-DABSL_MIN_LOG_LEVEL=4' -fdebug-types-section -fPIC -Wno-deprecated-declarations '-std=c++20' -fsized-deallocation -Werror -Wno-deprecated-declarations -Wno-deprecated-volatile -Wno-implicit-int-float-conversion -Wno-sign-compare -Wno-uninitialized -Wno-unused-function -Wno-unused-variable -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_github_google_tcmalloc/tcmalloc/transfer_cache.cc -o bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.o)
In file included from external/com_github_google_tcmalloc/tcmalloc/transfer_cache.cc:35:
In file included from external/com_github_google_tcmalloc/tcmalloc/static_vars.h:40:
In file included from external/com_github_google_tcmalloc/tcmalloc/page_allocator.h:25:
In file included from external/com_github_google_tcmalloc/tcmalloc/huge_page_aware_allocator.h:30:
external/com_github_google_tcmalloc/tcmalloc/page_allocator_interface.h:83:46: error: returning variable 'info_' by reference requires holding mutex 'pageheap_lock' [-Werror,-Wthread-safety-reference-return]
   83 |   const PageAllocInfo& info() const { return info_; }
      |                                              ^
1 error generated.
Target //source/exe:envoy-static failed to build
INFO: Elapsed time: 2782.566s, Critical Path: 152.75s
INFO: 4237 processes: 2358 internal, 1 local, 1877 processwrapper-sandbox, 1 worker.
FAILED: Build did NOT complete successfully

Repro steps:

Start master build on Fedora 40 using command

bazel build --config=libc++ -c opt envoy --subcommands --jobs 1 --verbose_failures --sandbox_debug

sergey-safarov avatar May 17 '24 18:05 sergey-safarov

@lizan or @keith?

zuercher avatar May 21 '24 18:05 zuercher

@sergey-safarov as commented elsewhere we are currently ~stuck on llvm 14 - any PRs to resolve issues with newer versions would be gratefully received

phlax avatar May 29 '24 10:05 phlax

Thanks, closing.

sergey-safarov avatar May 29 '24 15:05 sergey-safarov

just wondering in this case tho - may be kernel related - we have hit issues with tcmalloc previously with certain kernels - iirc something to do with page size - not sure

phlax avatar May 29 '24 22:05 phlax

FWIW, I was able to build Envoy with clang-18 after disabling a few compiler warnings here and there (and updating cel-cpp as well to include https://github.com/google/cel-cpp/commit/18cf5685e93fb8c07c807d913fabe9d1b54db87f). If there is still an interest I can send a PR to review.

krinkinmu avatar Dec 12 '24 18:12 krinkinmu

Though one caveat, I didn't try to build with libc++ yet, only libstdc++.

krinkinmu avatar Dec 12 '24 18:12 krinkinmu

Issue still actual on Fedora 41 with clan-14 and basel 6.5.0

# Configuration: ab8af8e0d3493f2a4e94e3e3c3912341fcac571743bec6038f366d3430deb09b
# Execution platform: @local_config_platform//:host
SUBCOMMAND: # @com_github_google_tcmalloc//tcmalloc:common [action 'Compiling tcmalloc/transfer_cache.cc', configuration: ab8af8e0d3493f2a4e94e3e3c3912341fcac571743bec6038f366d3430deb09b, execution platform: @local_config_platform//:host]
(cd /home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/execroot/envoy && \
  exec env - \
    BAZEL_LINKLIBS=-l%:libstdc++.a \
    BAZEL_LINKOPTS=-lm \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++14' -MD -MF bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.d '-frandom-seed=bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.o' -gsplit-dwarf -g '-DBAZEL_CURRENT_REPOSITORY="com_github_google_tcmalloc"' -iquote external/com_github_google_tcmalloc -iquote bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc -iquote external/com_google_absl -iquote bazel-out/aarch64-opt/bin/external/com_google_absl '-DABSL_MIN_LOG_LEVEL=4' -fdebug-types-section -fPIC -Wno-deprecated-declarations -Wno-uninitialized '-std=c++20' -fsized-deallocation -Wno-uninitialized -Werror -Wno-attribute-alias -Wno-sign-compare -Wno-stringop-overflow -Wno-uninitialized -Wno-unused-function -Wno-unused-result -Wno-unused-variable -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_github_google_tcmalloc/tcmalloc/transfer_cache.cc -o bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.o)
# Configuration: ab8af8e0d3493f2a4e94e3e3c3912341fcac571743bec6038f366d3430deb09b
# Execution platform: @local_config_platform//:host
ERROR: /home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/external/com_github_google_tcmalloc/tcmalloc/BUILD:296:11: Compiling tcmalloc/transfer_cache.cc failed: (Exit 1): process-wrapper failed: error executing command 
  (cd /home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/172/execroot/envoy && \
  exec env - \
    BAZEL_LINKLIBS=-l%:libstdc++.a \
    BAZEL_LINKOPTS=-lm \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /home/build/.cache/bazel/_bazel_build/install/bbf286e15fff7eb9e40ed42b3c5965d3/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/home/build/.cache/bazel/_bazel_build/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/172/stats.out' /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++14' -MD -MF bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.d '-frandom-seed=bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.o' -gsplit-dwarf -g '-DBAZEL_CURRENT_REPOSITORY="com_github_google_tcmalloc"' -iquote external/com_github_google_tcmalloc -iquote bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc -iquote external/com_google_absl -iquote bazel-out/aarch64-opt/bin/external/com_google_absl '-DABSL_MIN_LOG_LEVEL=4' -fdebug-types-section -fPIC -Wno-deprecated-declarations -Wno-uninitialized '-std=c++20' -fsized-deallocation -Wno-uninitialized -Werror -Wno-attribute-alias -Wno-sign-compare -Wno-stringop-overflow -Wno-uninitialized -Wno-unused-function -Wno-unused-result -Wno-unused-variable -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_github_google_tcmalloc/tcmalloc/transfer_cache.cc -o bazel-out/aarch64-opt/bin/external/com_github_google_tcmalloc/tcmalloc/_objs/common/transfer_cache.o)
In file included from external/com_github_google_tcmalloc/tcmalloc/internal/lifetime_tracker.h:21,
                 from external/com_github_google_tcmalloc/tcmalloc/huge_page_filler.h:32,
                 from external/com_github_google_tcmalloc/tcmalloc/huge_region.h:24,
                 from external/com_github_google_tcmalloc/tcmalloc/huge_page_aware_allocator.h:26,
                 from external/com_github_google_tcmalloc/tcmalloc/page_allocator.h:25,
                 from external/com_github_google_tcmalloc/tcmalloc/static_vars.h:40,
                 from external/com_github_google_tcmalloc/tcmalloc/transfer_cache.cc:35:
external/com_github_google_tcmalloc/tcmalloc/internal/lifetime_predictions.h:179:20: error: declaration of 'const int tcmalloc::tcmalloc_internal::LifetimeDatabase::kMaxStackDepth' changes meaning of 'kMaxStackDepth' [-Wchanges-meaning]
  179 |   static const int kMaxStackDepth = 64;
      |                    ^~~~~~~~~~~~~~
external/com_github_google_tcmalloc/tcmalloc/internal/lifetime_predictions.h:107:18: note: used here to mean 'constexpr const int tcmalloc::tcmalloc_internal::kMaxStackDepth'
  107 |     void* stack_[kMaxStackDepth];
      |                  ^~~~~~~~~~~~~~
In file included from external/com_github_google_tcmalloc/tcmalloc/common.h:37,
                 from external/com_github_google_tcmalloc/tcmalloc/central_freelist.h:28,
                 from external/com_github_google_tcmalloc/tcmalloc/transfer_cache.h:35,
                 from external/com_github_google_tcmalloc/tcmalloc/transfer_cache.cc:15:
external/com_github_google_tcmalloc/tcmalloc/internal/logging.h:49:22: note: declared here
   49 | static constexpr int kMaxStackDepth = 64;
      |                      ^~~~~~~~~~~~~~
Target //source/exe:envoy-static failed to build
INFO: Elapsed time: 264.590s, Critical Path: 6.73s
INFO: 169 processes: 6 internal, 163 processwrapper-sandbox.
FAILED: Build did NOT complete successfully

To build used

bazel build -c opt envoy \
  --subcommands \
  --jobs 1 \
  --verbose_failures \
  --sandbox_debug \
  --copt="-Wno-uninitialized" \
  --cxxopt="-Wno-uninitialized"

sergey-safarov avatar Dec 13 '24 10:12 sergey-safarov

Looks like in this clang is not used. Closing.

sergey-safarov avatar Dec 13 '24 10:12 sergey-safarov