<?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>314069</bug_id>
          
          <creation_ts>2026-05-05 05:31:25 -0700</creation_ts>
          <short_desc>[WebXR Layers] Crashes in OpenXRLayer&apos;s endFrame() for various layer types</short_desc>
          <delta_ts>2026-05-07 02:30:14 -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>WebXR</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Sergio Villar Senin">svillar</reporter>
          <assigned_to name="Sergio Villar Senin">svillar</assigned_to>
          <cc>djg</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2207605</commentid>
    <comment_count>0</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2026-05-05 05:31:25 -0700</bug_when>
    <thetext>OpenXRxxxLayer::endFrame() crashes in releaseImage() because acquireImage() (called inside beginFrame() via populateFrameData()) was never called for that layer in the current frame.

The root cause is that beginFrame() is called from inside renderLoop(), which is called from the submitFrame() dispatch. At that point activeLayerHandles contains the **previous** frame&apos;s layer list. The new layer added by applyPendingRenderState() is only reflected in activeLayerHandles when the **next** scheduleAnimationFrame() dispatch runs which is always too late. Something like this

 submitFrame dispatch → endFrame() → renderLoop() → beginFrame()
                                                      ↑ snapshots OLD activeLayerHandles
 scheduleAnimationFrame dispatch → activeLayerHandles = FRESH → renderLoop()
                                                                  ↑ pendingFrame=true, exits early

There is a clear mismatch between the layers known by WebXR and the ones used by OpenXR to render</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208109</commentid>
    <comment_count>1</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2026-05-06 08:15:46 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64370</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208529</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-07 02:29:39 -0700</bug_when>
    <thetext>Committed 312788@main (b0baaeaf0cd8): &lt;https://commits.webkit.org/312788@main&gt;

Reviewed commits have been landed. Closing PR #64370 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208530</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-07 02:30:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/176446755&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>