[tbb] 01/03: Enhanced debugging, gdb analysis for failed tbbmalloc tests

Steven Capper capper-guest at moszumanska.debian.org
Sun Jul 30 20:46:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

capper-guest pushed a commit to branch master
in repository tbb.

commit 54923a8824343d8cce354ea8803808c5cdfd3797
Author: Steve Capper <steven.capper at gmail.com>
Date:   Sat Jul 29 13:26:08 2017 +0100

    Enhanced debugging, gdb analysis for failed tbbmalloc tests
---
 debian/control                          |  2 +-
 debian/patches/enhanced-debugging.patch | 74 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 3 files changed, 76 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index f9bf0fb..21ec680 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
 Source: tbb
 Priority: extra
 Maintainer: Steve Capper <steven.capper at gmail.com>
-Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), libjs-jquery, dh-exec (>=0.3)
+Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), libjs-jquery, dh-exec (>=0.3), gdb
 Standards-Version: 4.0.0
 Section: libs
 Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/tbb.git
diff --git a/debian/patches/enhanced-debugging.patch b/debian/patches/enhanced-debugging.patch
new file mode 100644
index 0000000..1508fc7
--- /dev/null
+++ b/debian/patches/enhanced-debugging.patch
@@ -0,0 +1,74 @@
+Index: tbb/build/gdb_shell.sh
+===================================================================
+--- /dev/null
++++ tbb/build/gdb_shell.sh
+@@ -0,0 +1,39 @@
++#!/bin/sh
++
++# Run some tests through gdb, we rely on a hack to detect whether or
++# or not the run completed successfully. $_exitcode will be set if the
++# test finishes without breaking.
++#
++# If the test breaks, we dump a full backtrace. Then return with an
++# error to ensure that the build stops.
++
++programname=$1
++shift
++args=$@
++
++$programname $args
++rc=$?
++if [ "$rc" -eq "0" ]; then
++    exit 0
++fi
++
++echo "Unit test failed: rc=$rc, attempting to re-run with gdb and post-mortem."
++
++temp_file=$(mktemp)
++
++cat >$temp_file <<EOF
++set pagination off
++set \$_exitcode=3142
++r $args
++if \$_exitcode==3142
++    bt full
++    info proc mappings
++    quit -1
++end
++quit
++EOF
++
++gdb $programname -x $temp_file
++rc=$?
++rm $temp_file
++exit $rc
+Index: tbb/build/Makefile.tbbmalloc
+===================================================================
+--- tbb.orig/build/Makefile.tbbmalloc
++++ tbb/build/Makefile.tbbmalloc
+@@ -43,6 +43,8 @@ ORIG_CPLUS_FLAGS:=$(CPLUS_FLAGS)
+ ORIG_INCLUDES:=$(INCLUDES)
+ ORIG_LINK_MALLOC.LIB:=$(LINK_MALLOC.LIB)
+ 
++run_cmd = sh ../gdb_shell.sh
++
+ #------------------------------------------------------
+ # Define rules for making the TBBMalloc shared library.
+ #------------------------------------------------------
+Index: tbb/build/linux.gcc.inc
+===================================================================
+--- tbb.orig/build/linux.gcc.inc
++++ tbb/build/linux.gcc.inc
+@@ -70,10 +70,10 @@ ifneq (,$(shell gcc -dumpversion | egrep
+ endif
+ 
+ ifeq ($(cfg), release)
+-        CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
++        CPLUS_FLAGS = $(ITT_NOTIFY) -g3 -O2 -DUSE_PTHREAD
+ endif
+ ifeq ($(cfg), debug)
+-        CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
++        CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g3 -O0 -DUSE_PTHREAD
+ endif
+ 
+ TBB_ASM.OBJ=
diff --git a/debian/patches/series b/debian/patches/series
index 17ac0bd..ba9f415 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ cross.patch
 fix-armel.patch
 allow-reproducible-builds.patch
 fixup-mips-harness.patch
+enhanced-debugging.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/tbb.git



More information about the debian-science-commits mailing list