<?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>170390</bug_id>
          
          <creation_ts>2017-04-02 09:54:08 -0700</creation_ts>
          <short_desc>WebAssembly: several tests added in r214504 crash when building with GCC</short_desc>
          <delta_ts>2017-04-05 00:53:53 -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>JavaScriptCore</component>
          <version>WebKit Local 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=169187</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>170391</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>buildbot</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1293530</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-02 09:54:08 -0700</bug_when>
    <thetext>The pattern foo-&gt;bar([f = WTFMove(foo)]); crashes when building with GCC, I assume the move happens before the foo is used to invoke the function.

Thread 1 (Thread 0x7ff8237ff700 (LWP 9200)):
#0  0x00007ffa7b5071e6 in std::_Function_handler&lt;void (JSC::Wasm::Plan&amp;), JSC::compileAndInstantiate(JSC::VM&amp;, JSC::ExecState*, JSC::JSPromiseDeferred*, JSC::JSValue, JSC::JSObject*)::{lambda(JSC::Wasm::Plan&amp;)#1}&gt;::_M_invoke(std::_Any_data const&amp;, JSC::Wasm::Plan&amp;) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#1  0x00007ffa7b4d101b in JSC::Wasm::Plan::complete(WTF::AbstractLocker const&amp;) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#2  0x00007ffa7b4d3e0b in JSC::Wasm::Plan::parseAndValidateModule() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#3  0x00007ffa7b4f8098 in JSC::Wasm::Worklist::Thread::work() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#4  0x00007ffa7b5760ef in std::_Function_handler&lt;void (), WTF::AutomaticThread::start(WTF::AbstractLocker const&amp;)::{lambda()#1}&gt;::_M_invoke(std::_Any_data const&amp;) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#5  0x00007ffa7b589705 in WTF::threadEntryPoint(void*) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#6  0x00007ffa7b5bb73a in WTF::wtfThreadEntryPoint(void*) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#7  0x00007ffa77c0e424 in start_thread (arg=0x7ff8237ff700) at pthread_create.c:333
#8  0x00007ffa76a209bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293531</commentid>
    <comment_count>1</comment_count>
      <attachid>306054</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-02 09:56:54 -0700</bug_when>
    <thetext>Created attachment 306054
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293532</commentid>
    <comment_count>2</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-04-02 09:57:22 -0700</bug_when>
    <thetext>That&apos;s not good! Would you want to prepare a patch to fix it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293533</commentid>
    <comment_count>3</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-04-02 09:58:36 -0700</bug_when>
    <thetext>(In reply to JF Bastien from comment #2)
&gt; That&apos;s not good! Would you want to prepare a patch to fix it?

Ha, we raced!


I think it would be better to get `VM&amp; vm` from plan, and then use it, instead of doing p-&gt;vm().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293581</commentid>
    <comment_count>4</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-02 22:45:47 -0700</bug_when>
    <thetext>(In reply to JF Bastien from comment #3)
&gt; (In reply to JF Bastien from comment #2)
&gt; &gt; That&apos;s not good! Would you want to prepare a patch to fix it?
&gt; 
&gt; Ha, we raced!
&gt; 
&gt; 
&gt; I think it would be better to get `VM&amp; vm` from plan, and then use it,
&gt; instead of doing p-&gt;vm().

Why? p and plan are actually the same, plan is just a Ref created from p (which is a reference, we are not doing p-&gt;vm() but p.vm()) to pass it to the lambda.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293582</commentid>
    <comment_count>5</comment_count>
      <attachid>306063</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-02 23:03:36 -0700</bug_when>
    <thetext>Created attachment 306063
Updated patch

Make it simpler by using makeRefPtr in the lambda capture</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293583</commentid>
    <comment_count>6</comment_count>
      <attachid>306063</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-02 23:17:42 -0700</bug_when>
    <thetext>Comment on attachment 306063
Updated patch

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

&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {

Why not plan=WTFMove(plan)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293617</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-03 03:26:34 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #6)
&gt; Comment on attachment 306063 [details]
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; 
&gt; Why not plan=WTFMove(plan)?

Because I&apos;ve removed the line that created the plan to simplify it. 

RefPtr&lt;Plan&gt; plan = makeRef(p);
[plan = WTFMove(plan)]

is equivalent to 

[plan = makeRefPtr(p)]

I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293652</commentid>
    <comment_count>8</comment_count>
      <attachid>306063</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-03 09:11:31 -0700</bug_when>
    <thetext>Comment on attachment 306063
Updated patch

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

&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt;&gt; 
&gt;&gt; Why not plan=WTFMove(plan)?
&gt; 
&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; 
&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; [plan = WTFMove(plan)]
&gt; 
&gt; is equivalent to 
&gt; 
&gt; [plan = makeRefPtr(p)]
&gt; 
&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).

Gotcha. I see what&apos;s going on.
I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293653</commentid>
    <comment_count>9</comment_count>
      <attachid>306063</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-03 09:14:36 -0700</bug_when>
    <thetext>Comment on attachment 306063
Updated patch

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

&gt;&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt;&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt;&gt;&gt; 
&gt;&gt;&gt; Why not plan=WTFMove(plan)?
&gt;&gt; 
&gt;&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt;&gt; 
&gt;&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt;&gt; [plan = WTFMove(plan)]
&gt;&gt; 
&gt;&gt; is equivalent to 
&gt;&gt; 
&gt;&gt; [plan = makeRefPtr(p)]
&gt;&gt; 
&gt;&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; 
&gt; Gotcha. I see what&apos;s going on.
&gt; I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
&gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.

Seems like you could also keep the code as is, and just use p.vm() instead of plan-&gt;vm().
Also, I&apos;m not sure why we make a RefPtr instead of a Ref here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293657</commentid>
    <comment_count>10</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-04-03 09:30:17 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #9)
&gt; Comment on attachment 306063 [details]
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; 
&gt; &gt;&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt;&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; &gt;&gt;&gt; 
&gt; &gt;&gt;&gt; Why not plan=WTFMove(plan)?
&gt; &gt;&gt; 
&gt; &gt;&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; &gt;&gt; 
&gt; &gt;&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; &gt;&gt; [plan = WTFMove(plan)]
&gt; &gt;&gt; 
&gt; &gt;&gt; is equivalent to 
&gt; &gt;&gt; 
&gt; &gt;&gt; [plan = makeRefPtr(p)]
&gt; &gt;&gt; 
&gt; &gt;&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; &gt; 
&gt; &gt; Gotcha. I see what&apos;s going on.
&gt; &gt; I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
&gt; &gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.
&gt; 
&gt; Seems like you could also keep the code as is, and just use p.vm() instead
&gt; of plan-&gt;vm().
&gt; Also, I&apos;m not sure why we make a RefPtr instead of a Ref here.

This weirdness is why I suggest getting VM, and then using it on this line. The entire problem is using plan two ways on one line of code: once to get to VM, once to lambda capture. Getting rid of one is an easy fix, lambda capture can&apos;t go, so VM on another line seems like the right fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293661</commentid>
    <comment_count>11</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-03 09:40:38 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #8)
&gt; Comment on attachment 306063 [details]
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; 
&gt; &gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; &gt;&gt; 
&gt; &gt;&gt; Why not plan=WTFMove(plan)?
&gt; &gt; 
&gt; &gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; &gt; 
&gt; &gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; &gt; [plan = WTFMove(plan)]
&gt; &gt; 
&gt; &gt; is equivalent to 
&gt; &gt; 
&gt; &gt; [plan = makeRefPtr(p)]
&gt; &gt; 
&gt; &gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; 
&gt; Gotcha. I see what&apos;s going on.
&gt; I still think you need a local variable for the plan, otherwise, won&apos;t the
&gt; lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.

I think it&apos;s the same, we are taking a reference of p and transferring it to the lambda.

&gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to
&gt; reason about than just having a local variable.

I don&apos;t mind leaving the local variable, I just thought it was simpler this way, in one step.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293662</commentid>
    <comment_count>12</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-03 09:43:21 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #9)
&gt; Comment on attachment 306063 [details]
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; 
&gt; &gt;&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt;&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; &gt;&gt;&gt; 
&gt; &gt;&gt;&gt; Why not plan=WTFMove(plan)?
&gt; &gt;&gt; 
&gt; &gt;&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; &gt;&gt; 
&gt; &gt;&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; &gt;&gt; [plan = WTFMove(plan)]
&gt; &gt;&gt; 
&gt; &gt;&gt; is equivalent to 
&gt; &gt;&gt; 
&gt; &gt;&gt; [plan = makeRefPtr(p)]
&gt; &gt;&gt; 
&gt; &gt;&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; &gt; 
&gt; &gt; Gotcha. I see what&apos;s going on.
&gt; &gt; I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
&gt; &gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.
&gt; 
&gt; Seems like you could also keep the code as is, and just use p.vm() instead
&gt; of plan-&gt;vm().

Yes, that&apos;s my first patch see comment #1

&gt; Also, I&apos;m not sure why we make a RefPtr instead of a Ref here.

I think it&apos;s because then we end up doing Ref&lt;&gt; foo = Ref(); and Ref(const Ref&amp; other) is deleted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293663</commentid>
    <comment_count>13</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-03 09:45:01 -0700</bug_when>
    <thetext>(In reply to JF Bastien from comment #10)
&gt; (In reply to Saam Barati from comment #9)
&gt; &gt; Comment on attachment 306063 [details]
&gt; &gt; Updated patch
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; &gt; 
&gt; &gt; &gt;&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt; &gt;&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; &gt; &gt;&gt;&gt; 
&gt; &gt; &gt;&gt;&gt; Why not plan=WTFMove(plan)?
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; &gt; &gt;&gt; [plan = WTFMove(plan)]
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; is equivalent to 
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; [plan = makeRefPtr(p)]
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; &gt; &gt; 
&gt; &gt; &gt; Gotcha. I see what&apos;s going on.
&gt; &gt; &gt; I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
&gt; &gt; &gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.
&gt; &gt; 
&gt; &gt; Seems like you could also keep the code as is, and just use p.vm() instead
&gt; &gt; of plan-&gt;vm().
&gt; &gt; Also, I&apos;m not sure why we make a RefPtr instead of a Ref here.
&gt; 
&gt; This weirdness is why I suggest getting VM, and then using it on this line.
&gt; The entire problem is using plan two ways on one line of code: once to get
&gt; to VM, once to lambda capture. Getting rid of one is an easy fix, lambda
&gt; capture can&apos;t go, so VM on another line seems like the right fix.

I don&apos;t see anything weird in the current patch, TBH. But I&apos;m fine with any other solution, either my first patch or adding another local variable for the VM or a combination of both using a local variable for VM, but using makeRefPtr directly in the lambda capture. All of them should work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293717</commentid>
    <comment_count>14</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-03 11:42:36 -0700</bug_when>
    <thetext>(In reply to Carlos Garcia Campos from comment #12)
&gt; (In reply to Saam Barati from comment #9)
&gt; &gt; Comment on attachment 306063 [details]
&gt; &gt; Updated patch
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; &gt; 
&gt; &gt; &gt;&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt; &gt;&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; &gt; &gt;&gt;&gt; 
&gt; &gt; &gt;&gt;&gt; Why not plan=WTFMove(plan)?
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; &gt; &gt;&gt; [plan = WTFMove(plan)]
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; is equivalent to 
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; [plan = makeRefPtr(p)]
&gt; &gt; &gt;&gt; 
&gt; &gt; &gt;&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; &gt; &gt; 
&gt; &gt; &gt; Gotcha. I see what&apos;s going on.
&gt; &gt; &gt; I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
&gt; &gt; &gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.
&gt; &gt; 
&gt; &gt; Seems like you could also keep the code as is, and just use p.vm() instead
&gt; &gt; of plan-&gt;vm().
&gt; 
&gt; Yes, that&apos;s my first patch see comment #1
I like your first patch. I&apos;m not sure what the semantics are here of your capture of plan, since you don&apos;t define another variable named &quot;plan&quot;. Anyways, I&apos;m worried about a reference cycle, which is why I like an explicit local variable. See the comment in WasmPlan.h.
&gt; 
&gt; &gt; Also, I&apos;m not sure why we make a RefPtr instead of a Ref here.
&gt; 
&gt; I think it&apos;s because then we end up doing Ref&lt;&gt; foo = Ref(); and Ref(const
&gt; Ref&amp; other) is deleted.
Why not just do:
Ref&lt;Plan&gt; plan(p);
?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294005</commentid>
    <comment_count>15</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-04 01:09:22 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #14)
&gt; (In reply to Carlos Garcia Campos from comment #12)
&gt; &gt; (In reply to Saam Barati from comment #9)
&gt; &gt; &gt; Comment on attachment 306063 [details]
&gt; &gt; &gt; Updated patch
&gt; &gt; &gt; 
&gt; &gt; &gt; View in context:
&gt; &gt; &gt; https://bugs.webkit.org/attachment.cgi?id=306063&amp;action=review
&gt; &gt; &gt; 
&gt; &gt; &gt; &gt;&gt;&gt;&gt; Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:94
&gt; &gt; &gt; &gt;&gt;&gt;&gt; +        p.vm().promiseDeferredTimer-&gt;scheduleWorkSoon(promise, [source, promise, globalObject, plan = makeRefPtr(p)] () mutable {
&gt; &gt; &gt; &gt;&gt;&gt; 
&gt; &gt; &gt; &gt;&gt;&gt; Why not plan=WTFMove(plan)?
&gt; &gt; &gt; &gt;&gt; 
&gt; &gt; &gt; &gt;&gt; Because I&apos;ve removed the line that created the plan to simplify it. 
&gt; &gt; &gt; &gt;&gt; 
&gt; &gt; &gt; &gt;&gt; RefPtr&lt;Plan&gt; plan = makeRef(p);
&gt; &gt; &gt; &gt;&gt; [plan = WTFMove(plan)]
&gt; &gt; &gt; &gt;&gt; 
&gt; &gt; &gt; &gt;&gt; is equivalent to 
&gt; &gt; &gt; &gt;&gt; 
&gt; &gt; &gt; &gt;&gt; [plan = makeRefPtr(p)]
&gt; &gt; &gt; &gt;&gt; 
&gt; &gt; &gt; &gt;&gt; I think this way is simpler, since we were only creating the plan to transfer it to the lambda capture (and to get the vm, but that is what caused the crash).
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Gotcha. I see what&apos;s going on.
&gt; &gt; &gt; &gt; I still think you need a local variable for the plan, otherwise, won&apos;t the lambda capture the outermost plan? I think that&apos;ll lead to a reference cycle.
&gt; &gt; &gt; &gt; Even if that assignment doesn&apos;t cause this to happen, I think it&apos;s harder to reason about than just having a local variable.
&gt; &gt; &gt; 
&gt; &gt; &gt; Seems like you could also keep the code as is, and just use p.vm() instead
&gt; &gt; &gt; of plan-&gt;vm().
&gt; &gt; 
&gt; &gt; Yes, that&apos;s my first patch see comment #1
&gt; I like your first patch. I&apos;m not sure what the semantics are here of your
&gt; capture of plan, since you don&apos;t define another variable named &quot;plan&quot;.
&gt; Anyways, I&apos;m worried about a reference cycle, which is why I like an
&gt; explicit local variable. See the comment in WasmPlan.h.

But this lambda is not the completion task one. That one is kept as a member of Plan, that&apos;s why it can cause a cycle. In this case we are keeping a ref in the lambda even if we use a local variable, because create the ref and then move to the lambda is the same as creating the ref in the lambda capture directly.

&gt; &gt; 
&gt; &gt; &gt; Also, I&apos;m not sure why we make a RefPtr instead of a Ref here.
&gt; &gt; 
&gt; &gt; I think it&apos;s because then we end up doing Ref&lt;&gt; foo = Ref(); and Ref(const
&gt; &gt; Ref&amp; other) is deleted.
&gt; Why not just do:
&gt; Ref&lt;Plan&gt; plan(p);
&gt; ?

JSWebAssemblyModule::createStub() expects a RefPtr&lt;&gt;&amp;&amp; anyway, so it&apos;s simpler this way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294420</commentid>
    <comment_count>16</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-05 00:32:11 -0700</bug_when>
    <thetext>Saam, anything else you want me to change in the patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294426</commentid>
    <comment_count>17</comment_count>
      <attachid>306054</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-05 00:45:49 -0700</bug_when>
    <thetext>Comment on attachment 306054
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294428</commentid>
    <comment_count>18</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-04-05 00:53:53 -0700</bug_when>
    <thetext>Committed r214935: &lt;http://trac.webkit.org/changeset/214935&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>306054</attachid>
            <date>2017-04-02 09:56:54 -0700</date>
            <delta_ts>2017-04-05 00:45:49 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>jsc-wasm-crashes.diff</filename>
            <type>text/plain</type>
            <size>3422</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IDBkNWI3ZmMyOTk5Li5jOWE5NmY1YzcyYiAxMDA2
NDQKLS0tIGEvU291cmNlL0phdmFTY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JFX0NBVENIX1NDT1BFKHZtKTsK
ICAgICAgICAgICAgIEV4ZWNTdGF0ZSogZXhlYyA9IGdsb2JhbE9iamVjdC0+Z2xvYmFsRXhlYygp
Owo=
</data>
<flag name="review"
          id="327527"
          type_id="1"
          status="+"
          setter="saam"
    />
          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>306063</attachid>
            <date>2017-04-02 23:03:36 -0700</date>
            <delta_ts>2017-04-04 01:10:53 -0700</delta_ts>
            <desc>Updated patch</desc>
            <filename>jsc-wasm-crashes.diff</filename>
            <type>text/plain</type>
            <size>3712</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IGExYzhiMmIwOTM2Li41MWRiNjcyNTlmNCAxMDA2
NDQKLS0tIGEvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZworKysgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDUgKzEsMjAgQEAKIDIwMTctMDQtMDIgIENhcmxv
cyBHYXJjaWEgQ2FtcG9zICA8Y2dhcmNpYUBpZ2FsaWEuY29tPgogCisgICAgICAgIFdlYkFzc2Vt
Ymx5OiBzZXZlcmFsIHRlc3RzIGFkZGVkIGluIHIyMTQ1MDQgY3Jhc2ggd2hlbiBidWlsZGluZyB3
aXRoIEdDQworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9
MTcwMzkwCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAg
VGhlIHBhdHRlcm4gZm9vLT5iYXIoW2YgPSBXVEZNb3ZlKGZvbylde30pOyBjcmFza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achment>
      

    </bug>

</bugzilla>