summaryrefslogtreecommitdiff
path: root/tests/backtrace-subr.sh
Commit message (Collapse)AuthorAgeFilesLines
* tests: Accept any core if no core with the "correct" pid can be found.Mark Wielaard2018-02-161-0/+7
| | | | | | | | | In some containers our view of pids is confused. We see the container pid namespace, but the core is generated using the host pid namespace. Since tests are run in a new fresh directory any core here is most like is ours. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Try to use coredumpctl to extract core files.Mark Wielaard2017-12-291-2/+31
| | | | | | | | | | If systemd-coredump is installed we have to use coredumpctl to extract the core file to test. Unfortunately systemd-coredump/coredumpctl seem to be somewhat fragile if multiple core dumps are generated/extracted at the same time. So use a lock file to only run one core dump test at a time (under make -j). Signed-off-by: Mark Wielaard <mark@klomp.org>
* ppc64: Add minimal fallback unwinder.Mark Wielaard2017-06-121-1/+1
| | | | | | | | | | | | | This adds a minimal fallback unwinder for ppc64[le] in case we cannot find CFI for a particular address. It simply always sets the program counter to the link register, picks the previous stack pointer from the backchain, and the previous link register from the LR save area. This is enough for some simple situations when we don't have CFI and seems to work nicely in the case of perf with libdw powerpc support: https://lkml.org/lkml/2017/5/18/998 Signed-off-by: Mark Wielaard <mark@klomp.org>
* Add frame pointer unwinding for aarch64 and relax backtrace testcases.Ulf Hermann2017-05-021-1/+1
| | | | | | | | | | | | | | | If we don't find any debug information for a given frame, we usually cannot unwind any further. However, the binary in question might have been compiled with frame pointers, in which case we can look up the well known frame pointer locations in the stack snapshot and use them to bridge the frames without debug information. Relax the backtrace core testcases a little by allowing a duplicate sigusr2 frame or a backtrace ending with an invalid register. Both of which can happen if the frame pointer unwinder guesses slightly wrong. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io> Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Add core backtracegen check and regen ppc32 backtrace testfiles.Mark Wielaard2017-05-021-0/+14
| | | | | | | | | | | | | Add a check to check_core to make sure the backtracegen function is found in the backtrace. This function is in the middle of the backtrace in the main executable and if not found it means the backtrace was incomplete or the frame was skipped (which could happen on a bad frame pointer only unwind). This showed that the ppc32 backtrace test files were missing DWARF CFI for the main executable. Regenerated them to include full CFI. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Revert "Optionally allow unknown symbols in the backtrace tests"Mark Wielaard2017-05-021-9/+3
| | | | | | | | | | | | | | This reverts commit f9971cb422df39adea7e8c7e22689b879e39c626. Allowing no symbol resolving at all makes it too hard to see whether the test actually tests anything. But do keep "address out of range" as allowed error in check_err. This can be interpreted as DWARF not available (if end of callstack marker is missing, which it unfortunately often is missing even if CFI is available.). Signed-off-by: Mark Wielaard <mark@klomp.org>
* Optionally allow unknown symbols in the backtrace testsUlf Hermann2017-02-141-4/+10
| | | | | | | | This is useful to test unwinding without debug information. The binaries being examined might still have frame pointers that allow us to bridge the unknown symbols. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
* tests: Always print reason when skipping test.Mark Wielaard2015-06-051-2/+2
| | | | | | Make sure the reason a test is SKIPPED is added to the test-suite.log. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: run-deleted.sh should SKIP if arch doesn't support unwinding.Mark Wielaard2014-12-191-1/+1
| | | | | | | Also relax the special ARM needs DWARF check a little to account for eu-stack error output. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: backtrace-subr.sh add check_native_unsupported.Mark Wielaard2014-06-171-3/+10
| | | | | | | | The special arm check in check_unsupported should only trigger for native tests, otherwise on arm various backtrace tests would be skipped that should work just fine. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Unwinding is only supported on LinuxKurt Roeckx2014-04-231-0/+1
| | | | Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
* backends: Add arm frame_nregs and set_initial_registers_tid.Mark Wielaard2014-01-301-0/+12
| | | | | | | | | | | | | This allows CFI unwinding for ARM. It relies on having .debug_frame around which is always the case in our testsuite. All native backtrace tests PASS on arm if debuginfo (for glibc) is installed on the system. Otherwise the tests SKIP. For non-debug unwinding ARM uses EXIDX tables, not .eh_frames, which would have to be translated to CFI to do unwinding without .debug_frame available. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: backtrace-subr.sh (check_native_core) should check core file name.Matthias Klose2014-01-071-0/+5
| | | | | | | Needed when /proc/sys/kernel/core_uses_pid is set to 0. Try to rename the core file, and if it does still fail, skip the test. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: backtrace-subr.sh skip check_native_core test if core ulimit fails.Mark Wielaard2014-01-041-1/+2
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Disable valgrind for core dumping and for self-introspecting tests.Mark Wielaard2013-12-131-0/+11
| | | | | | | | | | | | | | | The only tests that fork and exec are those that will then try to ptrace attach the child for unwind testing. That won't work when the child is also running under valgrind. So remove --trace-children=yes. Also disable valgrind while dumping a core or for tests that try to inspect their own state. They will get confused otherwise finding pieces of valgrind in their maps. Note we still seem to hit the following valgrind bug because the way we map and unmap some shared libraries gets valgrind confused: https://bugs.kde.org/show_bug.cgi?id=327427 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Tests for unwinder of x86*.Jan Kratochvil2013-12-021-0/+115
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>