New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 796124 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 794896



Sign in to add a comment

Roll HarfBuzz to 1.7.3

Project Member Reported by drott@chromium.org, Dec 19 2017

Issue description

Attempt in https://chromium-review.googlesource.com/c/chromium/src/+/831946 causes a layout test failure.
 

Comment 1 by drott@chromium.org, Dec 19 2017

Compiling and linking https://gist.github.com/drott/c78215e20bf23648f11a05ff3850a13c against libfreetype_harfbuzz.so from the Chromium tree shows that glyph id 2 loses hinting after HarfBuzz commit a7bd6d7a4c53ff61d7d8286a594aaa0a0e15b1a1.

(from the subsetted test font from https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/third_party/NotoSans/NotoSansDevanagari-Regular-uni091D.ttf 


The stack trace for where one of the set function returns false is:


Breakpoint 1, main () at main.cpp:11
11	  SkImageInfo image_info = SkImageInfo::Make(100, 100, SkColorType::kRGB_565_SkColorType, SkAlphaType::kOpaque_SkAlphaType);
(gdb) c
Continuing.
Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf

Breakpoint 3, hb_set_t::add_sorted_array<OT::IntType<unsigned short, 2u> > (this=0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>, array=0x7ffff4c064b2, count=1, stride=2)
    at ../../third_party/harfbuzz-ng/src/hb-set-private.hh:287
287	    if (unlikely (in_error)) return false;
(gdb) p in_error
$1 = true
(gdb) bt 20
#0  hb_set_t::add_sorted_array<OT::IntType<unsigned short, 2u> > (this=0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>, array=0x7ffff4c064b2, count=1, stride=2)
    at ../../third_party/harfbuzz-ng/src/hb-set-private.hh:287
#1  0x00007ffff5bc0dac in OT::CoverageFormat1::add_coverage<hb_set_t> (this=0x7ffff4c064ae, glyphs=0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>)
    at ../../third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh:719
#2  0x00007ffff5bc0abd in OT::Coverage::add_coverage<hb_set_t> (this=0x7ffff4c064ae, glyphs=0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>)
    at ../../third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh:935
#3  0x00007ffff5bc098c in OT::SingleSubstFormat1::collect_glyphs (this=0x7ffff4c064a8, c=0x7fffffff84d8) at ../../third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh:57
#4  0x00007ffff5bc08fd in OT::hb_collect_glyphs_context_t::dispatch<OT::SingleSubstFormat1> (this=0x7fffffff84d8, obj=...) at ../../third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh:114
#5  0x00007ffff5bc0234 in OT::SingleSubst::dispatch<OT::hb_collect_glyphs_context_t> (this=0x7ffff4c064a8, c=0x7fffffff84d8) at ../../third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh:244
#6  0x00007ffff5bbff0d in OT::SubstLookupSubTable::dispatch<OT::hb_collect_glyphs_context_t> (this=0x7ffff4c064a8, c=0x7fffffff84d8, lookup_type=1)
    at ../../third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh:1108
#7  0x00007ffff5bbfdcd in OT::Lookup::dispatch<OT::SubstLookupSubTable, OT::hb_collect_glyphs_context_t> (this=0x7ffff4c064a0, c=0x7fffffff84d8)
    at ../../third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh:624
#8  0x00007ffff5bbfd68 in OT::SubstLookup::dispatch<OT::hb_collect_glyphs_context_t> (this=0x7ffff4c064a0, c=0x7fffffff84d8) at ../../third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh:1263
#9  0x00007ffff5bbc36b in OT::SubstLookup::collect_glyphs (this=0x7ffff4c064a0, c=0x7fffffff84d8) at ../../third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh:1170
#10 0x00007ffff5bb5110 in hb_ot_layout_lookup_collect_glyphs (face=0x6093b0, table_tag=1196643650, lookup_index=0, glyphs_before=0x0, glyphs_input=0x0, glyphs_after=0x0, glyphs_output=0x606c30)
    at ../../third_party/harfbuzz-ng/src/hb-ot-layout.cc:831
#11 0x00007ffff5af3f66 in af_shaper_get_coverage (globals=0x605cf0, style_class=0x7ffff5a3bfbc <af_deva_dflt_style_class>, gstyles=0x605ff8, default_script=0 '\000')
    at ../../third_party/freetype/src/src/autofit/afshaper.c:194
#12 0x00007ffff5b02d0b in af_face_globals_compute_style_coverage (globals=0x605cf0) at ../../third_party/freetype/src/src/autofit/afglobal.c:255
#13 0x00007ffff5b02784 in af_face_globals_new (face=0x609ba0, aglobals=0x7fffffff88e8, module=0x6072c0) at ../../third_party/freetype/src/src/autofit/afglobal.c:371
#14 0x00007ffff5b020a0 in af_loader_reset (loader=0x7fffffff88e0, module=0x6072c0, face=0x609ba0) at ../../third_party/freetype/src/src/autofit/afloader.c:56
#15 0x00007ffff5b01637 in af_loader_load_glyph (loader=0x7fffffff88e0, module=0x6072c0, face=0x609ba0, glyph_index=1, load_flags=5243400) at ../../third_party/freetype/src/src/autofit/afloader.c:304
#16 0x00007ffff5af3c31 in af_autofitter_load_glyph (module=0x6072c0, slot=0x60a520, size=0x60aa10, glyph_index=1, load_flags=5243400) at ../../third_party/freetype/src/src/autofit/afmodule.c:561
#17 0x00007ffff5b04488 in FT_Load_Glyph (face=0x609ba0, glyph_index=1, load_flags=5243400) at ../../third_party/freetype/src/src/base/ftobjs.c:904
#18 0x00007ffff7b404e6 in SkScalerContext_FreeType::generateMetrics (this=0x647e20, glyph=0x605c80) at ../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:1103
#19 0x00007ffff7442c3f in SkScalerContext::getMetrics (this=0x647e20, glyph=0x605c80) at ../../third_party/skia/src/core/SkScalerContext.cpp:109
(More stack frames follow...)

Comment 2 by drott@chromium.org, Dec 19 2017

From the following

(gdb) f 10
#10 0x00007ffff5bb5110 in hb_ot_layout_lookup_collect_glyphs (face=0x605eb0, table_tag=1196643650, lookup_index=0, glyphs_before=0x0, glyphs_input=0x0, glyphs_after=0x0, glyphs_output=0x606ad0)
    at ../../third_party/harfbuzz-ng/src/hb-ot-layout.cc:831
831	      l.collect_glyphs (&c);
(gdb) kl
Undefined command: "kl".  Try "help".
(gdb) l
826	  switch (table_tag)
827	  {
828	    case HB_OT_TAG_GSUB:
829	    {
830	      const OT::SubstLookup& l = hb_ot_layout_from_face (face)->gsub->get_lookup (lookup_index);
831	      l.collect_glyphs (&c);
832	      return;
833	    }
834	    case HB_OT_TAG_GPOS:
835	    {
(gdb) p c
$1 = {<OT::hb_dispatch_context_t<OT::hb_collect_glyphs_context_t, _hb_void_t const*, 0>> = {static max_debug_depth = 0}, face = 0x605eb0, before = 0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>, 
  input = 0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>, after = 0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>, output = 0x606ad0, recurse_func = 
    0x7ffff5bbfcd0 <OT::SubstLookup::dispatch_recurse_func<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int)>, recursed_lookups = 0x645d50, nesting_level_left = 6, 
  debug_depth = 0}
(gdb) p c.before
$2 = (hb_set_t *) 0x7ffff5a645e0 <hb_set_get_empty::_hb_set_nil>
(gdb) p c.before.in_error
$3 = true
(gdb) p c.face.in_error
There is no member or method named in_error.
(gdb) p c.input.in_error
$4 = true
(gdb) p c.after.in_error
$5 = true
(gdb) p c.output.in_error
$6 = false

it looks like since in afshaper.c:185 no input, before and after sets are specified, these are the empty sets, which always return true for in_error, is that intended?

Comment 3 by drott@chromium.org, Dec 19 2017

Blocking: 794896
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1

commit a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1
Author: Dominik Röttsches <drott@chromium.org>
Date: Wed Dec 20 13:26:18 2017

Roll HarfBuzz to 1.7.3 plus hb_set fix

Roll HarfBuzz to 1.7.3 to incorporate hb_set changes which improve
dealing with fonts containing incorrectly sorted range information, such
as the Chandas Devanagari font part of the ttf-devanagari-fonts package,
as identified in
https://bugs.chromium.org/p/chromium/issues/detail?id=794896

Cherry-pick 2fe5f885..a9432bde on top of 1.7.3 to incorporate hb_set
regression fixes.

Bug:  794896 ,  796124 
Change-Id: I9256018b6ec6c7e84f9261c97758b2bee2d410a2
Tbr: kojii, eae, behdad
Reviewed-on: https://chromium-review.googlesource.com/831946
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525317}
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/NEWS
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/README.chromium
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-blob.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-buffer-deserialize-json.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-buffer-deserialize-text.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-buffer.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-common.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-coretext.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-coretext.h
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-debug.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ft.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-glib.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-graphite2.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-icu.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-font.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-layout.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-shape-complex-use-table.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-shape.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ot-tag.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-private.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-set-digest-private.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-set-private.hh
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-set.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-shape-plan.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/hb-ucdn.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/main.cc
[modify] https://crrev.com/a14e00ae9bc6a9263bbfb249ec51b4ed6a7635c1/third_party/harfbuzz-ng/src/test-buffer-serialize.cc

Comment 5 by drott@chromium.org, Dec 20 2017

Status: Fixed (was: Started)

Comment 6 by e...@chromium.org, Jan 8 2018

Cc: nyerramilli@chromium.org drott@chromium.org ranjitkan@chromium.org rbasuvula@chromium.org
 Issue 796095  has been merged into this issue.

Sign in to add a comment