{"id":16248565,"url":"https://github.com/itamarst/gha-upload-cores","last_synced_at":"2025-06-26T17:32:29.420Z","repository":{"id":45400240,"uuid":"513608052","full_name":"itamarst/gha-upload-cores","owner":"itamarst","description":"Demonstration of uploading core dumps from your GitHub Actions run","archived":false,"fork":false,"pushed_at":"2022-07-13T18:40:55.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T12:18:19.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itamarst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-13T17:13:11.000Z","updated_at":"2022-07-13T17:23:08.000Z","dependencies_parsed_at":"2022-09-22T18:30:46.878Z","dependency_job_id":null,"html_url":"https://github.com/itamarst/gha-upload-cores","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itamarst/gha-upload-cores","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itamarst%2Fgha-upload-cores","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itamarst%2Fgha-upload-cores/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itamarst%2Fgha-upload-cores/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itamarst%2Fgha-upload-cores/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itamarst","download_url":"https://codeload.github.com/itamarst/gha-upload-cores/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itamarst%2Fgha-upload-cores/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262113463,"owners_count":23261033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:42:26.579Z","updated_at":"2025-06-26T17:32:29.374Z","avatar_url":"https://github.com/itamarst.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Howto: Get access to core dumps from GitHub Actions runs\n\nSometimes your software segfaults when running tests in CI. That's great! Better it fail in CI than in production. But then you need to debug that segfault, in which case a coredump would be very helpful.\n\nAlternatives:\n\n* [SSH into your running workflow](https://mxschmitt.github.io/action-tmate/)\n\n## Getting coredumps\n\nBut how do you get a coredump to your computer?\n\nIn order to get coredumps you can debug, you need to:\n\n1. Upload the binary that generated that coredump.\n2. Make sure the coredump was stored to disk on segfaults and the like.\n3. Upload the coredump even though a CI step has failed.\n\nTo ensure core dumps are stored to disk you need to:\n\n1. Override `/proc/sys/kernel/core_pattern` so core dumps are written to file instead passed to `apport` (the default on Ubuntu).\n2. Run `ulimit -c unlimited` in the relevant step to ensure core dumps get written to disk.\n\nThis repository demonstrates how to do this; see [the Workflow definition](.github/workflows/build.yml) to see the necessary steps.\nThe coredumps will end up as downloadable artifacts in the results of each relevant GitHub Actions runs.\n\n## Debugging the resulting cores\n\nThe program will have been compiled on Ubuntu (whatever version you configured in GHA), so some of the shared libraries might not be in the right location unless you use a matching Docker image.\nHowever, given the original executable you can at least see your own code.\nAfter downloading `executable.zip` and `cores.zip` from the GHA artifacts to the directory with the source code:\n\n```shell-session\n$ unzip executable.zip\nArchive:  executable.zip\n  inflating: example\n$ unzip cores.zip\nArchive:  cores.zip\n  inflating: example.1603.1657733715\n$ gdb ./example -core ./example.1603.*\n...\nCore was generated by `./example'.\nProgram terminated with signal SIGSEGV, Segmentation fault.\n#0  0x0000563a1b2b1190 in main () at main.c:6\n6         string[0] = 'b';\n(gdb) \n```\n\nIf your code is a shared library, and it is in the current directory, you can load it into gdb like so:\n\n```\n(gdb) set solib-search-path .\n(gdb) sharedlibrary library-downloaded-from-gha.so\n```\n\n## This repository is sponsored by [Sciagraph](https://sciagraph.com), a performance observability service for Python batch jobs.\n\nAnd, yes, sometimes my code segfaults in CI.\nThat's why I run tests in CI, to catch bugs in advance before they're released!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitamarst%2Fgha-upload-cores","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitamarst%2Fgha-upload-cores","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitamarst%2Fgha-upload-cores/lists"}