Skip to content

Commit 4d003ea

Browse files
committed
GitHub CI: JITs: Dump RUBY_CRASH_REPORT on failure
We sometimes see silent crashes on CI such as <https://github.com/ruby/ruby/actions/runs/17661854762/job/50196469793>. The default of dumping to stderr could be interacting poorly with the parallel workers, so let's use RUBY_CRASH_REPORT to hopefully get more information.
1 parent 7ed1b24 commit 4d003ea

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.github/workflows/yjit-macos.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ jobs:
115115
ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10'
116116
if: ${{ contains(matrix.configure, 'jit=dev') }}
117117

118-
- name: Enable YJIT through ENV
119-
run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
118+
- name: Set ENV for YJIT
119+
run: |
120+
echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
121+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
120122
121123
- name: Set test options for skipped tests
122124
run: |
@@ -166,6 +168,10 @@ jobs:
166168
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
167169
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}
168170

171+
- if: ${{ failure() }}
172+
continue-on-error: true
173+
run: tail --verbose --lines=+1 rb_crash_*.txt
174+
169175
- uses: ./.github/actions/slack
170176
with:
171177
label: ${{ matrix.test_task }} ${{ matrix.configure }} ${{ matrix.yjit_opts }}

.github/workflows/yjit-ubuntu.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ jobs:
168168
ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10'
169169
if: ${{ contains(matrix.configure, 'jit=dev') }}
170170

171-
- name: Enable YJIT through ENV
172-
run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
171+
- name: Set ENV for YJIT
172+
run: |
173+
echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
174+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
173175
174176
# Check that the binary was built with YJIT
175177
- name: Check YJIT enabled
@@ -208,6 +210,11 @@ jobs:
208210
LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }}
209211
continue-on-error: ${{ matrix.continue-on-test_task || false }}
210212

213+
- name: Dump crash logs
214+
if: ${{ failure() }}
215+
continue-on-error: true
216+
run: tail --verbose --lines=+1 rb_crash_*.txt
217+
211218
- uses: ./.github/actions/slack
212219
with:
213220
label: ${{ matrix.test_task }} ${{ matrix.configure }}

.github/workflows/zjit-macos.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ jobs:
107107
ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10'
108108
if: ${{ contains(matrix.configure, 'jit=dev') }}
109109

110+
- name: Set ENV for ZJIT
111+
run: |
112+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
113+
110114
- name: make ${{ matrix.test_task }}
111115
run: >-
112116
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
@@ -122,6 +126,11 @@ jobs:
122126
TESTS: ${{ matrix.test_all_opts }}
123127
continue-on-error: ${{ matrix.continue-on-test_task || false }}
124128

129+
- name: Dump crash logs
130+
if: ${{ failure() }}
131+
continue-on-error: true
132+
run: tail --verbose --lines=+1 rb_crash_*.txt
133+
125134
- uses: ./.github/actions/slack
126135
with:
127136
label: ${{ matrix.test_task }} ${{ matrix.configure }}

.github/workflows/zjit-ubuntu.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ jobs:
147147
run: ./miniruby --zjit -v | grep "+ZJIT"
148148
if: ${{ matrix.configure != '--disable-zjit' }}
149149

150+
- name: Set ENV for ZJIT
151+
run: |
152+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
153+
150154
- name: make ${{ matrix.test_task }}
151155
run: >-
152156
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
@@ -164,6 +168,11 @@ jobs:
164168
TESTS: ${{ matrix.test_all_opts }}
165169
continue-on-error: ${{ matrix.continue-on-test_task || false }}
166170

171+
- name: Dump crash logs
172+
if: ${{ failure() }}
173+
continue-on-error: true
174+
run: tail --verbose --lines=+1 rb_crash_*.txt
175+
167176
- uses: ./.github/actions/slack
168177
with:
169178
label: ${{ matrix.test_task }} ${{ matrix.configure }}

0 commit comments

Comments
 (0)