Commit 82302f1e by Abseil Team Committed by Mark Barolak

Export of internal Abseil changes

--
41ac0d9b32618a1df717984afcb808858089bda7 by Derek Mauro <dmauro@google.com>:

Removes usages of deprecated RunningOnValgrind

PiperOrigin-RevId: 323649256

--
5453d131af475b434dcd86ab326e4a2cf780857f by Abseil Team <absl-team@google.com>:

Internal change.

PiperOrigin-RevId: 323630307
GitOrigin-RevId: 41ac0d9b32618a1df717984afcb808858089bda7
Change-Id: I523016e0ecdb8d141aa069ad2846f5e4abbe014c
parent dea76486
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#ifndef ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_ #ifndef ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_
#define ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_ #define ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_
#ifdef __cplusplus
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
...@@ -132,4 +134,16 @@ bool GetFileMappingHint(const void** start, ...@@ -132,4 +134,16 @@ bool GetFileMappingHint(const void** start,
ABSL_NAMESPACE_END ABSL_NAMESPACE_END
} // namespace absl } // namespace absl
#endif // __cplusplus
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
#endif // __cplusplus
bool
AbslInternalGetFileMappingHint(const void** start, const void** end,
uint64_t* offset, const char** filename);
#endif // ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_ #endif // ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_
...@@ -76,15 +76,6 @@ const void *VDSOSupport::Init() { ...@@ -76,15 +76,6 @@ const void *VDSOSupport::Init() {
} }
#endif // __GLIBC_PREREQ(2, 16) #endif // __GLIBC_PREREQ(2, 16)
if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) { if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
// Valgrind zaps AT_SYSINFO_EHDR and friends from the auxv[]
// on stack, and so glibc works as if VDSO was not present.
// But going directly to kernel via /proc/self/auxv below bypasses
// Valgrind zapping. So we check for Valgrind separately.
if (RunningOnValgrind()) {
vdso_base_.store(nullptr, std::memory_order_relaxed);
getcpu_fn_.store(&GetCPUViaSyscall, std::memory_order_relaxed);
return nullptr;
}
int fd = open("/proc/self/auxv", O_RDONLY); int fd = open("/proc/self/auxv", O_RDONLY);
if (fd == -1) { if (fd == -1) {
// Kernel too old to have a VDSO. // Kernel too old to have a VDSO.
......
...@@ -1551,3 +1551,10 @@ bool Symbolize(const void *pc, char *out, int out_size) { ...@@ -1551,3 +1551,10 @@ bool Symbolize(const void *pc, char *out, int out_size) {
ABSL_NAMESPACE_END ABSL_NAMESPACE_END
} // namespace absl } // namespace absl
extern "C" bool AbslInternalGetFileMappingHint(const void **start,
const void **end, uint64_t *offset,
const char **filename) {
return absl::debugging_internal::GetFileMappingHint(start, end, offset,
filename);
}
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/dynamic_annotations.h" // for RunningOnValgrind #include "absl/base/dynamic_annotations.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_map.h"
#include "absl/container/node_hash_map.h" #include "absl/container/node_hash_map.h"
......
...@@ -1179,7 +1179,7 @@ TEST(FindOneCharTest, EdgeCases) { ...@@ -1179,7 +1179,7 @@ TEST(FindOneCharTest, EdgeCases) {
#ifndef THREAD_SANITIZER // Allocates too much memory for tsan. #ifndef THREAD_SANITIZER // Allocates too much memory for tsan.
TEST(HugeStringView, TwoPointTwoGB) { TEST(HugeStringView, TwoPointTwoGB) {
if (sizeof(size_t) <= 4 || RunningOnValgrind()) if (sizeof(size_t) <= 4)
return; return;
// Try a huge string piece. // Try a huge string piece.
const size_t size = size_t{2200} * 1000 * 1000; const size_t size = size_t{2200} * 1000 * 1000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment