freebsd / atf

Libraries to write tests in C, C++ and shell
Other
133 stars 45 forks source link

Add option to dump core with gdb after a program signals unexpectedly #27

Open ngie-eign opened 7 years ago

ngie-eign commented 7 years ago

I had to manually execute an ATF test program in a loop with gdb in order reproduce the issue noted in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215715 . I shouldn't have to do this -- the framework should do this for me.

$ cat cond_timedwait_race.gdbscript
set args cond_timedwait_race
run
generate-core-file
$ while gdb -batch -x cond_timedwait_race.gdbscript /usr/tests/lib/libthr/cond_test cond_timedwait_race; do :; done
jmmv commented 7 years ago

I don't understand what you mean by "dump core with gdb" (the gdb part). Dumping core should happen regardless of gdb on reception of certain signals.

What I had in mind a long time ago to do in this area, which I think would resolve your situation, was to add an option to both kyua test and kyua debug to keep the work directories around for any failed tests. Those directories would then contain the core dumps you are interested in.