<?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>210151</bug_id>
          
          <creation_ts>2020-04-07 13:51:43 -0700</creation_ts>
          <short_desc>WebContent process crashes in com.apple.WebCore: rx::IOSurfaceSurfaceCGL::releaseTexImage</short_desc>
          <delta_ts>2020-04-20 13:41:12 -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>WebGL</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>
          
          <blocked>210153</blocked>
    
    <blocked>210213</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dean Jackson">dino</reporter>
          <assigned_to name="Kenneth Russell">kbr</assigned_to>
          <cc>dino</cc>
    
    <cc>justin_fan</cc>
    
    <cc>kbr</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1638781</commentid>
    <comment_count>0</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-07 13:51:43 -0700</bug_when>
    <thetext>1. Navigate to https://store.na.square-enix-games.com/en_US/product/562671/final-fantasy-vii-remake-1st-class-edition-ps4
2. Click “You Edition” drop down and select “Standard Edition”
3. Use Back keyboard command (⌘[)
* CRASH DETAILS
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebCore             	0x7fff3d1d1ad5 rx::IOSurfaceSurfaceCGL::releaseTexImage(gl::Context const*, int) + 9 (/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.16.xctoolchain/usr/bin/../include/c++/v1/memory:2624)
1   com.apple.WebCore             	0x7fff3d24b327 egl::Surface::releaseTexImage(gl::Context const*, int) + 35 (/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/ANGLE/ANGLE-7610.1.7.6/src/libANGLE/Surface.cpp:472)
2   com.apple.WebCore             	0x7fff3d111959 EGL_ReleaseTexImage + 139 (/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/ANGLE/ANGLE-7610.1.7.6/src/libGLESv2/entry_points_egl.cpp:672)
3   com.apple.WebCore             	0x7fff3bd6da29 -[WebGLLayer display] + 169 (/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/WebCore/WebCore-7610.1.7.6/./platform/graphics/cocoa/WebGLLayer.mm:167)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638782</commentid>
    <comment_count>1</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-07 13:52:04 -0700</bug_when>
    <thetext>rdar://61367219</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638804</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-07 14:31:41 -0700</bug_when>
    <thetext>Has this been reproducible in any smaller test environment than Safari with WebKit2? I seem to be able to reproduce it in that environment, but not with MiniBrowser, neither with WebKit1 or WebKit2.

In Safari&apos;s Preferences when launched with the run-safari script, &quot;Show Develop menu in menu bar&quot; is grayed out, making it impossible to switch to WK1 for easier debugging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638809</commentid>
    <comment_count>3</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-07 14:45:15 -0700</bug_when>
    <thetext>Can catch this in the debugger by attaching to the WebContent process after loading the initial web page, before selecting &quot;Standard Edition&quot; and navigating back. Here&apos;s the more complete stack trace from lldb:

(lldb) bt
* thread #1, queue = &apos;com.apple.main-thread&apos;, stop reason = EXC_BAD_ACCESS (code=1, address=0x2dc0)
  * frame #0: 0x0000000622075ae5 WebCore`std::__1::unique_ptr&lt;rx::ContextImpl, std::__1::default_delete&lt;rx::ContextImpl&gt; &gt;::get(this=0x0000000000002dc0) const at memory:2624:19
    frame #1: 0x000000062207397e WebCore`gl::Context::getImplementation(this=0x0000000000000000) const at Context.h:482:73
    frame #2: 0x0000000622241e45 WebCore`rx::ContextGL* rx::GetImplAs&lt;rx::ContextGL, gl::Context const&gt;(src=0x0000000000000000) at angletypes.h:572:30
    frame #3: 0x0000000622241e05 WebCore`rx::GetFunctionsGL(context=0x0000000000000000) at renderergl_utils.cpp:1908:12
    frame #4: 0x00000006220ebf4a WebCore`rx::IOSurfaceSurfaceCGL::releaseTexImage(this=0x00007fe8eec1eff0, context=0x0000000000000000, buffer=12420) at IOSurfaceSurfaceCGL.cpp:181:36
    frame #5: 0x000000062230373e WebCore`egl::Surface::releaseTexImage(this=0x00007fe8ea9fbe30, context=0x0000000000000000, buffer=12420) at Surface.cpp:472:5
    frame #6: 0x0000000621f5c91c WebCore`::EGL_ReleaseTexImage(dpy=0x00007fe8eedf2c90, surface=0x00007fe8ea9fbe30, buffer=12420) at entry_points_egl.cpp:672:9
    frame #7: 0x000000061eb87796 WebCore`-[WebGLLayer display](self=0x00007fe8ea93e5f0, _cmd=&quot;display&quot;) at WebGLLayer.mm:167:18
    frame #8: 0x00007fff40988469 QuartzCore`CA::Layer::display_if_needed(CA::Transaction*) + 757
    frame #9: 0x00007fff40966716 QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double) + 334
    frame #10: 0x00007fff40965304 QuartzCore`CA::Transaction::commit() + 644

Will investigate why this is happening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638822</commentid>
    <comment_count>4</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-07 14:59:31 -0700</bug_when>
    <thetext>It looks like eglReleaseTexImage is supposed to be called with a current context, though the docs don&apos;t state that explicitly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638905</commentid>
    <comment_count>5</comment_count>
      <attachid>395763</attachid>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-07 17:43:06 -0700</bug_when>
    <thetext>Created attachment 395763
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638906</commentid>
    <comment_count>6</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-07 17:44:43 -0700</bug_when>
    <thetext>A context was supposed to be current when eglReleaseTexImage was called, but there&apos;s no return code from GraphicsContextGLOpenGL::prepareTexture indicating failure to make the context current.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1639191</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-04-08 11:50:50 -0700</bug_when>
    <thetext>Committed r259737: &lt;https://trac.webkit.org/changeset/259737&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395763.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>395763</attachid>
            <date>2020-04-07 17:43:06 -0700</date>
            <delta_ts>2020-04-08 11:50:50 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-210151-20200407174305.patch</filename>
            <type>text/plain</type>
            <size>1557</size>
            <attacher name="Kenneth Russell">kbr</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjU5NjE4CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggODhjMjA2NzU2ODllNWEz
NmY1NmYyZTU3ZGI0OTZiOGZiMjI3Yzc5Zi4uNzgzMjk0ZjMwNTdlMGRiNzE3ZjA4M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