[HarfBuzz] harfbuzz: Branch 'master' - 3 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Oct 6 19:32:12 UTC 2018


 .circleci/config.yml        |    2 +-
 src/hb-aat-layout-common.hh |    8 +++++---
 test/shaping/run-tests.py   |   14 +++++++-------
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 7ee50af8366547c382047a30a94f7f5f739aabcb
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Oct 6 21:31:44 2018 +0200

    [morx] Fix memory access issues with unsafe_to_break

diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh
index c6b519d8..97866919 100644
--- a/src/hb-aat-layout-common.hh
+++ b/src/hb-aat-layout-common.hh
@@ -561,15 +561,17 @@ struct StateTableDriver
 	break;
 
       /* Unsafe-to-break before this if not in state 0, as things might
-       * go differently if we start from state 0 here. */
-      if (state && buffer->idx)
+       * go differently if we start from state 0 here.
+       *
+       * Ugh.  The indexing here is ugly... */
+      if (state && buffer->backtrack_len () && buffer->idx < buffer->len)
       {
 	/* If there's no action and we're just epsilon-transitioning to state 0,
 	 * safe to break. */
 	if (c->is_actionable (this, entry) ||
 	    !(entry->newState == StateTable<EntryData>::STATE_START_OF_TEXT &&
 	      entry->flags == context_t::DontAdvance))
-	  buffer->unsafe_to_break (buffer->idx - 1, buffer->idx + 1);
+	  buffer->unsafe_to_break_from_outbuffer (buffer->backtrack_len () - 1, buffer->idx + 1);
       }
 
       /* Unsafe-to-break if end-of-text would kick in here. */
commit f58c5175890e666503b6f140d238e1abca91598e
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Sat Oct 6 22:42:56 2018 +0330

    Make msan output a little more readable

diff --git a/.circleci/config.yml b/.circleci/config.yml
index af443ad9..69520b01 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -126,7 +126,7 @@ jobs:
       - run: update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.lld" 10
       - run: wget https://ftp.gnome.org/pub/gnome/sources/glib/2.58/glib-2.58.1.tar.xz && tar xf glib-2.58.1.tar.xz && cd glib-2.58.1 && ./autogen.sh --with-pcre CPPFLAGS="-fsanitize=memory" LDFLAGS="-fsanitize=memory" CFLAGS="-fsanitize=memory" CXXFLAGS="-fsanitize=memory" LD=ld.lld CC=clang CXX=clang++ && make -j32 && make install && cd ..
       - run: wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.bz2 && tar xf freetype-2.9.tar.bz2 && cd freetype-2.9 && ./autogen.sh && ./configure CPPFLAGS="-fsanitize=memory" LDFLAGS="-fsanitize=memory -O1 -g -fno-omit-frame-pointer" CFLAGS="-fsanitize=memory -O1 -g -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=memory -O1 -g -fno-omit-frame-pointer" LD=ld.lld CC=clang CXX=clang++ && make -j32 && make install && cd ..
-      - run: CPPFLAGS="-fsanitize=memory" LDFLAGS="-fsanitize=memory -O1 -g -fno-omit-frame-pointer" CFLAGS="-fsanitize=memory -O1 -g -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=memory -O1 -g -fno-omit-frame-pointer" LD=ld.lld CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --without-icu
+      - run: CPPFLAGS="-fsanitize=memory -fsanitize-memory-track-origins" LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins -O1 -g -fno-omit-frame-pointer" CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins -O1 -g -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=memory -fsanitize-memory-track-origins -O1 -g -fno-omit-frame-pointer" LD=ld.lld CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --without-icu
       - run: make -j32 && MSAN_OPTIONS=exitcode=42 make check || .ci/fail.sh | asan_symbolize | c++filt
 
   clang-tsan:
commit e9abe33963739f753cdfb007eed40101ce33f550
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Sat Oct 6 12:19:33 2018 +0330

    Use tempfile in run-tests as a fix for Windows CI fails (#1228)

diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index 0b27872f..f77a17c3 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -2,16 +2,16 @@
 
 from __future__ import print_function, division, absolute_import
 
-import sys, os, subprocess
+import sys, os, subprocess, tempfile
 
 
 def cmd(command):
-	p = subprocess.Popen (
-		command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-	p.wait ()
-	print (p.stderr.read ().decode ("utf-8").strip ()) # file=sys.stderr
-	return p.stdout.read ().decode ("utf-8").strip (), p.returncode
-
+	# https://stackoverflow.com/a/4408409
+	with tempfile.TemporaryFile() as tempf:
+		p = subprocess.Popen (command, stdout=tempf, stderr=sys.stdout)
+		p.wait ()
+		tempf.seek(0)
+		return tempf.read().decode ("utf-8").strip (), p.returncode
 
 args = sys.argv[1:]
 if not args or sys.argv[1].find('hb-shape') == -1 or not os.path.exists (sys.argv[1]):


More information about the HarfBuzz mailing list