| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use Linux's prctl(PR_SET_VMA) system call to name memory arenas being
allocated using mmap(MAP_ANONYMOUS).
This change allows Abseil's memory arena(s) to be distinguished from
other uses of anonymous memory within a process, which in turn helps
investigations into the memory usage of applications.
The change adds a new prctl() system call to the code paths that call
mmap(). This is not expected to add significant overhead to applications.
The call to prctl(PR_SET_VMA, ...) can fail if the Linux kernel in use was
not configured with the CONFIG_ANON_VMA_NAME kernel option. This should
be OK since the naming memory regions is primarily a debugging aid.
PiperOrigin-RevId: 523687348
Change-Id: Ie404e5eeef0a6da53330b3a56149c4f3bc6bf5c7
|
|
|
|
|
|
|
|
| |
For function N in the stack, the current code reports the size of
frame N - 1. Fix that.
PiperOrigin-RevId: 520688072
Change-Id: I984729f72f79aebae1b6997cb51d3ddef9199d1e
|
|
|
|
|
| |
PiperOrigin-RevId: 512974770
Change-Id: If7a8128996d2a73ac566faaa676ddd3858d51af6
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 511696041
Change-Id: I77a87c8721f64e0d9e9a70e08a7127312488ff21
|
|\ \
| | |
| | |
| | |
| | | |
PiperOrigin-RevId: 511271203
Change-Id: I1ed352e06265b705b62d401a50b4699d01f7f1d7
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Both e_shentsize and e_shstrndx are uint16, so the product
elf_header.e_shentsize * elf_header.e_shstrndx
can overflow the promoted type int (MAX_UINT16 * MAX_UINT16 > MAX_INT),
which is undefined behavior. Not sure if it can affect any real cases
or not, though.
Cast e_shentsize to loff_t instead of e_shoff.
This makes both multiplication and addition to use loff_t type.
PiperOrigin-RevId: 511254775
Change-Id: I39c493bfb539cca6742aae807c50718d31e7c001
|
|/ /
| |
| |
| | |
These make the changed constructors match closer to the other ones that are default.
|
|/
|
|
| |
nullptr instead of 0 and nothing instead of void for function arguments is preferred.
|
|
|
|
|
|
|
|
|
| |
conversion.
On some glibcs, this is defined as a call to sysconf(), which returns a long.
PiperOrigin-RevId: 505380003
Change-Id: I53207846d733d3a529630a6aff9bca425cf90a21
|
|
|
|
|
|
|
|
| |
Ensure that we know both real low and high stack bounds
when relying on the stack bounds check.
PiperOrigin-RevId: 504003431
Change-Id: I8f6e6b75f5edff233d3cf80285f81b53f9080a0f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
END_PUBLIC
absl: relax frame size check in x86 stack unwinding
Currently the unwinder stops whenever it sees a frame >100000 bytes.
There may be such legitimate frames, the default stack size is O(megabytes).
Only do this check if we are not within the thread stack bounds.
The thread stack is assumed to be readable, so the worst thing that can happen
if the large stack frame is actually bogus is that we will add one/few wrong frames and stop.
PiperOrigin-RevId: 503374764
Change-Id: Icabb55d6468b12a42bf026c37c98dbe84977e659
|
|
|
|
|
| |
PiperOrigin-RevId: 498048994
Change-Id: Iee969b9171921e3ffdca2610f9b93b53678d0b9d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
deprecation of ATOMIC_FLAG_INIT.
Another option would have been to use macros to only initialize
std::atomic_flag before C++20, but I decided to use one compilation
path instead.
The major difference between std::atomic_flag and std::atomic<bool> is
that the former is guaranteed to be lock-free, but we already assume
std::atomic<bool> is lock-free in many places.
https://en.cppreference.com/w/cpp/atomic/atomic_flag
PiperOrigin-RevId: 487397075
Change-Id: I3f1c539ec8b2ca58547282e69ed73e93243e8efe
|
|
|
|
|
| |
This corrects the generated .pc files, so these libs match the other libs
already included there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL enables these warnings and fixes the remaining known issues.)
Bug: chromium:1292951
PiperOrigin-RevId: 480981210
Change-Id: I92d5023c6833e24d6aa29b10d433116329972f41
|
|
|
|
|
| |
PiperOrigin-RevId: 474043469
Change-Id: I9ea33a8bf026263c9e10d2a183014a5ee8df1306
|
|
|
|
|
| |
PiperOrigin-RevId: 474017481
Change-Id: I1be222fa38ad01f6ddbcddd610f9629fd4888777
|
|
|
|
|
| |
PiperOrigin-RevId: 473088472
Change-Id: If4fb8354490821cbaf53743f51bf0b0d2ba85895
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on miscellaneous non-test source files.)
Bug: chromium:1292951
PiperOrigin-RevId: 473054605
Change-Id: Ifd7b24966613ca915511a3a607095508068200b8
|
|
|
|
|
|
|
| |
Fixes #1275
PiperOrigin-RevId: 472990940
Change-Id: I1251b01b09e6a9baac52ae4df443714432115e90
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
internal/stacktrace_x86-inl.inc includes internal/raw_logging.h and therefore needs
a direct dependency to satisfy Bazel layering_check (Clang -fmodules-strict-decluse).
Clang before https://reviews.llvm.org/D132779 does not report the issue becasue:
* internal/stacktrace_x86-inl.inc is an .inc file and is not checked as a main file
* internal/stacktrace_x86-inl.inc is a textual header and older Clang incorrectly
considers there is no requesting module and suppresses the error.
PiperOrigin-RevId: 472795469
Change-Id: Ia4ad667ea80b2590cef1adfd22af025c8df826ac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in debugging/internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 470812243
Change-Id: I5578030bb42ba73cb83d4df84f89e431ceac8992
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case that we are unwinding with context, if the retreived frame pointer
matches the signal context, assume that the value is valid and do not perform
confidence checks. In any other case, continue to perform some validation to
avoid returning an incorrect frame pointer.
Given that the VDSO path is currently untested, remove the code to simplify the
logic in the frame walking.
PiperOrigin-RevId: 465360612
Change-Id: Iac656012182a12814bafecf20225ba68b90b4db1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in dirs a-h.)
Bug: chromium:1292951
PiperOrigin-RevId: 464541951
Change-Id: If23b63ccea8e9b730159ff1c7288e9300a40b6bd
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The changes in d6f96eda14aca77748a439f05a567a46ce87e462 enabled handling cases
where the stack may be non-contiguous or not fully symbolicated (e.g. in cases
of alternate signal stacks). However, it did not properly honour the requests
from the caller to perform a strict unwinding where such frames are terminated
upon the discontinuity. This repairs that condition.
Hoist the alignment check since that is safe to perform early.
PiperOrigin-RevId: 464160529
Change-Id: Ic65645928ec60c2a3b4844f3abd4fed1b991edab
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .h and win32 .inc files.)
Bug: chromium:1292951
PiperOrigin-RevId: 463835431
Change-Id: If8e5f7f651d5cd96035e23e4623bdb08a7fedabe
|
|
|
|
|
|
|
| |
The frame pointer sanity check in NextStackFrame() was more restrictive than it is necessary. The frame pointer is used to load the saved link-register and the address for the next stack frame. So it only needs to be 8-byte aligned. The aarch64 ABI does not specify an alignment requirement for the frame point.
PiperOrigin-RevId: 463368519
Change-Id: I473e05181603288f14734fe29013900c7505e201
|
|
|
|
|
|
|
|
|
| |
POSIX is unclear what state a file descriptor is in after a signal is delivered in the middle of close. On Linux, the file is closed even if it returns -1 with errno=EINTR.
As such, do not use errno at all when closing files.
PiperOrigin-RevId: 462638735
Change-Id: Ie73da1f3c83b1099bef146e1ea32e9a4818597cf
|
|
|
|
|
|
|
| |
(upcoming) non-raw logging namespace.
PiperOrigin-RevId: 462213222
Change-Id: I3b9371097b368d55cc86b6106d6dec24ce122762
|
|
|
|
|
|
|
|
|
| |
In some places, we check if the amount we read is a multiple of some amount we are interested in. However, ReadFromOffset returns -1 when it errors. Certain record sizes can cause ReadFromOffset to cause us to think that we succeeded when we did not.
It also results in confusing messages in logs.
PiperOrigin-RevId: 461798762
Change-Id: I8c9c7f2cea4d1789e95e50833d5405239a47f02e
|
|
|
|
|
|
|
|
|
|
|
| |
Some ABSL_RAW_LOG statements print off_t values by casting them to
uintmax_t. However, POSIX says off_t is signed [1], so intmax_t is more
appropriate. Replace casts and format specifiers as needed.
[1] https://pubs.opengroup.org/onlinepubs/009696899/basedefs/sys/types.h.html#:~:text=off_t%20shall,%20types%2e
PiperOrigin-RevId: 461684406
Change-Id: I09ec1a3ba49cd688670618797943a84bc48dba3e
|
|
|
|
|
|
|
| |
Add a hook to permit checking whether an address is in bounds for the stack.
PiperOrigin-RevId: 460997074
Change-Id: Ib3b4d0cf656e614aa083457abb079c40ef8db0ff
|
|
|
|
|
| |
PiperOrigin-RevId: 460752575
Change-Id: I9629504b5c63dbfe367cd55e287a782cd8fa546c
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 460713135
Change-Id: If7ea94f409edc1e4024d7eaa4ae025b0b258fc02
|
|/
|
|
|
|
|
|
|
|
|
| |
There are many reports that sigaltstack() on Apple platforms stops
backtrace() from tracing an original stack, e.g.
* https://github.com/llvm/llvm-project/commit/d39ead41056b00d10b6223543562cd304307ac9b
* https://reviews.llvm.org/D28265
If we disable an alternate stack for signal handler, we won't be able to
catch stack overflow errors, but backrace() will work again.
|
|
|
|
|
|
|
|
| |
This seems to have caused some regressions by causing a flaky failure in some
cases. Revert the change to enable investigation.
PiperOrigin-RevId: 459331687
Change-Id: Iaa4e4bfcb3013a75a2cd72768d980ac5e450f70c
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The alternate signal stack may be sufficiently beyond the esimated frame size
(100k). If we run into the case that the frame is not in the correct direction
assume that the frames may be non-contiguous due to an alternate signal stack
layout. In such a case, if we find that there is an alternate stack configured,
ignore the discontiuity (assuming that it is a removable point-wise
discontinuity) and continue the stack unwinding. This permits us to capture
stack traces in more cases.
PiperOrigin-RevId: 458327775
Change-Id: Ia8b461847401492f72a23ba26601c72e0109402c
|
|
|
|
|
| |
PiperOrigin-RevId: 457005885
Change-Id: I9045ca94a3695303274d7c448b25e32fe02f3383
|
|
|
|
|
|
|
| |
This allows symbolization to work if different parts of a binary's text are mapped differently, e.g. if they're mlock()ed or mapped onto huge pages.
PiperOrigin-RevId: 456600880
Change-Id: I069264f94cf834df9201968275a00828f5eb077e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1200
`backtrace` and `execinfo.h` can be provided by libexecinfo on uclibc and musl resulting in the following build failure with any user of abseil-cpp (such as collectd):
```
/home/buildroot/autobuild/instance-0/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libabsl_stacktrace.so: undefined reference to `backtrace'
```
[...]
```
libgrpc++ . . . . . . no (libgrpc++ not found)
```
[...]
```
configure: error: "Some plugins are missing dependencies - see the summary above for details"
```
Fixes:
- http://autobuild.buildroot.org/results/6a0484412f020e763ce3ad5bda48f09c78645bff
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Merge dac52cd20efb672278dc64bcd74920172a599ac0 into 93ad4284ac12077b7bac07a4743df1c564e7c957
Merging this change closes #1200
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1200 from ffontaine:master dac52cd20efb672278dc64bcd74920172a599ac0
PiperOrigin-RevId: 456323163
Change-Id: I3d2206761524d36e2b227c571e2e513f6840ff75
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we would perform a stacktrace using the frame pointer walking, because we
did the adjustment for the return address separately, we were misaligning the
stack size and frame. Simplify the logic and correct the offset.
The recovered frame pointer provides us with the return address of the current
frame and the previous frame's frame pointer. Subsequently, we decide if we
want to record this frame or not. The value in `next_frame_pointer` already
points to the value from the previous stack frame (that is the next frame
pointer to iterate). As such, the value computed by `ComputeStackFrameSize` is
the value for the current frame. This was offset by one previously.
Take the opportunity to clean up some of the local comments, fixing typos and
splitting up the comments to reflect the lines that they are associated with.
PiperOrigin-RevId: 453744059
Change-Id: If14813e0ac36f327f4b7594472f2222d05c478aa
|
|
|
|
|
|
|
| |
A few targets were missing `linkopts = ...` and so were not obeying
the project-wide default settings.
Omit any changes to cctz for now, because it's vendored from another project.
|
|
|
|
|
|
|
|
| |
Fixes #1181
ORIGINAL_AUTHOR=jerome.duval@gmail.com
PiperOrigin-RevId: 451006334
Change-Id: Id61e5889fb55594d09e92e7bb98fdf8bfbc13cc4
|
|
|
|
|
|
|
|
|
| |
(answer: it's async-signal-safe).
Also, preserve errno across calls to make it actually signal-safe.
PiperOrigin-RevId: 446620926
Change-Id: I875fbec02b909e8424ddf763303b0d6007f8548f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
3d018c03a34bf273a4b24b3584ed77f0a6d21686 by Abseil Team <absl-team@google.com>:
Fix a spelling typo (s/boundries/boundaries).
PiperOrigin-RevId: 442041877
Change-Id: I608020697d37b85316bb9a0838e4b457659c926c
--
518b8119e51db24ce7fb0fd2fe537ec43825c3e6 by Dino Radakovic <dinor@google.com>:
absl/types/internal/variant: Make include guard uppercase
https://google.github.io/styleguide/cppguide.html#The__define_Guard
PiperOrigin-RevId: 441911692
Change-Id: I9837dd07f20204d8253f20627b0917a34dc21825
--
b91696c38310a7cae8c1ea9e2d479495f5dc3f69 by Greg Falcon <gfalcon@google.com>:
Add an internal-only API to wrap __builtin_prefetch() if available.
This private API is intended for future use by the Abseil implementation. Like any internal-namespaced function, it may be changed or removed at any time.
PiperOrigin-RevId: 441894616
Change-Id: Iaa48bd4680b373f4a0d5afab0cb35e2a1908595f
--
0f01e8b0551a662e02dff60840c54320f987315f by Derek Mauro <dmauro@google.com>:
C++20: Use the standard `constinit` keyword for `ABSL_CONST_INIT` when available
PiperOrigin-RevId: 441778874
Change-Id: I70c616469752ff23b326b1c615437599f42cc6aa
GitOrigin-RevId: 3d018c03a34bf273a4b24b3584ed77f0a6d21686
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
f4c7e510922668c68be4aa79a00867c3d3ca9f95 by Derek Mauro <dmauro@google.com>:
Many improvements to LeakChecker builds
The presence of the LeakChecker is now detected when possible. GCC
users using LeakChecker in standalone mode still need to use
-DLEAK_CHECKER. This is now documented in the header.
The hacky targets used for testing leak checking have been removed in
favor of testing in AddressSanitizer mode on Kokoro.
Fixes #885
Fixes #1153
PiperOrigin-RevId: 441203393
Change-Id: Ibe64ef6b104bcaf31839ff7184e558cc86abdd1c
--
5c70a23aa83b8152ab95d2cf21662fc63c80ef7d by Abseil Team <absl-team@google.com>:
Add a benchmark for stacktrace
PiperOrigin-RevId: 441196473
Change-Id: I4c9aa2e797aa2cae09abfaaee3abe5c09eb62fc4
--
50b406052273b9d5bad04a7860a96e4d5d956c02 by Abseil Team <absl-team@google.com>:
Internal change.
PiperOrigin-RevId: 441114481
Change-Id: I667af7a50d5631ca91289dd24c91ba90233e0184
--
568b4eaac120b420bce5290179d407d2b57d5bae by Dino Radakovic <dinor@google.com>:
Internal change
PiperOrigin-RevId: 440894155
Change-Id: Ia587ffc65a8321126585fb363b7c0ca8cc2a0da2
--
d53948eace4f3a10ac5a6c1496dc51b81adc412c by Abseil Team <absl-team@google.com>:
Explicitly give internal linkage to symbols which are not used outside of their
translation units.
PiperOrigin-RevId: 440424519
Change-Id: I531c5e229d443375483b7550a34f48042589a99b
GitOrigin-RevId: f4c7e510922668c68be4aa79a00867c3d3ca9f95
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
ef2bf829c333f378ecc12f3259e3187cdb75a3d5 by Abseil Team <absl-team@google.com>:
debugging: fix the VDSO symbol name used for unwinding on RISC-V Linux
The name listed in `man vdso` is incorrect. Instead, use the name from `linux-5.16/arch/riscv/kernel/vdso/rt_sigreturn.S`
PiperOrigin-RevId: 439654174
Change-Id: Ib39d066f416681720068e806e828a2c76a14a532
--
43dfad824afd36cfc3e5049b4fea71a2bccb066c by Benjamin Barenblat <bbaren@google.com>:
Check printf format strings in str_format_convert_test
Add ABSL_PRINTF_ATTRIBUTE to appropriate functions in
strings/internal/str_format/convert_test. Correct
TypedFormatConvertTest.Char, which was accidentally passing values of
types larger than int to StrPrint.
PiperOrigin-RevId: 439388148
Change-Id: I6cde4e8e0c6455064138192430f07f4c990be0bc
--
f84b4ab2c3b070c8af0c82742ac7a8a4bf443bca by Derek Mauro <dmauro@google.com>:
Use __builtin_memcmp in the absl::string_view implementation
starting with MSVC 16.9, where it first appeared
This enables more constexpr operations
PiperOrigin-RevId: 439317316
Change-Id: Iaf1ce76b60901d4b2d5b96be5900c56572f57b15
GitOrigin-RevId: ef2bf829c333f378ecc12f3259e3187cdb75a3d5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
afa44fa0245a1cfb1824ef9697b3fa77fa9615c9 by Laramie Leavitt <lar@google.com>:
Comment CMakeLists.txt about internal absl_cc_library() targets.
From what I can tell, these are the CMake targets that are public:
absl::algorithm
absl::algorithm_container
absl::base
absl::core_headers
absl::dynamic_annotations
absl::log_severity
absl::cleanup
absl::btree
absl::fixed_array
absl::flat_hash_map
absl::flat_hash_set
absl::inlined_vector
absl::node_hash_map
absl::node_hash_set
absl::debugging
absl::failure_signal_handler
absl::leak_check
absl::leak_check_disable
absl::stacktrace
absl::symbolize
absl::flags
absl::flags_commandlineflag
absl::flags_config
absl::flags_marshalling
absl::flags_parse
absl::flags_reflection
absl::flags_usage
absl::bind_front
absl::function_ref
absl::hash
absl::hash_testing
absl::memory
absl::meta
absl::type_traits
absl::bits
absl::int128
absl::numeric
absl::numeric_representation
absl::exponential_biased
absl::periodic_sampler
absl::sample_recorder
absl::random_bit_gen_ref
absl::random_distributions
absl::random_mocking_bit_gen
absl::random_random
absl::random_seed_gen_exception
absl::random_seed_sequences
absl::status
absl::statusor
absl::cord
absl::cord_test_helpers
absl::str_format
absl::strings
absl::synchronization
absl::civil_time
absl::time
absl::time_zone
absl::any
absl::bad_any_cast
absl::bad_optional_access
absl::bad_variant_access
absl::compare
absl::optional
absl::span
absl::variant
absl::utility
PiperOrigin-RevId: 438702788
Change-Id: Icf611c35e88f03cd2493a95f61617605305d4e8e
--
a99f60847578e6c0df6befadb29a01c86def0d21 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 438647928
Change-Id: I141eadd17d6e8607df25ebc893aecefa0239a72f
--
b23e77e8f62a77023188594390c9e491c507d22c by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 438628502
Change-Id: I40c4297716c8c1621ba8b02a22393bfcbefb5b5e
GitOrigin-RevId: afa44fa0245a1cfb1824ef9697b3fa77fa9615c9
|