<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>272294</bug_id>
          
          <creation_ts>2024-04-06 22:59:14 -0700</creation_ts>
          <short_desc>nullderef in LayoutIntegration::BoxTree::layoutBoxForRenderer</short_desc>
          <delta_ts>2024-04-07 06:44:15 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>269009</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>bin7o8v</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2026601</commentid>
    <comment_count>0</comment_count>
      <attachid>470798</attachid>
    <who name="">bin7o8v</who>
    <bug_when>2024-04-06 22:59:14 -0700</bug_when>
    <thetext>Created attachment 470798
PoC

Version:
 - OS: Ubuntu Desktop 22.04
 - WebKit: WebKitGTK 2.43.4

How to reproduce:
1. Compile WebKit from source
2. Serve poc.html on 127.0.0.1:8080
3. Launch MiniBrowser with url 127.0.0.1:8080/poc.html

Crash log:
==2710716==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000000c (pc 0x7fa8af3d08be bp 0x7ffc9fcc7c80 sp 0x7ffc9fcc7b50 T0)
==2710716==The signal is caused by a READ memory access.
==2710716==Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
  #0 0x7fa8af3d08be in WTF::OptionSet&lt;WebCore::Layout::Box::BaseTypeFlag&gt;::isEmpty() const /webkitgtk-2.43.4/build-asan/WTF/Headers/wtf/OptionSet.h:106:46
  #1 0x7fa8af3d08be in WTF::OptionSet&lt;WebCore::Layout::Box::BaseTypeFlag&gt;::operator bool() const /webkitgtk-2.43.4/build-asan/WTF/Headers/wtf/OptionSet.h:111:56
  #2 0x7fa8af3d08be in WTF::OptionSet&lt;WebCore::Layout::Box::BaseTypeFlag&gt;::containsAny(WTF::OptionSet&lt;WebCore::Layout::Box::BaseTypeFlag&gt;) const /webkitgtk-2.43.4/build-asan/WTF/Headers/wtf/OptionSet.h:120:18
  #3 0x7fa8af3d08be in WTF::OptionSet&lt;WebCore::Layout::Box::BaseTypeFlag&gt;::contains(WebCore::Layout::Box::BaseTypeFlag) const /webkitgtk-2.43.4/build-asan/WTF/Headers/wtf/OptionSet.h:115:16
  #4 0x7fa8af3d08be in WebCore::Layout::Box::isElementBox() const /webkitgtk-2.43.4/Source/WebCore/layout/layouttree/LayoutBox.h:164:56
  #5 0x7fa8af3d08be in WTF::TypeCastTraits&lt;WebCore::Layout::ElementBox const, WebCore::Layout::Box const, false&gt;::isType(WebCore::Layout::Box const&amp;) /webkitgtk-2.43.4/Source/WebCore/layout/layouttree/LayoutElementBox.h:119:1
  #6 0x7fa8af3d08be in WTF::TypeCastTraits&lt;WebCore::Layout::ElementBox const, WebCore::Layout::Box const, false&gt;::isOfType(WebCore::Layout::Box const&amp;) /webkitgtk-2.43.4/Source/WebCore/layout/layouttree/LayoutElementBox.h:119:1
  #7 0x7fa8af3d08be in bool WTF::is&lt;WebCore::Layout::ElementBox, WebCore::Layout::Box&gt;(WebCore::Layout::Box const&amp;) /webkitgtk-2.43.4/build-asan/WTF/Headers/wtf/TypeCasts.h:58:12
  #8 0x7fa8af3d08be in std::conditional&lt;std::is_const_v&lt;WebCore::Layout::Box const&gt;, std::add_const&lt;WebCore::Layout::ElementBox&gt;::type, std::remove_const&lt;WebCore::Layout::ElementBox&gt;::type&gt;::type&amp; WTF::downcast&lt;WebCore::Layout::ElementBox, WebCore::Layout::Box const&gt;(WebCore::Layout::Box const&amp;) /webkitgtk-2.43.4/build-asan/WTF/Headers/wtf/TypeCasts.h:120:5
  #9 0x7fa8af3d08be in WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer(WebCore::RenderElement const&amp;) const /webkitgtk-2.43.4/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp:356:12
  #10 0x7fa8b0903a75 in WebCore::RenderInline::frameRectForStickyPositioning() const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderInline.h:133:69
  #11 0x7fa8b06baf19 in WebCore::RenderBoxModelObject::stickyPositionOffset() const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderBoxModelObject.cpp:630:5
  #12 0x7fa8b06baf19 in WebCore::RenderBoxModelObject::offsetForInFlowPosition() const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderBoxModelObject.cpp:642:16
  #13 0x7fa8b08ad3fe in WebCore::RenderInline::offsetFromContainer(WebCore::RenderElement&amp;, WebCore::LayoutPoint const&amp;, bool*) const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderInline.cpp:771:19
  #14 0x7fa8b074d666 in WebCore::RenderBox::computeVisibleRectsInContainer(WebCore::RenderObject::RepaintRects const&amp;, WebCore::RenderLayerModelObject const*, WebCore::RenderObject::VisibleRectContext) const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderBox.cpp:2669:49
  #15 0x7fa8b0a1c112 in WebCore::RenderObject::computeRects(WebCore::RenderObject::RepaintRects const&amp;, WebCore::RenderLayerModelObject const*, WebCore::RenderObject::VisibleRectContext) const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderObject.cpp:1132:19
  #16 0x7fa8b0a1c112 in WebCore::RenderObject::clippedOverflowRect(WebCore::RenderLayerModelObject const*, WebCore::RenderObject::VisibleRectContext) const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderObject.cpp:1127:12
  #17 0x7fa8b0a1a511 in WebCore::RenderObject::clippedOverflowRectForRepaint(WebCore::RenderLayerModelObject const*) const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderObject.h:1016:109
  #18 0x7fa8b0a1a511 in WebCore::RenderObject::issueRepaint(std::optional&lt;WebCore::LayoutRect&gt;, WebCore::RenderObject::ClipRepaintToLayer, WebCore::RenderObject::ForceRepaint, std::optional&lt;WebCore::RectEdges&lt;WebCore::LayoutUnit&gt;&gt;) const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderObject.cpp:1035:23
  #19 0x7fa8b0a1a933 in WebCore::RenderObject::repaint() const /webkitgtk-2.43.4/Source/WebCore/rendering/RenderObject.cpp:1045:5
  #20 0x7fa8b0a21e56 in WebCore::invalidateLineLayoutAfterTreeMutationIfNeeded(WebCore::RenderObject&amp;, WebCore::IsRemoval) /webkitgtk-2.43.4/Source/WebCore/rendering/RenderObject.cpp:1806:20

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/webkitgtk-2.43.4/build-asan/lib/libwebkit2gtk-4.0.so.37+0x79358be)
==2710716==ABORTING</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2026616</commentid>
    <comment_count>1</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-04-07 06:43:08 -0700</bug_when>
    <thetext>Hi, thank you for filing this bug. The test reduction is great!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2026617</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-04-07 06:44:15 -0700</bug_when>
    <thetext>(this has been fixed on trunk. see bug 269009)

*** This bug has been marked as a duplicate of bug 269009 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>470798</attachid>
            <date>2024-04-06 22:59:14 -0700</date>
            <delta_ts>2024-04-06 22:59:14 -0700</delta_ts>
            <desc>PoC</desc>
            <filename>poc.html</filename>
            <type>text/html</type>
            <size>426</size>
            <attacher>bin7o8v</attacher>
            
              <data encoding="base64">PGh0bWw+Cgo8aGVhZD4KICAgIDxzdHlsZT4KICAgICAgICBxIHsKICAgICAgICAgICAgcG9zaXRp
b246IHN0aWNreTsKICAgICAgICB9CgogICAgICAgIHE6OmFmdGVyIHsKICAgICAgICAgICAgcG9z
aXRpb246IGZpeGVkOwogICAgICAgIH0KCiAgICAgICAgdmlkZW8gewogICAgICAgICAgICBtYXJn
aW4tYm90dG9tOiAyNTZweDsKICAgICAgICAgICAgZGlzcGxheTogbGlzdC1pdGVtOwogICAgICAg
IH0KICAgIDwvc3R5bGU+CjwvaGVhZD4KCjxib2R5PgogICAgPHZpZGVvPgogICAgICAgIDx0cmFj
az4KICAgICAgICA8L3RyYWNrPgogICAgPC92aWRlbz4KICAgIDxpZnJhbWU+PC9pZnJhbWU+CiAg
ICA8dmlkZW8+CiAgICAgICAgPHRyYWNrPgogICAgICAgIDwvdHJhY2s+CiAgICA8L3ZpZGVvPgog
ICAgPHE+PC9xPgo8L2JvZHk+Cgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>