New issue
Advanced search Search tips

Issue 832350 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug

Blocked on:
issue 829234

Blocking:
issue 778507



Sign in to add a comment

TextOffsetMapping::ComputeContaingBlock() crashes with a position at distributed node

Project Member Reported by ClusterFuzz, Apr 12 2018

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=4637972755120128

Fuzzer: bj_broddelwerk
Job Type: linux_asan_content_shell_drt
Platform Id: linux

Crash Type: Null-dereference READ
Crash Address: 0x0000000000c0
Crash State:
  blink::TextOffsetMapping::TextOffsetMapping
  blink::TextOffsetMapping::TextOffsetMapping
  blink::NextWordPosition
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_content_shell_drt&range=550102:550107

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=4637972755120128

Issue filed automatically.

See https://github.com/google/clusterfuzz-tools for more information.
 
Project Member

Comment 1 by ClusterFuzz, Apr 12 2018

Labels: OS-Windows OS-Mac
Project Member

Comment 2 by ClusterFuzz, Apr 12 2018

Components: Blink>Editing
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.
Project Member

Comment 3 by ClusterFuzz, Apr 12 2018

Labels: Test-Predator-Auto-Owner
Owner: yosin@chromium.org
Status: Assigned (was: Untriaged)
Automatically assigning owner based on suspected regression changelist https://chromium.googlesource.com/chromium/src/+/1324be868df000cb2e070199ce2d10cd0c5a2706 (Make NextWordPosition() to utilize TextOffsetMapping).

If this is incorrect, please let us know why and apply the Test-Predator-Wrong-CLs label. If you aren't the correct owner for this issue, please unassign yourself as soon as possible so it can be re-triaged.

Comment 4 by yosin@chromium.org, Apr 13 2018

Components: Blink>Editing>Selection
Status: Started (was: Assigned)
I'm working now...

Comment 5 by yosin@chromium.org, Apr 13 2018

Components: -Blink>Editing

Comment 6 by yosin@chromium.org, Apr 13 2018

Summary: TextOffsetMapping::ComputeContaingBlock() crashes with OBJECT's fallback (was: Null-dereference READ in blink::TextOffsetMapping::TextOffsetMapping)
ComputeConttaingBlock() is called with INPUT@beforeAnchor

Minimal HTML to reproduce:
<object><input></object>
<script>
const selection = window.getSelection();
selection.collapse(document.querySelector('object'), 0);
setTimeout(() => selection.modify('move', 'forward', 'word'), 0)
</script>


Layout Tree
layer at (0,0) size 800x600
  LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
  LayoutBlockFlow {HTML} at (0,0) size 800x600
    LayoutBlockFlow {BODY} at (8,8) size 784x584
      LayoutInline {OBJECT} at (0,0) size 173x19
        LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
      LayoutText {#text} at (0,0) size 0x0
layer at (10,11) size 169x16
  LayoutBlockFlow {DIV} at (2,3) size 169x16


Comment 7 by yosin@chromium.org, Apr 16 2018

Cc: yosin@chromium.org
 Issue 832796  has been merged into this issue.
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-3396
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dec40a582a3805fb28dfd67ba49fc2cdb28a1b6c

commit dec40a582a3805fb28dfd67ba49fc2cdb28a1b6c
Author: Yoshifumi Inoue <yosin@chromium.org>
Date: Tue Apr 17 04:30:18 2018

Revert "Make NextWordPosition() to utilize TextOffsetMapping"

This reverts commit 1324be868df000cb2e070199ce2d10cd0c5a2706 for M67/Beta

TextOffsetMapping is not ready for release.
It should support edge cases.

TBR=yosin@chromium.org

Bug:  832055 ,  832061 ,  832101 ,  832261 ,  832350 ,  832497 ,  832639 ,  833172 ,  833180 
Change-Id: Iac5f58716619a626650088a55109922daf1a4f3a
Reviewed-on: https://chromium-review.googlesource.com/1013445
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/branch-heads/3396@{#36}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/dec40a582a3805fb28dfd67ba49fc2cdb28a1b6c/third_party/blink/renderer/core/editing/visible_units_word.cc
[modify] https://crrev.com/dec40a582a3805fb28dfd67ba49fc2cdb28a1b6c/third_party/blink/renderer/core/editing/visible_units_word_test.cc

Comment 9 by yosin@chromium.org, Apr 17 2018

Simpler HTML to reproduce:

<div id="host"><input></div>
<script>
const selection = window.getSelection();
const host = document.getElementById('host');
const shadowRoot = host.attachShadow({mode:'open'});
shadowRoot.innerHTML = '<slot></slot>';
selection.collapse(host.firstChild, 0);
selection.modify('move', 'forward', 'word');
</script>


Layout Tree:
layer at (0,0) size 800x600
  LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
  LayoutBlockFlow {HTML} at (0,0) size 800x600
    LayoutBlockFlow {BODY} at (8,8) size 784x584
      LayoutBlockFlow {DIV} at (0,0) size 784x22
        LayoutTextControl {INPUT} at (0,0) size 173x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
layer at (10,11) size 169x16
  LayoutBlockFlow {DIV} at (2,3) size 169x16
caret: position 0 of child 0 {INPUT} of child 0 {DIV} of body

Comment 10 by yosin@chromium.org, Apr 17 2018

Summary: TextOffsetMapping::ComputeContaingBlock() crashes with a position at distributed node (was: TextOffsetMapping::ComputeContaingBlock() crashes with OBJECT's fallback)

Comment 11 by yosin@chromium.org, Apr 17 2018

Blocking: 778507

Comment 12 by yosin@chromium.org, Apr 18 2018

Blockedon: 829234

Comment 13 by yosin@chromium.org, May 10 2018

Status: Fixed (was: Started)
http://crrev.com/c/1018923 should fix this issue.
Project Member

Comment 14 by ClusterFuzz, May 10 2018

Labels: ClusterFuzz-Verified
Status: Verified (was: Fixed)
ClusterFuzz testcase 4864381201154048 is verified as fixed, so closing issue as verified.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Project Member

Comment 15 by ClusterFuzz, May 10 2018

ClusterFuzz has detected this issue as fixed in range 557408:557410.

Detailed report: https://clusterfuzz.com/testcase?key=4637972755120128

Fuzzer: bj_broddelwerk
Job Type: linux_asan_content_shell_drt
Platform Id: linux

Crash Type: Null-dereference READ
Crash Address: 0x0000000000c0
Crash State:
  blink::TextOffsetMapping::TextOffsetMapping
  blink::TextOffsetMapping::TextOffsetMapping
  blink::NextWordPosition
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_content_shell_drt&range=550102:550107
Fixed: https://clusterfuzz.com/revisions?job=linux_asan_content_shell_drt&range=557408:557410

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=4637972755120128

See https://github.com/google/clusterfuzz-tools for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.

Sign in to add a comment