Skip to content

Commit fa28721

Browse files
committed
Upload cores dumped in build-and-test CI
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 13b327d commit fa28721

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,60 +367,69 @@ jobs:
367367
timeout-minutes: 15
368368
working-directory: build
369369
run: |
370+
ulimit -c unlimited
370371
./tests/test-erlang -s prime_smp
371372
valgrind ./tests/test-erlang -s prime_smp
372373
373374
- name: "Test: test-enif"
374375
working-directory: build
375376
run: |
377+
ulimit -c unlimited
376378
./tests/test-enif
377379
valgrind ./tests/test-enif
378380
379381
- name: "Test: test-mailbox"
380382
working-directory: build
381383
run: |
384+
ulimit -c unlimited
382385
./tests/test-mailbox
383386
valgrind ./tests/test-mailbox
384387
385388
- name: "Test: test-structs"
386389
timeout-minutes: 10
387390
working-directory: build
388391
run: |
392+
ulimit -c unlimited
389393
./tests/test-structs
390394
valgrind ./tests/test-structs
391395
392396
- name: "Test: test_etest.avm"
393397
timeout-minutes: 5
394398
working-directory: build
395399
run: |
400+
ulimit -c unlimited
396401
./src/AtomVM ./tests/libs/etest/test_etest.avm
397402
valgrind ./src/AtomVM ./tests/libs/etest/test_etest.avm
398403
399404
- name: "Test: test_estdlib.avm"
400405
timeout-minutes: 5
401406
working-directory: build
402407
run: |
408+
ulimit -c unlimited
403409
./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm
404410
valgrind ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm
405411
406412
- name: "Test: test_eavmlib.avm"
407413
timeout-minutes: 10
408414
working-directory: build
409415
run: |
416+
ulimit -c unlimited
410417
./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm
411418
valgrind ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm
412419
413420
- name: "Test: test_alisp.avm"
414421
timeout-minutes: 10
415422
working-directory: build
416423
run: |
424+
ulimit -c unlimited
417425
./src/AtomVM ./tests/libs/alisp/test_alisp.avm
418426
valgrind ./src/AtomVM ./tests/libs/alisp/test_alisp.avm
419427
420428
- name: "Test: Tests.avm (Elixir)"
421429
timeout-minutes: 10
422430
working-directory: build
423431
run: |
432+
ulimit -c unlimited
424433
if command -v elixirc &> /dev/null
425434
then
426435
./src/AtomVM ./tests/libs/exavmlib/Tests.avm
@@ -430,7 +439,40 @@ jobs:
430439
- name: "Install and smoke test"
431440
working-directory: build
432441
run: |
442+
ulimit -c unlimited
433443
sudo PATH=${PATH} make install
434444
atomvm examples/erlang/hello_world.avm
435445
atomvm -v
436446
atomvm -h
447+
448+
- name: "Run coredumpctl info"
449+
if: ${{ failure() }}
450+
run: |
451+
# Wait until systemd-coredump finished
452+
while ps x | grep -cE 'systemd-[c]oredump'; do
453+
echo systemd-coredump is still running
454+
sleep 1
455+
done
456+
# info works on all versions of ubuntu
457+
coredumpctl info || true
458+
# The following only works on recent versions of ubuntu
459+
coredumpctl debug --debugger-arguments="-batch -ex 'info all-registers'" || true
460+
coredumpctl debug --debugger-arguments="-batch -ex 'info threads'" || true
461+
coredumpctl debug --debugger-arguments="-batch -ex 'thread apply all bt full'" || true
462+
coredumpctl debug --debugger-arguments='-batch -ex "display /10i $pc"' || true
463+
coredumpctl dump -o core.dump || true
464+
if [ -e core.dump ]; then
465+
mkdir core
466+
mv core.dump core/
467+
cp build/src/AtomVM core/
468+
cp build/tests/test-* core/
469+
fi
470+
471+
- name: "Upload any dumped core"
472+
uses: actions/upload-artifact@v4
473+
if: ${{ failure() }}
474+
with:
475+
name: core-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.otp }}-${{ github.run_id }}-${{ github.run_attempt }}
476+
path: |
477+
core/*
478+
retention-days: 5

0 commit comments

Comments
 (0)