Save corefile on assert failures [WIP] #135
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

gdb, just to see what's possible.This is a separate implementation but the same idea as #134.
This implementation is more useful but also less clean. It provides you with coredumps but in order to do so there are a few different bits of GDB usage, and it always outputs 4 thrown signals on startup (you can probably fix this with some more changes to the code if you wanted to).
Originally I implemented this with a simple straight-forward gdb script. That didn't work well enough:
generate-core-filecan only dump to a fixed filename or tocore.$PID, there's no other dynamic option. This meant only 1 testcase could create a dump, not great. Then I used a Python breakpoint class to rungdb.execute("create-core-file " + timestamp)within thestop()method but that didn't work becausegdbalways switched over to interactive mode after dumping, breaking everything.Long story short... I found workarounds, this does what I originally envisioned.
This PR will save a corefile when an assertion failure is triggered. An example output: