[dune-common] 01/02: Backport fix for build failure on powerpc.

Ansgar Burchardt ansgar at moszumanska.debian.org
Tue Jul 7 20:40:53 UTC 2015


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

ansgar pushed a commit to annotated tag debian/2.3.1-3
in repository dune-common.

commit 4f95a8ad08aeadd9e433d434533a93e5bc8b999f
Author: Ansgar Burchardt <ansgar at debian.org>
Date:   Tue Jul 7 22:37:16 2015 +0200

    Backport fix for build failure on powerpc.
---
 ...ugallocator-use-unsigned-integer-type-for.patch | 37 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 38 insertions(+)

diff --git a/debian/patches/0001-release-debugallocator-use-unsigned-integer-type-for.patch b/debian/patches/0001-release-debugallocator-use-unsigned-integer-type-for.patch
new file mode 100644
index 0000000..8029fa7
--- /dev/null
+++ b/debian/patches/0001-release-debugallocator-use-unsigned-integer-type-for.patch
@@ -0,0 +1,37 @@
+From 1659ea4b8374fbfbd40ae73490da0ff797db4560 Mon Sep 17 00:00:00 2001
+From: Ansgar Burchardt <burchardt at igpm.rwth-aachen.de>
+Date: Mon, 11 May 2015 23:58:39 +0200
+Subject: [PATCH] [release] debugallocator: use unsigned integer type for
+ pointer arithmetic
+
+ptrdiff_t is a signed integer type and so the expression
+  (std::uintptr_t)(ptr) % page_size
+could become a negative value. In this case the page_ptr would be the
+address of the next page after the allocation.
+
+This wrong behaviour could be observed on (32bit) PowerPC: here
+ptr was 0xf78cfe00 and page_ptr was calculated as 0xf78d0000 instead
+of the correct 0xf78c0000.
+---
+ dune/common/debugallocator.hh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/dune/common/debugallocator.hh
++++ b/dune/common/debugallocator.hh
+@@ -9,6 +9,7 @@
+ #include <vector>
+ #include <iostream>
+ #include <cstring>
++#include <cstdint>
+ #include <cstdlib>
+ #include <new>
+ #if HAVE_SYS_MMAN_H and HAVE_MPROTECT
+@@ -143,7 +144,7 @@
+         // compute page address
+         void* page_ptr =
+           static_cast<void*>(
+-            (char*)(ptr) - ((difference_type)(ptr) % page_size));
++            (char*)(ptr) - ((std::uintptr_t)(ptr) % page_size));
+         // search list
+         AllocationList::iterator it;
+         unsigned int i = 0;
diff --git a/debian/patches/series b/debian/patches/series
index afe5bb7..4c183fa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ dune-autogen.patch
 skip-dirs-starting-with-dot.patch
 rename-git-whitespace-hook.patch
 0001-Fix-wrong-std-cerr-at-end-of-output.patch
+0001-release-debugallocator-use-unsigned-integer-type-for.patch

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



More information about the debian-science-commits mailing list