{"id":18739538,"url":"https://github.com/springmeyer/travis-coredump","last_synced_at":"2026-02-28T06:22:45.556Z","repository":{"id":22001125,"uuid":"25326235","full_name":"springmeyer/travis-coredump","owner":"springmeyer","description":"Sample repo showing how to enable and view C/C++ crash backtraces on travis","archived":false,"fork":false,"pushed_at":"2022-06-24T00:01:21.000Z","size":33,"stargazers_count":20,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-24T20:13:34.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/springmeyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-16T23:01:56.000Z","updated_at":"2024-03-12T19:29:54.000Z","dependencies_parsed_at":"2022-09-09T02:02:39.968Z","dependency_job_id":null,"html_url":"https://github.com/springmeyer/travis-coredump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/springmeyer/travis-coredump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Ftravis-coredump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Ftravis-coredump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Ftravis-coredump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Ftravis-coredump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springmeyer","download_url":"https://codeload.github.com/springmeyer/travis-coredump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Ftravis-coredump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29926288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-07T15:36:15.192Z","updated_at":"2026-02-28T06:22:45.526Z","avatar_url":"https://github.com/springmeyer.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## travis-coredump\n\n[![Build Status](https://travis-ci.org/springmeyer/travis-coredump.svg?branch=master)](https://travis-ci.org/springmeyer/travis-coredump)\n\nWARNING: only `sudo:true` machines can produce coredumps currently on travis (https://github.com/springmeyer/travis-coredump/issues/6)\n\nOn travis you might see a cryptic error like:\n\n    /home/travis/build.sh: line 41:  2300 Segmentation fault\n\nOr:\n\n    *** glibc detected *** ./test: double free or corruption (top): ***\n\nYay, your app segfaulted or hit a double-free. And you can't reproduce locally. And running your program in the gdb interpreter won't work on a remote machine. What now?\n\nYou have come to the right place.\n\nThis repo contains a demo of:\n\n - How to enable coredumps for linux (`ulimit -c unlimited`)\n - A c++ program that will simulate a crash\n - The `gdb` incantation to make the crash backtrace visible in the travis logs\n\nSee `.travis.yml` for detailed instructions you can copy into your own `.travis.yml`. See sample logs at \u003chttps://travis-ci.org/springmeyer/travis-coredump/\u003e. This repo is configured so that with two runs in the travis matix:\n\n  - One run tests a program that does not crash and therefore the build should cleanly pass\n  - The other run tests a program that does crash, reports the backtrace, then exits the run with the same errorcode as generated by the crash.\n\nThe backtrace should reveal to you the file and line number of the bug:\n\n```\nCore was generated by `./test'.\nProgram terminated with signal 11, Segmentation fault.\n#0  0x00007f438532302c in free () from /lib/x86_64-linux-gnu/libc.so.6\nThread 1 (LWP 2611):\n#0  0x00007f438532302c in free () from /lib/x86_64-linux-gnu/libc.so.6\n#1  0x00000000004005d6 in main () at might_crash.cpp:6\n```\n\n## Running locally\n\nTo experiment locally:\n\n1) Build the test program\n\n```sh\nmake\n```\n\n2) Enable core files\n\n```sh\nulimit -c unlimited -S\n```\n\n3) Run test program and make it crash\n\n```\nCRASH_PLEASE=1 ./test\n```\n\nYou should see a nasty error show up with `(core dumped)` in the last line.\n\n4) Generate a backtrace\n\nGreat, so now that you've confirmed it crashed, let's get more fancy.\n\nTo script the auto generation of the backtrace we can collect the PID and use that to find the core file and generate a backtrace:\n\n\n#### OS X\n\nOn OS X for this to work (unfortunely) you need a very recent lldb version.\n```sh\nCRASH_PLEASE=1 ./test \u0026 pid=$! \u0026\u0026 fg;\nlldb --core /cores/core.$pid --batch --one-line \"bt\"\n```\n\n#### Linux\n\n```sh\nsudo apt-get install gdb\nCRASH_PLEASE=1 ./test\ngdb $(pwd)/test core -ex \"thread apply all bt\" -ex \"set pagination 0\" -batch\n```\n\n\n### Other platforms\n\nIf you are on OS X, you don't need to worry about these steps, just look inside:\n\n    ~/Library/Logs/DiagnosticReports/\n\nAnd a backtrace should be present for any program that just crashed.\n\nIf you are on Windows, let me know if you have tips on generating backtraces for crashes on the command line.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringmeyer%2Ftravis-coredump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringmeyer%2Ftravis-coredump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringmeyer%2Ftravis-coredump/lists"}