Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update the buildAndTestCMake: save core dumps #2103

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .github/workflows/buildAndTestCMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,29 @@ jobs:
uses: ./.github/actions/setup-build
with:
llvm-version: ${{ steps.llvm-version.outputs.version }}

- name: Setup Core Dumps
run: |
sudo mkdir /cores
sudo chmod 777 /cores
# Core filenames will be of the form executable.pid.timestamp:
sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern'
- name: Build and Run X
run: |
ulimit -c unlimited
make x
cat /proc/sys/kernel/core_pattern
./x
- name: Configure and Build LLVM
shell: bash
run: |
./build_tools/github_actions/ci_build_cmake_llvm.sh "$LLVM_PROJECT_DIR" "$LLVM_BUILD_DIR"
env:
CMAKE_BUILD_TYPE: Release
MLIR_ENABLE_BINDINGS_PYTHON: ON

- name: Build and Test StableHLO (with AddressSanitizer)
shell: bash
run: |
ulimit -c unlimited # Enable core dumps to be captured (must be in same run block)
./build_tools/github_actions/ci_build_cmake.sh "$LLVM_BUILD_DIR" "$STABLEHLO_BUILD_DIR"
env:
CMAKE_BUILD_TYPE: Release
Expand All @@ -89,4 +100,12 @@ jobs:
./build_tools/github_actions/ci_build_cmake.sh "$LLVM_BUILD_DIR" "$STABLEHLO_BUILD_DIR"
env:
CMAKE_BUILD_TYPE: Release
STABLEHLO_ENABLE_BINDINGS_PYTHON: ON
STABLEHLO_ENABLE_BINDINGS_PYTHON: ON

- name: Upload Core Dumps
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: crashes
path: /cores/*
if-no-files-found: ignore
19 changes: 19 additions & 0 deletions x.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <signal.h>
#include <unistd.h>

int x() {
return 1;
}

int y() {
return 1 + x();
}

int z() {
return 2 + y();
}

int main() {
kill(getpid(), SIGABRT);
return 3 + z();
}
Loading