Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan

# Configure our Docker toolchain setup.
build --extra_toolchains=@docker_toolchain//:all
build:libstdc++ --features=libstdc++
build:gcc --platforms=//ci:linux_gcc
build:clang --platforms=//ci:linux_clang
# TODO(b/530366451) Replace these with a proper toolchain setup
build:libstdc++ --repo_env=BAZEL_CXXOPTS= --repo_env=BAZEL_LINKOPTS= --repo_env=CPLUS_INCLUDE_PATH=
build:libstdc++ --action_env=BAZEL_CXXOPTS= --action_env=BAZEL_LINKOPTS= --action_env=CPLUS_INCLUDE_PATH=
build:libstdc++ --host_action_env=BAZEL_CXXOPTS= --host_action_env=BAZEL_LINKOPTS= --host_action_env=CPLUS_INCLUDE_PATH=

# TODO(b/530366451) This uses gcc 14, replace with a more recent version.
build:gcc --config=libstdc++
build:gcc --host_action_env=CC=/usr/local/bin/gcc --action_env=CC=/usr/bin/gcc
build:gcc --host_action_env=CXX=/usr/local/bin/g++ --action_env=CXX=/usr/bin/g++

# Remote build configuration for CI.
build:remote-base --define=EXECUTOR=remote
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-24.04
name: Linux ${{ matrix.toolchain }} ${{ matrix.compilation_mode }} ${{ matrix.exceptions }} Bazel
container:
image: gcr.io/google.com/absl-177019/gloop-linux-toolchain-latest@sha256:a820c79d3f356a64db121a4ee16c4408df18f9d2c8bf6c6abfae21666ac003ba
image: gcr.io/google.com/absl-177019/gloop-linux-latest@sha256:903f3d7733dd615bc1542b548fab4b649cf6e48118251a2c6527ce4e30543c6b
options: --cap-add=SYS_PTRACE
credentials:
# TODO(b/530366451) Switch to Workload Identity Federation to avoid the need for secrets and
Expand Down
6 changes: 0 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@ bazel_dep(
version = "20260708.rc1",
repo_name = "do_not_use_for_gloop_visibility_only",
)

bazel_dep(name = "docker_toolchain", version = "0.1", dev_dependency = True)
local_path_override(
module_name = "docker_toolchain",
path = "ci/docker_toolchain",
)
25 changes: 5 additions & 20 deletions ci/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package(default_visibility = ["//visibility:private"])
package(
default_applicable_licenses = ["//tcmalloc:license"],
default_visibility = ["//visibility:private"],
)

platform(
name = "rbe",
Expand All @@ -7,27 +10,9 @@ platform(
"@platforms//cpu:x86_64",
],
exec_properties = {
"container-image": "docker://gcr.io/google.com/absl-177019/gloop-linux-latest@sha256:e199623ad0b61b30d240e8bbddf473f65cb1a11da09462001d83b5066dbd9e98",
"container-image": "docker://gcr.io/google.com/absl-177019/gloop-linux-latest@sha256:903f3d7733dd615bc1542b548fab4b649cf6e48118251a2c6527ce4e30543c6b",
"OSArch": "amd64",
"dockerRunAsRoot": "true",
"cache-silo-key": "n2-highmem-8-2026-07-07",
},
)

platform(
name = "linux_gcc",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
"@bazel_tools//tools/cpp:gcc",
],
)

platform(
name = "linux_clang",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
"@bazel_tools//tools/cpp:clang",
],
)
21 changes: 0 additions & 21 deletions ci/docker_toolchain/BUILD

This file was deleted.

19 changes: 0 additions & 19 deletions ci/docker_toolchain/MODULE.bazel

This file was deleted.

3 changes: 2 additions & 1 deletion tcmalloc/guarded_page_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ bool GuardedPageAllocator::WriteOverflowOccurred(size_t slot) const {
GuardedAllocationsErrorType GuardedPageAllocator::GetErrorType(
uintptr_t addr, const SlotMetadata& d) const {
if (!d.allocation_start) return GuardedAllocationsErrorType::kUnknown;

size_t dealloc_count = d.dealloc_count.load(std::memory_order_relaxed);
if (dealloc_count >= 2) return GuardedAllocationsErrorType::kDoubleFree;
if (d.write_overflow_detected)
Expand All @@ -520,7 +521,7 @@ GuardedAllocationsErrorType GuardedPageAllocator::GetErrorType(
if (addr >= d.allocation_start + d.requested_size) {
return GuardedAllocationsErrorType::kBufferOverflow;
}
return GuardedAllocationsErrorType::kUnknown;
return GuardedAllocationsErrorType::kUseAfterFree;
}

uintptr_t GuardedPageAllocator::SlotToAddr(size_t slot) const {
Expand Down
2 changes: 2 additions & 0 deletions tcmalloc/testing/testutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ class ScopedProfileSamplingInterval {
// Reset the per-thread sampler. It may have a very large gap if sampling
// had been disabled.
void* ptr = ::operator new(256 * 1024 * 1024);
benchmark::DoNotOptimize(ptr);
::operator delete(ptr);
}

~ScopedProfileSamplingInterval() {
MallocExtension::SetProfileSamplingInterval(previous_);
void* ptr = ::operator new(256 * 1024 * 1024);
benchmark::DoNotOptimize(ptr);
::operator delete(ptr);
}

Expand Down
Loading