Commit 8c02d27
Add death test for stack-overflow exception filter path
Summary:
D116557659 made `windowsExceptionFilter` stack-overflow-safe: for
EXCEPTION_STACK_OVERFLOW it skips DbgHelp symbolization (which double-faults
on the exhausted stack), writes one static message to stderr, and returns
EXCEPTION_CONTINUE_SEARCH so the OS default handling reaches WER and writes
the LocalDumps minidump. That is what gives us crash dumps for the
ProjFS-drop SEV (S697276, T284863536).
This adds a gtest death test that locks in the guarantee that stack
overflows reach WER. The death-test child installs the real exception filter
and drives a real stack overflow via noinline recursion with a 4KB volatile
frame (so the optimizer cannot inline, collapse, or tail-call it). It
asserts both discriminating behaviors of the fix:
- the child's exit status is STATUS_STACK_OVERFLOW (0xC00000FD), i.e. the
exception code propagated through EXCEPTION_CONTINUE_SEARCH to the OS
default handling, and
- stderr contains "stack overflow detected, deferring to WER for crash
dump", the filter's no-stack static message.
Against the pre-fix filter the child instead dies of the filter's own
access violation (exit 0xC0000005) without writing the message, so this
test fails against the old code (verified below).
The gtest exit-code predicate compares the unsigned representation because
gtest reports the raw Windows exit status as a signed int, making
0xC00000FD appear negative.
The BUCK target is gated to Windows with `compatible_with`. For
`network_access` (required by BUCKLINT's network_access_required), the
network_access_utils helpers cannot be used directly: they all resolve to
"all" on non-Linux, and the Windows RE test platform rejects unisolated
tests (NetworkIsolationType::NONE is not in its allow-list). Instead the
target uses a select that isolates on Linux and leaves network_access
unset on Windows so the platform default isolation applies - the same
pattern as buck2/tests/meta_only/e2e/targets/cross_os_tests. This test
needs no network.
Differential Revision: D116566143
fbshipit-source-id: aca3415eb61bda498a3af02a7683189ba2e6c3bb1 parent db5860c commit 8c02d27
2 files changed
Lines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
192 | 215 | | |
193 | 216 | | |
194 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
0 commit comments