Skip to content

[Feature] Print native crash backtraces from core dumps in CI #311

Description

@zjw1111

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

build_support/run-test.sh can use a core dump to print an all-thread backtrace after a native test crash, but the Build and Test workflow does not enable core dump generation or install GDB. LLVM sanitizers also disable core dumps by default on 64-bit platforms.

As a result, CI may only report (core dumped) without printing the stack that caused the crash, making intermittent native test failures difficult to diagnose from the job log.

Solution

  • Install GDB in the Linux build-and-test matrix.
  • Set kernel.core_pattern=core.%e.%p and raise RLIMIT_CORE in the same shell that runs the tests.
  • Configure ASan and TSan to enable core dumps and abort when reporting an error.
  • Keep using GDB to print all-thread backtraces when run-test.sh finds a core, then delete the core during test cleanup.
  • Remove the Status::Abort() death test so successful test runs do not intentionally create core dumps.

Core dumps and matching binaries are not retained or uploaded as artifacts.

Anything else?

The implementation is available in #312. The behavior was verified once with a temporary program that called abort(); the CI log contains the real GDB backtrace. The temporary crash test was removed after validation so regular CI runs do not intentionally generate a core dump.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions