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

Compilation error on Fedora #179

Closed
jvoisin opened this issue Apr 23, 2023 · 1 comment
Closed

Compilation error on Fedora #179

jvoisin opened this issue Apr 23, 2023 · 1 comment

Comments

@jvoisin
Copy link

jvoisin commented Apr 23, 2023

Cloning into 'tcg'...
HEAD is now at bb24fb0 Modify the hot_cold_t nothrow versions to take a nothrow_t reference. This makes the hot_cold_t versions consistent with the standard versions which take std::nothrow as a const reference.
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
DEBUG: /github/home/.cache/bazel/_bazel_root/73e4315fd1aa3d904e5ced823bbfc603/external/rules_python/python/repositories.bzl:32:10: py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file
Analyzing: target //tcmalloc:tcmalloc (1 packages loaded)
Analyzing: target //tcmalloc:tcmalloc (1 packages loaded, 0 targets configured)
Analyzing: target //tcmalloc:tcmalloc (11 packages loaded, 22 targets configured)
Analyzing: target //tcmalloc:tcmalloc (16 packages loaded, 46 targets configured)
INFO: Analyzed target //tcmalloc:tcmalloc (36 packages loaded, 636 targets configured).
INFO: Found 1 target...
[0 / 4] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[4 / 153] Compiling tcmalloc/tcmalloc.cc; 0s processwrapper-sandbox ... (2 actions, 1 running)
ERROR: /__w/mimalloc-bench/mimalloc-bench/extern/tcg/tcmalloc/BUILD:95:10: Compiling tcmalloc/tcmalloc.cc failed: (Exit 1): gcc failed: error executing command /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 ... (remaining 37 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from ./tcmalloc/internal/lifetime_tracker.h:21,
                 from ./tcmalloc/huge_page_filler.h:32,
                 from ./tcmalloc/huge_region.h:24,
                 from ./tcmalloc/huge_page_aware_allocator.h:26,
                 from ./tcmalloc/page_allocator.h:25,
                 from ./tcmalloc/static_vars.h:43,
                 from ./tcmalloc/cpu_cache.h:42,
                 from ./tcmalloc/allocation_sampling.h:21,
                 from tcmalloc/tcmalloc.cc:91:
./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;
      |                    ^~~~~~~~~~~~~~
./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 ./tcmalloc/allocation_sample.h:21,
                 from tcmalloc/tcmalloc.cc:90:
./tcmalloc/internal/logging.h:49:22: note: declared here
   49 | static constexpr int kMaxStackDepth = 64;
      |                      ^~~~~~~~~~~~~~
Target //tcmalloc:tcmalloc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 11.989s, Critical Path: 2.11s
INFO: 6 processes: 5 internal, 1 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
jvoisin added a commit to daanx/mimalloc-bench that referenced this issue Apr 23, 2023
derSteFfi pushed a commit to derSteFfi/mimalloc-bench that referenced this issue Sep 7, 2023
@kenjenkins
Copy link
Contributor

I believe this is fixed as of 79eb0d6.

On Fedora 40 (gcc 14.0.1), I can reproduce the above error at the parent commit:

$ git checkout 79eb0d6~
Previous HEAD position was 79eb0d6 Remove lifetime-based allocator.
HEAD is now at ff7c26e tcmalloc: detect UAF and more OOBs on realloced blocks
$ bazel build tcmalloc
INFO: Analyzed target //tcmalloc:tcmalloc (2 packages loaded, 169 targets configured).
ERROR: /home/nonroot/tcmalloc/tcmalloc/BUILD:141:26: Compiling tcmalloc/background.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //tcmalloc:common_8k_pages) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 29 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./tcmalloc/internal/lifetime_tracker.h:21,
                 from ./tcmalloc/huge_page_filler.h:32,
                 from ./tcmalloc/huge_region.h:24,
                 from ./tcmalloc/huge_page_aware_allocator.h:26,
                 from ./tcmalloc/page_allocator.h:25,
                 from ./tcmalloc/static_vars.h:43,
                 from ./tcmalloc/cpu_cache.h:42,
                 from tcmalloc/background.cc:20:
./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;
      |                    ^~~~~~~~~~~~~~
./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 ./tcmalloc/common.h:38,
                 from ./tcmalloc/cpu_cache.h:36:
./tcmalloc/internal/logging.h:49:22: note: declared here
   49 | static constexpr int kMaxStackDepth = 64;
      |                      ^~~~~~~~~~~~~~
Target //tcmalloc:tcmalloc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6.707s, Critical Path: 3.05s
INFO: 16 processes: 12 internal, 4 processwrapper-sandbox.
ERROR: Build did NOT complete successfully

And no error at 79eb0d6 itself:

$ git checkout 79eb0d6 
Previous HEAD position was ff7c26e tcmalloc: detect UAF and more OOBs on realloced blocks
HEAD is now at 79eb0d6 Remove lifetime-based allocator.
$ bazel build tcmalloc
INFO: Analyzed target //tcmalloc:tcmalloc (2 packages loaded, 163 targets configured).
INFO: Found 1 target...
Target //tcmalloc:tcmalloc up-to-date:
  bazel-bin/tcmalloc/libtcmalloc.lo
INFO: Elapsed time: 7.963s, Critical Path: 4.41s
INFO: 16 processes: 1 internal, 15 processwrapper-sandbox.
INFO: Build completed successfully, 16 total actions

jvoisin added a commit to daanx/mimalloc-bench that referenced this issue Jul 30, 2024
jvoisin added a commit to daanx/mimalloc-bench that referenced this issue Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants