Repository navigation
always capture a stack trace when a test process crashes - #18517
Merged
Merged
Conversation
The rsession gtest scope segfaulted at startup on a PR-18509 CI run with no diagnostics at all: libSegFault was preloaded, but its handler cannot run on an exhausted stack, so a stack-overflow crash dies with nothing but the shell's exit status. libSegFault is also gone from glibc 2.35+. Harden the test harness: - set SEGFAULT_USE_ALTSTACK so libSegFault installs its handler on an alternate stack and can report stack-overflow crashes - raise the core ulimit, and on death-by-signal locate the core dump (cwd, absolute core_pattern target, or apport/systemd-coredump) and print a gdb backtrace from it, capped at 100 frames per thread - clean up examined cores so reused CI workspaces don't accumulate them Verified in ubuntu:20.04 (libSegFault present) and ubuntu:24.04 (no libSegFault; gdb-on-core fallback) containers with null-dereference and stack-overflow crashers: every scenario now yields a usable backtrace, and the stack-overflow-without-altstack control reproduces the silent CI failure.
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On a recent Jenkins
c++-unit-testsrun (PR-18509 build 2), the rsession gtest scope segfaulted ~250ms into process startup with no diagnostics whatsoever -- just the shell'sSegmentation fault (core dumped)line. libSegFault was preloaded, but:SEGFAULT_USE_ALTSTACK);rstudio-testsalready warnsCould not find libSegFault.sothere).Changes
rstudio-tests.in(Linux diagnostics; macOS and Windows unchanged):SEGFAULT_USE_ALTSTACK=1so libSegFault can report stack-overflow crashes;gdbbacktrace from it (capped at 100 frames per thread, since a stack-overflow core otherwise dumps thousands). Handles a relativecore_pattern(cwd), an absolute one, apport's coredump directory, and systemd-coredump viacoredumpctl;A timestamp marker ensures only cores produced by the current run are examined.
Testing
Verified in
ubuntu:20.04(libSegFault present) andubuntu:24.04(glibc 2.39, no libSegFault) containers, using the rendered harness with null-dereference and stack-overflow crash binaries substituted for the core test suite:SEGFAULT_USE_ALTSTACKreproduces the silent CI failure exactly (only the shell's exit-status line, no backtrace).Also
bash -nandshellcheckclean.Developer-only tooling change; no NEWS entry.