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

Issue 698751 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

HarfBuzzLineBreaker meets DCHECK on a multiline text.

Reported by mer...@yandex-team.ru, Mar 6 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.0.1785 Yowser/2.5 Safari/537.36

Steps to reproduce the problem:
Create a multiline Label (or a LabelButton) with font "Segoe UI 12px" (default font with delta = 0).

Assign a quite long text: "111 adsfasdfdddddddddddddddddddddddddddddddddfffffffe  e".

Put this button into a container view, with a vertical BoxLayout manager.

Set the width 277px.

Call Layout(), the manager will invoke GetHeightForWidth(277).

What is the expected behavior?
No DCHECK fault.
Somehow process too wide text correctly.

What went wrong?
DCHECK in HarfbuzzLineBreaker::AddLineSegment

        DCHECK_EQ(last_segment.char_range.end(), segment.char_range.start());

[18324:17264:0306/174119.936:FATAL:render_text_harfbuzz.cc(421)] Check failed: last_segment.char_range.end() == segment.char_range.start() (44 vs. 55)

Did this work before? N/A 

Chrome version: 57.0.2987.0  Channel: dev
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 24.0 r0

I've written a unittest (within ui/gfx/render_text_unittest.cc) that reproduces this bug.

TEST_P(RenderTextHarfBuzzTest, SomeDcheckFault) {
  RenderText* render_text = GetRenderText();
  render_text->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);
  render_text->SetDirectionalityMode(gfx::DIRECTIONALITY_FROM_TEXT);
  render_text->SetElideBehavior(gfx::NO_ELIDE);
  render_text->SetFontList(FontList("Segoe UI, 12px"));
  render_text->SetCursorEnabled(false);
  render_text->SetWordWrapBehavior(gfx::TRUNCATE_LONG_WORDS);
  render_text->SetMultiline(true);
  render_text->SetReplaceNewlineCharsWithSymbols(false);
  render_text->SetText(ASCIIToUTF16(
      "111 adsfasdfdddddddddddddddddddddddddddddddddfffffffe  e"));

  render_text->SetDisplayRect(gfx::Rect(0, 0, 277, 0));
  render_text->GetStringSize();
}

 
Bloody submit form has pasted UserAgent of my browser.

The bug reproduces on fresh master (commit 60c2e708f18b501cfbea9a3d9a5a8ef8a5a3d9e4) too.

Comment 2 Deleted

This bug also has visual effect.
The label does not show the last word "e".
So, this is not "just DCHECK, don't worry, it will not appear in release..."

"111 adsfasdfdddddddddddddddddddddddddddddddddfffffffe  E"
renders as
+-----------------------------------------+
|111                                      |
|adsfasdfddddddddddddddddddddddddddddddddd|
+-----------------------------------------+

"111 dsfasdfdddddddddddddddddddddddddddddddddfffffffe  E"
renders as
+-----------------------------------------+
|111                                      |
|dsfasdfdddddddddddddddddddddddddddddddddf|
|E                                        |
+-----------------------------------------+
Cc: krajshree@chromium.org
Labels: Needs-Feedback
Reporter@ - Thanks for filing the issue...!!

Could you please provide a sample html file to test this issue.

This will help us in triaging the issue further.

Thanks...!!
It happens in a UI frontend, not in a renderer subprocess.
views::Label + views::BoxLayout
So it's not reasonable to ask for a sample html file.

I caught this fault showing web push notifications with a customized popup view. (Tried to improve the code of src/ui/message_center/views/notification_view.cc)
A long enough text of a button and voila.
Project Member

Comment 6 by sheriffbot@chromium.org, Mar 9 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
You can debug the issue with my unittest.
It looks innocent, isn't it? Should not crash anyway.

Comment 8 by ajha@chromium.org, Mar 9 2017

Labels: Needs-Triage-M57
Cc: rbasuvula@chromium.org
Labels: TE-NeedsTriageHelp
This looks like out of scope for TE, hence adding the respective label for it to  triage further.
Project Member

Comment 10 by sheriffbot@chromium.org, Mar 21 2018

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment