19 Commits

Author SHA1 Message Date
Abseil Team
33bbc26609 Break on nullptr return address in UnwindImpl on RISC-V
PiperOrigin-RevId: 914222352
Change-Id: Iff9028a38e878465961f71e90484c2a62ed89132
2026-05-12 05:13:17 -07:00
Abseil Team
b6808e6f7c Remove stack trace fixup code from Abseil
PiperOrigin-RevId: 875236816
Change-Id: I88f7d894cc30d23c77b7d43953fe4d85deb65728
2026-02-25 10:48:11 -08:00
Abseil Team
0cc960ece0 Automated rollback of commit 9f40d6d6f3.
PiperOrigin-RevId: 838084272
Change-Id: I8b1b15618e12cc17d85a71b7f5062b66ceaaf04f
2025-11-29 05:02:02 -08:00
Abseil Team
9f40d6d6f3 Enable clang-specific warnings on the clang-cl build
instead of just trying to be MSVC

This also fixes the new warnings that are caught.
These include:
  * Unreachable code after GTEST_SKIP (this is kind of ugly)
  * Some -Wundef warnings
  * A -Wshadow warning in vlog_config.cc

PiperOrigin-RevId: 838046186
Change-Id: Ief48d6db2b8755d2173997d052560880593d5819
2025-11-29 01:22:25 -08:00
Derek Mauro
b20370e0d6 Enable clang-specific warnings on the clang-cl build
instead of just trying to be MSVC

This also fixes the new warnings that are caught.
These include:
  * Unreachable code after GTEST_SKIP (this is kind of ugly)
  * Some -Wundef warnings
  * A -Wshadow warning in vlog_config.cc

PiperOrigin-RevId: 838017208
Change-Id: I39373c0ccc57c8660c22815c51ac5b4180aec53c
2025-11-28 22:41:40 -08:00
Abseil Team
72d59c9617 stacktrace_test: avoid spoiling errno in the test signal handler.
PiperOrigin-RevId: 800031515
Change-Id: Ica41c41d176d2ea1ab148e656bf49921098a0411
2025-08-27 07:50:44 -07:00
Abseil Team
5d51d830b6 stacktrace_test: avoid spoiling errno in the test signal handler.
PiperOrigin-RevId: 799655439
Change-Id: I5a06d39bb1188ec305c79ab76a8d0b8d51068dea
2025-08-26 11:56:46 -07:00
Abseil Team
27b1a94353 stacktrace_test: avoid spoiling errno in the test signal handler.
PiperOrigin-RevId: 799631809
Change-Id: I456c0721e56a80a09a510c3556d8aace436717a5
2025-08-26 10:58:49 -07:00
Abseil Team
6b15d34113 Ensure stack usage remains low when unwinding the stack, to prevent stack overflows
PiperOrigin-RevId: 792704790
Change-Id: I4484219d570e84205cf7da95f71e3c8a00a590e8
2025-08-08 11:46:44 -07:00
Abseil Team
fd266b9c35 Shrink #if ABSL_HAVE_ATTRIBUTE_WEAK region sizes in stacktrace_test.cc
PiperOrigin-RevId: 792661664
Change-Id: I72468516ee733529e41bcfdaf783d09a72df3bfe
2025-08-08 09:51:24 -07:00
Abseil Team
11abedd9eb Use signal-safe dynamic memory allocation for stack traces when necessary
This avoids a stack overflow when a large buffer is expected for stack traces.
The small/large threshold we use here is a heuristic to avoid going beyond one page of memory.

PiperOrigin-RevId: 792277857
Change-Id: I2a20ee830175192d0bc61d43ba13d7da10fe7aca
2025-08-07 13:07:41 -07:00
Abseil Team
342afd0767 Deduplicate stack trace implementations in stacktrace.cc
PiperOrigin-RevId: 786730361
Change-Id: I8184cd8a259570ff247077d7e3adaf430bd08ecc
2025-07-24 09:21:06 -07:00
Wiktor Garbacz
d55845e6c1 stacktrace_x86: Handle nested signals on altstack
PiperOrigin-RevId: 758147101
Change-Id: I569e095b4820862a7ebba68bd22ab205f43693e2
2025-05-13 03:49:25 -07:00
Abseil Team
6b2a4fd401 Extend stack-frame walking functionality to allow dynamic fixup
PiperOrigin-RevId: 745892583
Change-Id: I6e37d5265d8523470d1e1e8a433221ed228d943d
2025-04-09 23:57:53 -07:00
Abseil Team
12f4be6805 Roll back change to address breakage
PiperOrigin-RevId: 745366204
Change-Id: Ifc92782d4fc9cccd553cbd1fd107bb4b7134b7ca
2025-04-08 18:17:01 -07:00
Abseil Team
881877456c Extend stack-frame walking functionality to allow dynamic fixup
PiperOrigin-RevId: 745283906
Change-Id: I545650a577e3e30cc4a30980693167aa28f418c5
2025-04-08 14:06:00 -07:00
Abseil Team
3b1bb73373 Adds functionality to return stack frame pointers during stack walking, in addition to code addresses
Together with the frame sizes already being returned, this gives us the bounds on each stack frame.

Note that this may slightly affect MSVC in debug builds, as it does not respect ABSL_ATTRIBUTE_ALWAYS_INLINE without optimizations. To remedy this, either enable inlining (/Ob1 or higher), or write a wrapper that ensures any stack traces obtained are robust to frames being added (such as by manually filtering everything below the caller).

Do not depend on the new APIs publicly. They are subject to change or removal.

PiperOrigin-RevId: 740075920
Change-Id: I6cd0909e7be3af4c9f32d39633230f655946b6a8
2025-03-24 16:35:55 -07:00
Abseil Team
bf69aa3ca2 The current aarch64 large-stack frame error handling is unsophisticated,
which makes it give up in certain situations where the x86 handler works
fine

This change adopts x86's more sophisticated stack-bounds-checking
method for aarch64, and enables the HugeStack test to pass on aarch64.

PiperOrigin-RevId: 540655431
Change-Id: If7d816330327722bbe5c135abfa77fda5e7e452b
2023-06-15 12:20:04 -07:00
Abseil Team
c611e5ce1d absl: add a stack unwinding test
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
2023-01-20 00:48:32 -08:00