[Pkg-phototools-devel] Bug#880397: openimageio: Pull upstream commit to fix alignment issues on (at least) ARM

Adam Conrad adconrad at debian.org
Tue Oct 31 08:04:10 UTC 2017


Package: openimageio
Version: 1.7.17~dfsg0-1
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch



In Ubuntu, the attached patch was applied to achieve the following:

  * alignment.patch: Cherrypick upstream fix for ustring::TableRep alignment.

This doesn't immediately expose itself as a problem in the opemimageio
build itself and, indeed, isn't a problem on armhf systems where alignment
issues are trapped and fixed up on the fly (which is some, but not all of
them), however we saw it as a SIGBUS in blender on the Ubuntu buildds,
which don't trap and fix-up alignment errors.

... Adam

-- System Information:
Debian Release: buster/sid
  APT prefers bionic
  APT policy: (500, 'bionic')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-16-lowlatency (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
diff -Nru openimageio-1.7.17~dfsg0/debian/control openimageio-1.7.17~dfsg0/debian/control
--- openimageio-1.7.17~dfsg0/debian/control	2017-10-30 06:54:39.000000000 -0600
+++ openimageio-1.7.17~dfsg0/debian/control	2017-10-31 01:16:23.000000000 -0600
@@ -1,8 +1,7 @@
 Source: openimageio
 Section: libs
 Priority: optional
-Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
-XSBC-Original-Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel at lists.alioth.debian.org>
+Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel at lists.alioth.debian.org>
 Uploaders: Matteo F. Vescovi <mfv at debian.org>
 Build-Depends:
  cmake,
diff -Nru openimageio-1.7.17~dfsg0/debian/patches/alignment.patch openimageio-1.7.17~dfsg0/debian/patches/alignment.patch
--- openimageio-1.7.17~dfsg0/debian/patches/alignment.patch	1969-12-31 17:00:00.000000000 -0700
+++ openimageio-1.7.17~dfsg0/debian/patches/alignment.patch	2017-10-31 01:15:28.000000000 -0600
@@ -0,0 +1,22 @@
+commit 8074ac9b28513c2a9f2dbe9dcb0733076d0ea8e7
+Author: Chris Kulla <ckulla at imageworks.com>
+Date:   Wed Apr 12 17:48:21 2017 -0700
+
+    Pad the length of pool allocations for ustring::TableRep so that the next one allocated will also be aligned
+    
+    This was noticed by the undefined behavior sanitizer
+
+diff --git a/src/libutil/ustring.cpp b/src/libutil/ustring.cpp
+index 82743ba9..1e494f91 100644
+--- a/src/libutil/ustring.cpp
++++ b/src/libutil/ustring.cpp
+@@ -164,6 +164,9 @@ private:
+     }
+ 
+     char* pool_alloc(size_t len) {
++        // round up to nearest multiple of pointer size to guarentee proper alignment of TableRep objects
++        len = (len + alignof(ustring::TableRep) - 1) & ~(alignof(ustring::TableRep) - 1);
++
+         if (len >= POOL_SIZE) {
+             memory_usage += len;
+             return (char*) malloc(len); // no need to try and use the pool
diff -Nru openimageio-1.7.17~dfsg0/debian/patches/series openimageio-1.7.17~dfsg0/debian/patches/series
--- openimageio-1.7.17~dfsg0/debian/patches/series	2017-10-30 06:54:45.000000000 -0600
+++ openimageio-1.7.17~dfsg0/debian/patches/series	2017-10-31 01:16:20.000000000 -0600
@@ -1 +1,2 @@
 0001-Fix_documentation_generation.patch
+alignment.patch


More information about the Pkg-phototools-devel mailing list