<?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>145832</bug_id>
          
          <creation_ts>2015-06-10 00:05:24 -0700</creation_ts>
          <short_desc>[WinCairo] Crash on exit when terminating egl</short_desc>
          <delta_ts>2016-06-01 05:19:36 -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>WebKit Misc.</component>
          <version>528+ (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=157973</see_also>
          <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>peavo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cgarcia</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1100931</commentid>
    <comment_count>0</comment_count>
    <who name="">peavo</who>
    <bug_when>2015-06-10 00:05:24 -0700</bug_when>
    <thetext>I&apos;m getting a crash on exit when egl is being terminated.

 	atidxx32.dll!5aa314c8() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for atidxx32.dll]	
 	atiuxpag.dll!73fb29f7() 	
 	d3d11.dll!5814e03c() 	
 	d3d11.dll!5814b4dd() 	
 	d3d11.dll!5814d979() 	
 	d3d11.dll!5814bb03() 	
 	d3d11.dll!5816cbe8() 	
 	d3d11.dll!5816c59d() 	
 	d3d11.dll!5816cb06() 	
 	d3d11.dll!5816c8c0() 	
 	d3d11.dll!5816c75e() 	
 	d3d11.dll!58149241() 	
&gt;	libGLESv2.dll!rx::SwapChain11::release()  Line 57 + 0xd bytes	C++
 	libGLESv2.dll!rx::SwapChain11::`scalar deleting destructor&apos;()  + 0x11 bytes	C++
 	libEGL.dll!egl::Surface::`scalar deleting destructor&apos;()  + 0x1e bytes	C++
 	libEGL.dll!egl::Display::terminate()  Line 125 + 0x15 bytes	C++
 	libEGL.dll!eglTerminate(void * dpy)  Line 157	C++
 	WebKit.dll!WebCore::PlatformDisplayWin::`scalar deleting destructor&apos;()  + 0x1a bytes	C++
 	WebKit.dll!`WebCore::PlatformDisplay::sharedDisplay&apos;::`2&apos;::`dynamic atexit destructor for &apos;display&apos;&apos;()  + 0x10 bytes	C++
 	WebKit.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 416	C
 	WebKit.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 522 + 0xc bytes	C
 	WebKit.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 472 + 0xe bytes	C
 	ntdll.dll!77668d44()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100932</commentid>
    <comment_count>1</comment_count>
      <attachid>254631</attachid>
    <who name="">peavo</who>
    <bug_when>2015-06-10 00:09:51 -0700</bug_when>
    <thetext>Created attachment 254631
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100938</commentid>
    <comment_count>2</comment_count>
      <attachid>254631</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-06-10 00:47:08 -0700</bug_when>
    <thetext>Comment on attachment 254631
Patch

I don&apos;t think this is correct, I didn&apos;t use NeverDestroyed on purpose, since both X11 and wayland display implementation have cleanup in their destructors. I think the point here is why it crashes on windows when terminating EGL, and if it&apos;s a windows specific bug, I would add an ifdef to the destructor for windows platform to avoid the EGL termination</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100951</commentid>
    <comment_count>3</comment_count>
      <attachid>254637</attachid>
    <who name="">peavo</who>
    <bug_when>2015-06-10 01:52:32 -0700</bug_when>
    <thetext>Created attachment 254637
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100952</commentid>
    <comment_count>4</comment_count>
    <who name="">peavo</who>
    <bug_when>2015-06-10 01:53:12 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Comment on attachment 254631 [details]
&gt; Patch
&gt; 
&gt; I don&apos;t think this is correct, I didn&apos;t use NeverDestroyed on purpose, since
&gt; both X11 and wayland display implementation have cleanup in their
&gt; destructors. I think the point here is why it crashes on windows when
&gt; terminating EGL, and if it&apos;s a windows specific bug, I would add an ifdef to
&gt; the destructor for windows platform to avoid the EGL termination

Thanks for reviewing :) Updated patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100955</commentid>
    <comment_count>5</comment_count>
      <attachid>254637</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-06-10 02:04:21 -0700</bug_when>
    <thetext>Comment on attachment 254637
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=254637&amp;action=review

Ok, I think it would be interesting to know why it crashes, though, you might be hiding an actual bug rather than fixing it.

&gt; Source/WebCore/platform/graphics/PlatformDisplay.cpp:112
&gt; +#if USE(EGL) &amp;&amp; !PLATFORM(WIN) // WinCairo crashes when terminating EGL on exit

I would move the comment to the previous line, finishing with a period, and adding a link to this bug. And if this is not supposed to crash on termination, it should be a FIXME comment to make it clear this is a workaround, not the proper fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100974</commentid>
    <comment_count>6</comment_count>
    <who name="">peavo</who>
    <bug_when>2015-06-10 03:27:11 -0700</bug_when>
    <thetext>I believe it crashes because libEGL.dll is unloaded before eglTerminate is called.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100984</commentid>
    <comment_count>7</comment_count>
      <attachid>254644</attachid>
    <who name="">peavo</who>
    <bug_when>2015-06-10 04:07:18 -0700</bug_when>
    <thetext>Created attachment 254644
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100988</commentid>
    <comment_count>8</comment_count>
    <who name="">peavo</who>
    <bug_when>2015-06-10 04:35:43 -0700</bug_when>
    <thetext>Committed r185411: &lt;http://trac.webkit.org/changeset/185411&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1198123</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-06-01 05:19:36 -0700</bug_when>
    <thetext>Could this be bug #157973?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>254631</attachid>
            <date>2015-06-10 00:09:51 -0700</date>
            <delta_ts>2015-06-10 01:52:23 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-145832-20150610090854.patch</filename>
            <type>text/plain</type>
            <size>1584</size>
            <attacher>peavo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE4NTQwNCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBACisyMDE1LTA2LTEwICBQZXIgQXJu
ZSBWb2xsYW4gIDxwZWF2b0BvdXRsb29rLmNvbT4KKworICAgICAgICBbV2luQ2Fpcm9dIENyYXNo
IG9uIGV4aXQgd2hlbiB0ZXJtaW5hdGluZyBlZ2wKKyAgICAgICAgaHR0cHM6Ly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0Zm9y
CiBQbGF0Zm9ybURpc3BsYXkmIFBsYXRmb3JtRGlzcGxheTo6c2hhcmVkRGlzcGxheSgpCiB7CiAg
ICAgc3RhdGljIHN0ZDo6b25jZV9mbGFnIG9uY2VGbGFnOwotICAgIHN0YXRpYyBzdGQ6OnVuaXF1
ZV9wdHI8UGxhdGZvcm1EaXNwbGF5PiBkaXNwbGF5OworICAgIHN0YXRpYyBOZXZlckRlc3Ryb3ll
ZDxzdGQ6OnVuaXF1ZV9wdHI8UGxhdGZvcm1EaXNwbGF5Pj4gZGlzcGxheTsKICAgICBzdGQ6OmNh
bGxfb25jZShvbmNlRmxhZywgW117Ci0gICAgICAgIGRpc3BsYXkgPSBjcmVhdGVQbGF0Zm9ybURp
c3BsYXkoKTsKKyAgICAgICAgZGlzcGxheS5nZXQoKSA9IGNyZWF0ZVBsYXRmb3JtRGlzcGxheSgp
OwogICAgIH0pOwotICAgIHJldHVybiAqZGlzcGxheTsKKyAgICByZXR1cm4gKmRpc3BsYXkuZ2V0
KCk7CiB9CiAKIFBsYXRmb3JtRGlzcGxheTo6UGxhdGZvcm1EaXNwbGF5KCkK
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>254637</attachid>
            <date>2015-06-10 01:52:32 -0700</date>
            <delta_ts>2015-06-10 04:07:10 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-145832-20150610105135.patch</filename>
            <type>text/plain</type>
            <size>1249</size>
            <attacher>peavo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE4NTQwNykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpA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raW5nIGNvcHkpCkBAIC0xMDks
NyArMTA5LDcgQEAgUGxhdGZvcm1EaXNwbGF5OjpQbGF0Zm9ybURpc3BsYXkoKQogCiBQbGF0Zm9y
bURpc3BsYXk6On5QbGF0Zm9ybURpc3BsYXkoKQogewotI2lmIFVTRShFR0wpCisjaWYgVVNFKEVH
TCkgJiYgIVBMQVRGT1JNKFdJTikgLy8gV2luQ2Fpcm8gY3Jhc2hlcyB3aGVuIHRlcm1pbmF0aW5n
IEVHTCBvbiBleGl0CiAgICAgdGVybWluYXRlRUdMRGlzcGxheSgpOwogI2VuZGlmCiB9Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>254644</attachid>
            <date>2015-06-10 04:07:18 -0700</date>
            <delta_ts>2015-06-10 04:17:56 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-145832-20150610130621.patch</filename>
            <type>text/plain</type>
            <size>1310</size>
            <attacher>peavo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE4NTQxMCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE1IEBACisyMDE1LTA2LTEwICBQZXIgQXJu
ZSBWb2xsYW4gIDxwZWF2b0BvdXRsb29rLmNvbT4KKworICAgICAgICBbV2luQ2Fpcm9dIENyYXNo
IG9uIGV4aXQgd2hlbiB0ZXJtaW5hdGluZyBlZ2wKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtp
dC5vcmcvc2hvd19idWcuY2dpP2lkPTE0NTgzMgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09Q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Nob3dfYnVnLmNnaT9pZD0xNDU4MzIKKyNpZiBVU0UoRUdMKSAm
JiAhUExBVEZPUk0oV0lOKQogICAgIHRlcm1pbmF0ZUVHTERpc3BsYXkoKTsKICNlbmRpZgogfQo=
</data>
<flag name="review"
          id="279629"
          type_id="1"
          status="+"
          setter="cgarcia"
    />
          </attachment>
      

    </bug>

</bugzilla>