From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13175 invoked by alias); 25 Apr 2017 12:49:58 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 13014 invoked by uid 89); 25 Apr 2017 12:49:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-24.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Ulf Hermann , Mark Wielaard Subject: [PATCH 2/5] tests: Add core backtracegen chec and regenerate ppc32 backtrace test files. Date: Tue, 25 Apr 2017 12:50:00 -0000 Message-Id: <1493124579-21017-2-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1493124579-21017-1-git-send-email-mark@klomp.org> References: <1493124006.31726.33.camel@klomp.org> <1493124579-21017-1-git-send-email-mark@klomp.org> X-SW-Source: 2017-q2/txt/msg00081.txt.bz2 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 --- tests/ChangeLog | 7 +++++++ tests/backtrace-subr.sh | 14 ++++++++++++++ tests/backtrace.ppc.core.bz2 | Bin 46357 -> 44482 bytes tests/backtrace.ppc.exec.bz2 | Bin 352898 -> 352197 bytes tests/run-backtrace-core-ppc.sh | 9 +++++++++ 5 files changed, 30 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index a71db45..6f5956b 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,10 @@ +2017-04-25 Mark Wielaard + + * backtrace-subr.sh (check_backtracegen): New function. + (check_core): Add check_backtracegen call. + * backtrace.ppc.exec.bz2: Regenerated. + * backtrace.ppc.core.bz2: Likewise. + 2017-04-24 Mark Wielaard * backtrace.c: Remove option to allow unknown symbols in the trace. diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index e746dc1..a303e32 100644 --- a/tests/backtrace-subr.sh +++ b/tests/backtrace-subr.sh @@ -40,6 +40,19 @@ check_gsignal() false } + +# Makes sure we saw the function that initiated the backtrace +# when the core was generated through the tests backtrace --gencore. +# This might disappear when frame pointer chasing gone bad. +check_backtracegen() +{ + if grep -w backtracegen $1; then + return + fi + echo >&2 $2: no backtracegen + false +} + # Verify the STDERR output does not contain unexpected errors. # In some cases we cannot reliably find out we got behind _start as some # operating system do not properly terminate CFI by undefined PC. @@ -105,6 +118,7 @@ check_core() cat backtrace.$arch.{bt,err} check_unsupported backtrace.$arch.err backtrace.$arch.core check_all backtrace.$arch.{bt,err} backtrace.$arch.core + check_backtracegen backtrace.$arch.bt backtrace.$arch.core } # Backtrace live process. diff --git a/tests/run-backtrace-core-ppc.sh b/tests/run-backtrace-core-ppc.sh index 65c9279..555ac35 100755 --- a/tests/run-backtrace-core-ppc.sh +++ b/tests/run-backtrace-core-ppc.sh @@ -17,4 +17,13 @@ . $srcdir/backtrace-subr.sh +# executable generated by: +# +# gcc -D_GNU_SOURCE -I. -I.. -I../lib -m32 -pthread -static -g \ +# -o backtrace.ppc.exec backtrace-child.c +# +# core generated by: +# +# ./backtrace.ppc.exec --gencore + check_core ppc -- 1.8.3.1