Skip to content

Stabilize Linux CI crash-path verification in test_stack_context - #8

Merged
keithpotz merged 2 commits into
mainfrom
copilot/fix-linux-action-job
Jul 16, 2026
Merged

Stabilize Linux CI crash-path verification in test_stack_context#8
keithpotz merged 2 commits into
mainfrom
copilot/fix-linux-action-job

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The Linux Actions job failed because test_stack_context did not consistently crash under Release optimization, so test_stack_output/sentinel.txt was never produced. This broke the workflow’s sentinel-based verification step.

  • Root cause

    • tests/test_stack_context.cpp used a compile-time null dereference pattern that can be optimized away in Release builds, allowing normal process exit.
  • Change made

    • Reworked the crash trigger to use a runtime-loaded volatile address so the fault path is preserved under optimization.
    • Added <cstdint> and introduced a volatile global crash address used by crashSiteFunction().
  • Impact

    • test_stack_context now deterministically exercises CrashCatch on Linux Release builds, restoring sentinel generation expected by CI.
#include <cstdint>

static volatile std::uintptr_t gCrashAddress = 0;

CRASHCATCH_TEST_NOINLINE void crashSiteFunction() {
    auto* ptr = reinterpret_cast<volatile int*>(gCrashAddress);
    *ptr = 42; // guaranteed fault path in optimized builds
}

Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'linux' Stabilize Linux CI crash-path verification in test_stack_context Jul 16, 2026
Copilot AI requested a review from keithpotz July 16, 2026 16:26
@keithpotz
keithpotz marked this pull request as ready for review July 16, 2026 16:29
@keithpotz
keithpotz merged commit 2c495df into main Jul 16, 2026
2 checks passed
@keithpotz
keithpotz deleted the copilot/fix-linux-action-job branch July 16, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants