From ed53ad03abd7baf39dda2ac8037ff3d4f5c533e5 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 2 Jun 2021 13:32:24 -0700 Subject: Export of internal Abseil changes -- b2a781121ff72fb485b7e67539d5e4ff1eb66df2 by Gennadiy Rozental : Consistently use absl::flat_hash_map instead of std::map in Flags implementation. PiperOrigin-RevId: 377132816 -- 9ab83a154d8f22d51fed0092bf94245b5af1f498 by Derek Mauro : Workaround for MSAN being unable to see through getentropy(). https://github.com/google/sanitizers/issues/1173 PiperOrigin-RevId: 377097059 -- 8d28e921442d1b246c26f3200f21027557c47657 by Greg Falcon : Disable stack_consumption_test in tsan builds. A recent tsan change broke the way this test-only utility was counting stack usage. PiperOrigin-RevId: 377053169 GitOrigin-RevId: b2a781121ff72fb485b7e67539d5e4ff1eb66df2 Change-Id: Ib56356f8128f6c083f32b950091f3a56d9e2cd51 --- absl/random/internal/BUILD.bazel | 1 + absl/random/internal/seed_material.cc | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'absl/random/internal') diff --git a/absl/random/internal/BUILD.bazel b/absl/random/internal/BUILD.bazel index 90efe85a..6e06fe9a 100644 --- a/absl/random/internal/BUILD.bazel +++ b/absl/random/internal/BUILD.bazel @@ -82,6 +82,7 @@ cc_library( deps = [ ":fast_uniform_bits", "//absl/base:core_headers", + "//absl/base:dynamic_annotations", "//absl/base:raw_logging_internal", "//absl/strings", "//absl/types:optional", diff --git a/absl/random/internal/seed_material.cc b/absl/random/internal/seed_material.cc index 0fcba509..7c1d9efa 100644 --- a/absl/random/internal/seed_material.cc +++ b/absl/random/internal/seed_material.cc @@ -28,6 +28,7 @@ #include #include +#include "absl/base/dynamic_annotations.h" #include "absl/base/internal/raw_logging.h" #include "absl/strings/ascii.h" #include "absl/strings/escaping.h" @@ -142,6 +143,9 @@ bool ReadSeedMaterialFromGetEntropy(absl::Span values) { if (result < 0) { return false; } + // https://github.com/google/sanitizers/issues/1173 + // MemorySanitizer can't see through getentropy(). + ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(buffer, to_read); buffer += to_read; buffer_size -= to_read; } -- cgit v1.2.3