Skip to content

Following QuickStart does not Build Successfully #209

@DanielLee343

Description

@DanielLee343

Hi, I was following the exact steps in the quickstart guide but bazel test //tcmalloc/... shows me this:

...
//tcmalloc/internal:allocation_guard_test                                FAILED in 0.2s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/internal/allocation_guard_test/test.log
//tcmalloc/internal:cache_topology_test                                  FAILED in 0.0s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/internal/cache_topology_test/test.log
//tcmalloc/internal:config_test                                          FAILED in 0.1s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/internal/config_test/test.log
//tcmalloc/internal:sysinfo_test                                         FAILED in 0.3s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/internal/sysinfo_test/test.log
//tcmalloc/testing:memory_errors_test_256k_pages                         FAILED in 11.2s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_256k_pages/test.log
//tcmalloc/testing:memory_errors_test_256k_pages_pow2                    FAILED in 11.4s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_256k_pages_pow2/test.log
//tcmalloc/testing:memory_errors_test_256k_pages_pow2_sharded_transfer_cache FAILED in 11.2s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_256k_pages_pow2_sharded_transfer_cache/test.log
//tcmalloc/testing:memory_errors_test_256k_pages_sharded_transfer_cache  FAILED in 11.3s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_256k_pages_sharded_transfer_cache/test.log
//tcmalloc/testing:memory_errors_test_32k_pages                          FAILED in 8.8s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_32k_pages/test.log
//tcmalloc/testing:memory_errors_test_512k_slab                          FAILED in 7.6s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_512k_slab/test.log
//tcmalloc/testing:memory_errors_test_8k_pages                           FAILED in 7.6s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_8k_pages/test.log
//tcmalloc/testing:memory_errors_test_chunks_for_page_tracker_lists      FAILED in 7.8s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_chunks_for_page_tracker_lists/test.log
//tcmalloc/testing:memory_errors_test_deprecated_perthread               FAILED in 8.1s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_deprecated_perthread/test.log
//tcmalloc/testing:memory_errors_test_flat_cpu_caches                    FAILED in 7.8s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_flat_cpu_caches/test.log
//tcmalloc/testing:memory_errors_test_hpaa                               FAILED in 7.6s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_hpaa/test.log
//tcmalloc/testing:memory_errors_test_legacy_size_classes                FAILED in 7.6s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_legacy_size_classes/test.log
//tcmalloc/testing:memory_errors_test_no_hpaa                            FAILED in 7.6s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_no_hpaa/test.log
//tcmalloc/testing:memory_errors_test_numa_aware                         FAILED in 9.4s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_numa_aware/test.log
//tcmalloc/testing:memory_errors_test_real_cpu_caches                    FAILED in 7.7s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_real_cpu_caches/test.log
//tcmalloc/testing:memory_errors_test_small_but_slow                     FAILED in 7.2s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_small_but_slow/test.log
//tcmalloc/testing:memory_errors_test_use_all_buckets_for_few_object_spans FAILED in 7.9s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_use_all_buckets_for_few_object_spans/test.log
//tcmalloc/testing:memory_errors_test_use_extended_size_class_for_cold   FAILED in 7.7s
  /home/lyuze/.cache/bazel/_bazel_lyuze/d4dc78efd13286779efefa456013cbee/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs/tcmalloc/testing/memory_errors_test_use_extended_size_class_for_cold/test.log
...
Executed 20 out of 799 tests: 779 tests pass and 20 fail locally.

I noticed the mojority of tests failed in this line tcmalloc/testing/memory_errors_test.cc:432, at the EXPECT_DEATH

TEST_P(ParameterizedTcMallocTest, ReallocLarger) {
  // Note: sizes are chosen so that size + 2 access below
  // does not write out of actual allocation bounds.
  for (size_t size : {2, 29, 60, 505}) {
    EXPECT_DEATH(
        {
          fprintf(stderr, "size=%zu\n", size);
          ScopedAlwaysSample always_sample;
          ScopedImprovedGuardedSampling scoped_improved_guarded_sampling(
              GetParam());
          for (size_t i = 0; i < 10000; ++i) {
            char* volatile ptr = static_cast<char*>(malloc(size));
            ptr = static_cast<char*>(realloc(ptr, size + 1));
            ptr[size + 2] = 'A';
            free(ptr);
            MaybeResetStackTraceFilter(GetParam());
          }
        },
        "SIGSEGV");
  }
}

My system environment:

lyuze@wukong0:~/workspace/tcmalloc$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname -r
6.2.0
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
$ bazel --version
bazel 6.4.0

Any reason for that, or hint for debug? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions