<?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>201541</bug_id>
          
          <creation_ts>2019-09-06 02:44:37 -0700</creation_ts>
          <short_desc>[Win][MiniBrowser][WK1] Crashes in MiniBrowserWebHost::onNotify by closing MainWindow while loading</short_desc>
          <delta_ts>2019-09-09 18:32:10 -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>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>201600</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=200970</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>
          <dependson>201600</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1568462</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2019-09-06 02:44:37 -0700</bug_when>
    <thetext>[Win][MiniBrowser][WK1] Crashes in MiniBrowserWebHost::onNotify by closing MainWindow while loading

1. Start MiniBrowser
2. Open some legacy WebView Windows
3. Load some web sites in them
4. Close them while loading

Crash happens.

Callstack:

&gt; MiniBrowserLib.dll!MiniBrowserWebHost::onNotify(IWebNotification * notification) Line 175	C++
&gt; WebKit.dll!WebNotificationCenter::postNotificationInternal(IWebNotification * notification, wchar_t * notificationName, IUnknown * anObject) Line 131	C++
&gt; WebKit.dll!WebNotificationCenter::postNotificationName(wchar_t * notificationName, IUnknown * anObject, IPropertyBag * userInfo) Line 183	C++
&gt; WebKit.dll!WebFrameLoaderClient::progressEstimateChanged(WebCore::Frame &amp;) Line 663	C++
&gt; WebKit.dll!WebCore::ProgressTracker::incrementProgress(unsigned long identifier, unsigned int bytesReceived) Line 262	C++
&gt; WebKit.dll!WebCore::ResourceLoadNotifier::didReceiveData(WebCore::ResourceLoader * loader, const char * data, int dataLength, int encodedDataLength) Line 87	C++
&gt; WebKit.dll!WebCore::ResourceLoader::didReceiveDataOrBuffer(const char * data, unsigned int length, WTF::RefPtr&lt;WebCore::SharedBuffer,WTF::DumbPtrTraits&lt;WebCore::SharedBuffer&gt; &gt; &amp;&amp; buffer, __int64 encodedDataLength, WebCore::DataPayloadType dataPayloadType) Line 532	C++
&gt; WebKit.dll!WebCore::SubresourceLoader::didReceiveDataOrBuffer(const char * data, int length, WTF::RefPtr&lt;WebCore::SharedBuffer,WTF::DumbPtrTraits&lt;WebCore::SharedBuffer&gt; &gt; &amp;&amp; buffer, __int64 encodedDataLength, WebCore::DataPayloadType dataPayloadType) Line 477	C++
&gt; WebKit.dll!WebCore::SubresourceLoader::didReceiveBuffer(WTF::Ref&lt;WebCore::SharedBuffer,WTF::DumbPtrTraits&lt;WebCore::SharedBuffer&gt; &gt; &amp;&amp; buffer, __int64 encodedDataLength, WebCore::DataPayloadType dataPayloadType) Line 461	C++
&gt; WebKit.dll!WebCore::ResourceLoader::didReceiveBuffer(WebCore::ResourceHandle *, WTF::Ref&lt;WebCore::SharedBuffer,WTF::DumbPtrTraits&lt;WebCore::SharedBuffer&gt; &gt; &amp;&amp; buffer, int encodedDataLength) Line 695	C++
&gt; WebKit.dll!WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer(WebCore::CurlRequest &amp;, WTF::Ref&lt;WebCore::SharedBuffer,WTF::DumbPtrTraits&lt;WebCore::SharedBuffer&gt; &gt; &amp;&amp; buffer) Line 155	C++
&gt; WebKit.dll!WebCore::CurlRequest::didReceiveData::&lt;unnamed-tag&gt;::operator()(WebCore::CurlRequest &amp; request, WebCore::CurlRequestClient &amp; client) Line 399	C++
&gt; WebKit.dll!WTF::Detail::CallableWrapper&lt;`lambda at ..\..\Source\WebCore\platform\network\curl\CurlRequest.cpp:397:24&apos;,void,WebCore::CurlRequest &amp;,WebCore::CurlRequestClient &amp;&gt;::call(WebCore::CurlRequest &amp; in, WebCore::CurlRequestClient &amp; in) Line 52	C++
&gt; WebKit.dll!WTF::Function&lt;void (WebCore::CurlRequest &amp;, WebCore::CurlRequestClient &amp;)&gt;::operator()(WebCore::CurlRequest &amp; in, WebCore::CurlRequestClient &amp; in) Line 79	C++
&gt; WebKit.dll!WebCore::CurlRequest::callClient::&lt;unnamed-tag&gt;::operator()() Line 181	C++
&gt; WebKit.dll!WTF::Detail::CallableWrapper&lt;`lambda at ..\..\Source\WebCore\platform\network\curl\CurlRequest.cpp:179:21&apos;,void&gt;::call() Line 52	C++
&gt; WTF.dll!WTF::Function&lt;void ()&gt;::operator()() Line 79	C++
&gt; WTF.dll!WTF::dispatchFunctionsFromMainThread() Line 114	C++
&gt; WTF.dll!WTF::ThreadingWindowWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 48	C++
&gt; [External Code]	
&gt; WebKit.dll!WebKitMessageLoop::run(HACCEL__ * hAccelTable) Line 94	C++
&gt; MiniBrowserLib.dll!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpstrCmdLine, int nCmdShow) Line 104	C++
&gt; MiniBrowserLib.dll!dllLauncherEntryPoint(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpstrCmdLine, int nCmdShow) Line 122	C++
&gt; MiniBrowser.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpstrCmdLine, int nCmdShow) Line 232	C++
&gt; [External Code]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1569061</commentid>
    <comment_count>1</comment_count>
      <attachid>378347</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2019-09-08 21:27:13 -0700</bug_when>
    <thetext>Created attachment 378347
WIP patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1569066</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2019-09-08 23:23:30 -0700</bug_when>
    <thetext>Notification observers should be unregistered from the default
notification center by using
IWebNotificationCenter::removeObserver. But,
WebKitLegacyBrowserWindow is not freed. I&apos;m going to fix the
issue and this issue in the following bug ticket.

Bug 201600 – [Win][MiniBrowser] WebKitLegacyBrowserWindow is leaked by circular references</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1569385</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2019-09-09 18:32:10 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 201600 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>378347</attachid>
            <date>2019-09-08 21:27:13 -0700</date>
            <delta_ts>2019-09-08 21:27:13 -0700</delta_ts>
            <desc>WIP patch</desc>
            <filename>wip.patch</filename>
            <type>text/plain</type>
            <size>940</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1Rvb2xzL01pbmlCcm93c2VyL3dpbi9XZWJLaXRMZWdhY3lCcm93c2VyV2lu
ZG93LmNwcCBiL1Rvb2xzL01pbmlCcm93c2VyL3dpbi9XZWJLaXRMZWdhY3lCcm93c2VyV2luZG93
LmNwcAppbmRleCAzMDkwYmRiZTNiOC4uYWNlMjUwNzcyMjMgMTAwNjQ0Ci0tLSBhL1Rvb2xzL01p
bmlCc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