<?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>311060</bug_id>
          
          <creation_ts>2026-03-29 19:53:36 -0700</creation_ts>
          <short_desc>Null deref crash under RenderLayerBacking::updateAncestorClipping()</short_desc>
          <delta_ts>2026-03-30 20:07:24 -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 Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=308230</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2194975</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-03-29 19:53:36 -0700</bug_when>
    <thetext>Null pointer dereference in `RenderLayerBacking::updateAncestorClipping()` when the render tree is torn down during Back/Forward Cache eviction.

The `RenderLayerBacking` destructor calls `updateAncestorClipping(false, nullptr)`. When `m_ancestorClippingStack` is non-null, the `else if` branch calls `m_owningLayer.page().scrollingCoordinator()`, which dereferences a null `Page` pointer. The frame&apos;s page has already been detached by `CachedFrame::destroy()` before the render tree is torn down.

This is the same class of bug as Bug 308230 (307858@main), which fixed the identical pattern in `updateOverflowControlsLayers()`.

Crash stack:
```
0   WebCore:  WeakPtrImplBase::get&lt;Page&gt;()
1   WebCore:  WeakPtr&lt;Page&gt;::get()
2   WebCore:  Frame::page()
3   WebCore:  RenderObject::page()
4   WebCore:  RenderLayer::page()
5   WebCore:  RenderLayerBacking::updateAncestorClipping()
6   WebCore:  RenderLayerBacking::~RenderLayerBacking()
7   WebCore:  RenderLayer::clearBacking()
8   WebCore:  RenderLayer::~RenderLayer()
[...]
36  WebCore:  Document::destroyRenderTree()
37  WebCore:  Document::willBeRemovedFromFrame()
38  WebCore:  LocalFrame::setView()
39  WebCore:  FrameLoader::detachFromParent()
40  WebCore:  FrameLoader::frameDetached()
41  WebCore:  HTMLFrameOwnerElement::disconnectContentFrame()
42  WebCore:  disconnectSubframes()
43  WebCore:  Document::willBeRemovedFromFrame()
46  WebCore:  CachedFrame::destroy()
[...]
51  WebCore:  CachedPage::~CachedPage()
[...]
58  WebCore:  BackForwardCache::addIfCacheable()
59  WebCore:  FrameLoader::commitProvisionalLoad()
```

All 5 crash logs show EXC_BAD_ACCESS (SIGSEGV) at address 0x8 (null + offset) on the main thread.

&lt;rdar://150587917&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2194978</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-03-29 20:25:07 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/61654</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195404</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-30 20:07:22 -0700</bug_when>
    <thetext>Committed 310278@main (f19f83b2829c): &lt;https://commits.webkit.org/310278@main&gt;

Reviewed commits have been landed. Closing PR #61654 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>