<?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>73886</bug_id>
          
          <creation_ts>2011-12-05 19:15:27 -0800</creation_ts>
          <short_desc>REGRESSION(r101863-r102042): Assertion hit: m_verifier.isSafeToUse() in RefCountedBase::ref in FunctionCodeBlock</short_desc>
          <delta_ts>2011-12-09 18:13:24 -0800</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>528+ (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></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="David Levin">levin</assigned_to>
          <cc>ap</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>levin</cc>
    
    <cc>levin+threading</cc>
    
    <cc>oliver</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>515593</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-12-05 19:15:27 -0800</bug_when>
    <thetext>I&apos;ve been browsing on r102042 and I&apos;ve been repeatedly hitting the following assertion:

class RefCountedBase {
public:
    void ref()
    {
#ifndef NDEBUG
        // Start thread verification as soon as the ref count gets to 2. This
        // heuristic reflects the fact that items are often created on one thread
        // and then given to another thread to be used.
        // FIXME: Make this restriction tigher. Especially as we move to more
        // common methods for sharing items across threads like CrossThreadCopier.h
        // We should be able to add a &quot;detachFromThread&quot; method to make this explicit.
        if (m_refCount == 1)
            m_verifier.setShared(true);
#endif
        // If this assert fires, it either indicates a thread safety issue or
        // that the verification needs to change. See ThreadRestrictionVerifier for
        // the different modes.
        ASSERT(m_verifier.isSafeToUse()); // &lt; this one!

#0	0x1000c940a in WTF::RefCountedBase::ref at RefCounted.h:53
#1	0x1000dd65c in JSC::FunctionCodeBlock::FunctionCodeBlock at CodeBlock.h:1361
#2	0x1000d5a67 in JSC::FunctionExecutable::produceCodeBlockFor at Executable.cpp:475
#3	0x1000d6aea in JSC::FunctionExecutable::compileForCallInternal at Executable.cpp:516
#4	0x1000d6ffd in JSC::FunctionExecutable::compileOptimizedForCall at Executable.cpp:447
#5	0x1000780b3 in JSC::FunctionExecutable::compileOptimizedFor at Executable.h:573
#6	0x1000657cc in JSC::FunctionCodeBlock::compileOptimized at CodeBlock.cpp:2146
#7	0x10011e8b8 in cti_optimize_from_ret at JITStubs.cpp:2059
#8	0x100117386 in ctiOpThrowNotCaught at Instruction.h:81
#9	0x1000f41a0 in JSC::JITCode::execute at JITCode.h:115
#10	0x1000ea0ca in JSC::Interpreter::executeCall at Interpreter.cpp:1075
#11	0x100062787 in JSC::call at CallData.cpp:39
#12	0x10016238e in JSObjectCallAsFunction at JSObjectRef.cpp:443</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>515594</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-12-05 19:16:40 -0800</bug_when>
    <thetext>JSC changes in the regression window: http://trac.webkit.org/log/trunk/Source/JavaScriptCore?action=stop_on_copy&amp;mode=stop_on_copy&amp;rev=102042&amp;stop_rev=101863&amp;limit=100&amp;verbose=on</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>515596</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-12-05 19:22:57 -0800</bug_when>
    <thetext>Can you attach a full set of backtraces for all threads?

My guess is that the ASSERT (i.e., the verifier) needs to change, but I&apos;d like to make sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>515602</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-12-05 19:43:49 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Can you attach a full set of backtraces for all threads?
&gt; 
&gt; My guess is that the ASSERT (i.e., the verifier) needs to change, but I&apos;d like to make sure.

Hm... I&apos;m using WebKit1 so this is the &quot;only&quot; thread. Is there any information you&apos;re looking for?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>515605</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-12-05 19:50:22 -0800</bug_when>
    <thetext>Some stack traces. FYI, it&apos;s super easy to reproduce if you go to facebook and spend even like 1-2 minutes click on different places.

Safari: SafeBrowsingManager:
#0	0x1000c940a in WTF::RefCountedBase::ref at RefCounted.h:53
#1	0x1000dd65c in JSC::FunctionCodeBlock::FunctionCodeBlock at CodeBlock.h:1361
#2	0x1000d5a67 in JSC::FunctionExecutable::produceCodeBlockFor at Executable.cpp:475
#3	0x1000d6aea in JSC::FunctionExecutable::compileForCallInternal at Executable.cpp:516
#4	0x1000d6ffd in JSC::FunctionExecutable::compileOptimizedForCall at Executable.cpp:447
#5	0x1000780b3 in JSC::FunctionExecutable::compileOptimizedFor at Executable.h:573
#6	0x1000657cc in JSC::FunctionCodeBlock::compileOptimized at CodeBlock.cpp:2146
#7	0x10011e8b8 in cti_optimize_from_ret at JITStubs.cpp:2059
#8	0x100117386 in ctiOpThrowNotCaught at Instruction.h:81
#9	0x1000f41a0 in JSC::JITCode::execute at JITCode.h:115
#10	0x1000ea0ca in JSC::Interpreter::executeCall at Interpreter.cpp:1075
#11	0x100062787 in JSC::call at CallData.cpp:39
#12	0x10016238e in JSObjectCallAsFunction at JSObjectRef.cpp:443

JavaScriptCore::Marking
#0	0x7fff88483a6a in __semwait_signal
#1	0x7fff88487881 in _pthread_cond_wait
#2	0x100234f4d in WTF::ThreadCondition::wait at ThreadingPthreads.cpp:372
#3	0x100268245 in JSC::SlotVisitor::drainFromShared at MarkStack.cpp:423
#4	0x1002686cc in JSC::MarkStackThreadSharedData::markingThreadMain at MarkStack.cpp:224
#5	0x100268711 in JSC::MarkStackThreadSharedData::markingThreadStartFunc at MarkStack.cpp:229
#6	0x100234dc2 in WTF::threadEntryPoint at Threading.cpp:67
#7	0x7fff88481fd6 in _pthread_start
#8	0x7fff88481e89 in thread_start

JavaScriptCore::Marking
#0	0x7fff88483a6a in __semwait_signal
#1	0x7fff88487881 in _pthread_cond_wait
#2	0x100234f4d in WTF::ThreadCondition::wait at ThreadingPthreads.cpp:372
#3	0x100268245 in JSC::SlotVisitor::drainFromShared at MarkStack.cpp:423
#4	0x1002686cc in JSC::MarkStackThreadSharedData::markingThreadMain at MarkStack.cpp:224
#5	0x100268711 in JSC::MarkStackThreadSharedData::markingThreadStartFunc at MarkStack.cpp:229
#6	0x100234dc2 in WTF::threadEntryPoint at Threading.cpp:67
#7	0x7fff88481fd6 in _pthread_start
#8	0x7fff88481e89 in thread_start

JavaScriptCore::Marking
#0	0x7fff88483a6a in __semwait_signal
#1	0x7fff88487881 in _pthread_cond_wait
#2	0x100234f4d in WTF::ThreadCondition::wait at ThreadingPthreads.cpp:372
#3	0x100268245 in JSC::SlotVisitor::drainFromShared at MarkStack.cpp:423
#4	0x1002686cc in JSC::MarkStackThreadSharedData::markingThreadMain at MarkStack.cpp:224
#5	0x100268711 in JSC::MarkStackThreadSharedData::markingThreadStartFunc at MarkStack.cpp:229
#6	0x100234dc2 in WTF::threadEntryPoint at Threading.cpp:67
#7	0x7fff88481fd6 in _pthread_start
#8	0x7fff88481e89 in thread_start

JavaScriptCore::BlockFree
#0	0x7fff88483a6a in __semwait_signal
#1	0x7fff88487881 in _pthread_cond_wait
#2	0x100235047 in WTF::ThreadCondition::timedWait at ThreadingPthreads.cpp:393
#3	0x10026f0a3 in JSC::Heap::waitForRelativeTimeWhileHoldingLock at Heap.cpp:391
#4	0x10026f0d9 in JSC::Heap::waitForRelativeTime at Heap.cpp:401
#5	0x10026f106 in JSC::Heap::blockFreeingThreadMain at Heap.cpp:415
#6	0x10026f239 in JSC::Heap::blockFreeingThreadStartFunc at Heap.cpp:406
#7	0x100234dc2 in WTF::threadEntryPoint at Threading.cpp:67
#8	0x7fff88481fd6 in _pthread_start
#9	0x7fff88481e89 in thread_start

Safari: SnapshotStore
#0	0x7fff88483a6a in __semwait_signal
#1	0x7fff88487881 in _pthread_cond_wait
#2	0x100234f4d in WTF::ThreadCondition::wait at ThreadingPthreads.cpp:372
#3	0x100234fde in WTF::ThreadCondition::timedWait at ThreadingPthreads.cpp:382
#4	0x7fff8729b949 in Safari::MessageQueue&lt;WTF::RefPtr&lt;Safari::SnapshotStore::DiskAccessMessage&gt; &gt;::waitForMessageFilteredWithTimeout&lt;bool ()(WTF::RefPtr&lt;Safari::SnapshotStore::DiskAccessMessage&gt;&amp;)&gt;
#5	0x7fff87299d49 in Safari::SnapshotStore::diskAccessThreadBody
#6	0x7fff8729a503 in Safari::SnapshotStore::diskAccessThreadCallback
#7	0x100234dc2 in WTF::threadEntryPoint at Threading.cpp:67
#8	0x7fff88481fd6 in _pthread_start
#9	0x7fff88481e89 in thread_start</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>515607</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-12-05 19:51:36 -0800</bug_when>
    <thetext>com.apple.main-thread:
#0	0x1025dbefa in WebCore::JSNode::getOwnPropertySlot at JSNode.h:81
#1	0x1026cb777 in JSC::getStaticValueSlot&lt;WebCore::JSElement, WebCore::JSNode&gt; at Lookup.h:346
#2	0x1026cb8e7 in WebCore::JSElement::getOwnPropertySlot at JSElement.h:69
#3	0x1027254d3 in JSC::getStaticValueSlot&lt;WebCore::JSHTMLElement, WebCore::JSElement&gt; at Lookup.h:346
#4	0x10272485f in WebCore::JSHTMLElement::getOwnPropertySlot at JSHTMLElement.cpp:213
#5	0x10271e7c1 in JSC::getStaticValueSlot&lt;WebCore::JSHTMLDivElement, WebCore::JSHTMLElement&gt; at Lookup.h:346
#6	0x10271dc6d in WebCore::JSHTMLDivElement::getOwnPropertySlot at JSHTMLDivElement.cpp:148
#7	0x1000f46c8 in JSC::JSCell::fastGetOwnPropertySlot at JSObject.h:562
#8	0x1000f4889 in JSC::JSValue::get at JSObject.h:796
#9	0x1000b06e4 in operationGetById at DFGOperations.cpp:338
#10	0x56fc8d9b986a in ??
#11	0x1000f41a0 in JSC::JITCode::execute at JITCode.h:115
#12	0x1000ea0ca in JSC::Interpreter::executeCall at Interpreter.cpp:1075
#13	0x100062787 in JSC::call at CallData.cpp:39
#14	0x1026045dc in WebCore::JSMainThreadExecState::call at JSMainThreadExecState.h:52
#15	0x1026def8d in WebCore::JSEventListener::handleEvent at JSEventListener.cpp:124
#16	0x10231651a in WebCore::EventTarget::fireEventListeners at EventTarget.cpp:228
#17	0x102316a60 in WebCore::EventTarget::fireEventListeners at EventTarget.cpp:197
#18	0x102a44b61 in WebCore::Node::handleLocalEvents at Node.cpp:2842
#19	0x1022f80cc in WebCore::EventContext::handleLocalEvents at EventContext.cpp:48
#20	0x1022f9862 in WebCore::EventDispatcher::dispatchEvent at EventDispatcher.cpp:329
#21	0x102a30729 in WebCore::MouseEventDispatchMediator::dispatchEvent at MouseEvent.cpp:207
#22	0x1022f8b17 in WebCore::EventDispatcher::dispatchEvent at EventDispatcher.cpp:55
#23	0x102a44777 in WebCore::Node::dispatchMouseEvent at Node.cpp:2904
#24	0x102302c7d in WebCore::EventHandler::updateMouseEventTargetNode at EventHandler.cpp:2050
#25	0x102302dc8 in WebCore::EventHandler::dispatchMouseEvent at EventHandler.cpp:2067
#26	0x102305228 in WebCore::EventHandler::handleMouseMoveEvent at EventHandler.cpp:1675
#27	0x1023052de in WebCore::EventHandler::mouseMoved at EventHandler.cpp:1560
#28	0x10230b2fd in WebCore::EventHandler::mouseMoved at EventHandlerMac.mm:595
#29	0x100bfacf2 in -[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:] at WebHTMLView.mm:1621
#30	0x100be3eaf in -[WebHTMLView mouseMovedNotification:] at WebHTMLView.mm:3711</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>515617</commentid>
    <comment_count>6</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-12-05 20:18:33 -0800</bug_when>
    <thetext>It looks like the SafeBrowsingManager thread backtrace got truncated. Anyway, I think the right solution is to disable verification (deprecatedTurnOffVerifier). Verification is incorrect for all JavaScriptCore objects, since JavaScriptCore objects allow use on multiple threads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>516026</commentid>
    <comment_count>7</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2011-12-06 10:43:12 -0800</bug_when>
    <thetext>Agreed with Geoff, just like this:
http://trac.webkit.org/changeset/85233/trunk/Source/JavaScriptCore/parser/SourceProvider.h

for FunctionCodeBlock</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>516054</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-12-06 11:14:18 -0800</bug_when>
    <thetext>Apparently this assertion hits on r101863 as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518547</commentid>
    <comment_count>9</comment_count>
      <attachid>118646</attachid>
    <who name="David Levin">levin</who>
    <bug_when>2011-12-09 14:48:31 -0800</bug_when>
    <thetext>Created attachment 118646
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518711</commentid>
    <comment_count>10</comment_count>
      <attachid>118646</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-09 18:13:18 -0800</bug_when>
    <thetext>Comment on attachment 118646
Patch

Clearing flags on attachment: 118646

Committed r102508: &lt;http://trac.webkit.org/changeset/102508&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518712</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-09 18:13:24 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>118646</attachid>
            <date>2011-12-09 14:48:31 -0800</date>
            <delta_ts>2011-12-09 18:13:18 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-73886-20111209144830.patch</filename>
            <type>text/plain</type>
            <size>1730</size>
            <attacher name="David Levin">levin</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAyNDczCmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCA4
YTA0OWFiYTczNDhhNTRiNTY4YjAyNTg0YzQzODg0ZDA1Y2VhMWJmLi44OTQ5NDhhYzZkZGZlMjE5
ZTBiNmY4ZDU2ZmE1ZTFmMWFkZDAwZjJkIDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
NSArMSwxOCBAQAogMjAxMS0xMi0wOSAgRGF2aWQgTGV2aW4gIDxsZXZpbkBjaHJvbWl1bS5vcmc+
CiAKKyAgICAgICAgUkVHUkVTU0lPTihyMTAxODYzLXIxMDIwNDIpOiBBc3NlcnRpb24gaGl0OiBt
X3ZlcmlmaWVyLmlzU2FmZVRvVXNlKCkgaW4gUmVmQ291bnRlZEJhc2U6OnJlZiBpbiBGdW5jdGlv
bkNv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