Skip to content

Commit 6dd7867

Browse files
committed
Merge pull request #1475 from pguyot/w03/upload-dumped-cores
Upload cores dumped in build-and-test CI After many frustrating runs, this code eventually allowed me to get a trace for a rare core dump related to socket resources. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 13b327d + fa28721 commit 6dd7867

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)