[heaptrack] 01/08: Fix unittests due to libunwind. (Closes: #860949)

Anton Gladky gladk at moszumanska.debian.org
Wed May 3 20:34:20 UTC 2017


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

gladk pushed a commit to branch master
in repository heaptrack.

commit 3977193d79cf5f44702cf19cebe0ac6abe1bc7ff
Author: Milian Wolff <milian.wolff at kdab.com>
Date:   Wed May 3 17:59:12 2017 +0200

    Fix unittests due to libunwind. (Closes: #860949)
---
 debian/patches/10_fix_libunwind_test.patch | 32 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 2 files changed, 33 insertions(+)

diff --git a/debian/patches/10_fix_libunwind_test.patch b/debian/patches/10_fix_libunwind_test.patch
new file mode 100644
index 0000000..087c620
--- /dev/null
+++ b/debian/patches/10_fix_libunwind_test.patch
@@ -0,0 +1,32 @@
+From 3ddc8ba3c751436fddd2969ba349a76ab6b7f8d1 Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff at kdab.com>
+Date: Wed, 3 May 2017 17:35:18 +0200
+Subject: [PATCH] Filter zero frames from the end of the stack returned by
+ libunwind
+
+Some (older) versions of libunwind eratically return zero frames
+at the end of the stack. This happened on Debian and Ubuntu with the
+distro provided libunwind. In such situations, we now skip these
+uninteresting frames.
+
+BUG: 379082
+---
+ src/track/trace.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/track/trace.h b/src/track/trace.h
+index e986f29..3e96ff2 100644
+--- a/src/track/trace.h
++++ b/src/track/trace.h
+@@ -59,6 +59,11 @@ struct Trace
+     bool fill(int skip)
+     {
+         int size = unw_backtrace(m_data, MAX_SIZE);
++        // filter bogus frames at the end, which sometimes get returned by libunwind
++        // cf.: https://bugs.kde.org/show_bug.cgi?id=379082
++        while (size > 0 && !m_data[size - 1]) {
++            --size;
++        }
+         m_size = size > skip ? size - skip : 0;
+         m_skip = skip;
+         return m_size > 0;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a39cf3f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+10_fix_libunwind_test.patch

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



More information about the debian-science-commits mailing list