<?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>136974</bug_id>
          
          <creation_ts>2014-09-19 19:32:19 -0700</creation_ts>
          <short_desc>JSStringRef leak on the leaks bot allocation under selectTextWithCriteriaCallback</short_desc>
          <delta_ts>2014-09-19 22:46:19 -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>
          
          
          <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 name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>cfleizach</cc>
    
    <cc>commit-queue</cc>
    
    <cc>joepeck</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1036273</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2014-09-19 19:32:19 -0700</bug_when>
    <thetext>JSStringRef leak seen on the leaks bots:
&lt;http://build.webkit.org/builders/Apple%20MountainLion%20%28Leaks%29/builds/11637/steps/layout-test/logs/stdio&gt;

Seems to come from the test code itself (selectTextWithCriteriaCallback in AccessibilityUIElement.cpp).

Leak: 0x7fcdb0a29b10  size=32  zone: DefaultMallocZone_0x10a6e9000
	0x00000001 0x70000000 0xb1014700 0x00007fcd 	.......p.G......
	0x00000000 0x00000000 0xdb1094ea 0x000207fc 	................
	Call stack: [thread 0x7fff782d9180]: 
        | 0x2 
        | start 
        | main DumpRenderTreeMain.mm:30 
        | DumpRenderTreeMain(int, char const**) DumpRenderTree.mm:1295 
        | dumpRenderTree(int, char const**) DumpRenderTree.mm:1164 
        | runTestingServerLoop() DumpRenderTree.mm:1073 
        | runTest(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) DumpRenderTree.mm:1853 
        | CFRunLoopRunSpecific 
        | __CFRunLoopRun 
        | __CFRunLoopDoSources0 
        | __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 
        | MultiplexerSource::perform() 
        | RunloopBlockContext::perform() 
        | CFArrayApplyFunction 
        | __block_global_1 
        | ___withDelegateAsync_block_invoke_0 
        | ___delegate_didReceiveDataArray_block_invoke_0 
        | _NSURLConnectionDidReceiveDataArray 
        | -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] 
        | -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] 
        | __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 
        | -[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:] WebCoreResourceHandleAsDelegate.mm:200 
        | WebCore::ResourceLoader::didReceiveBuffer(WebCore::ResourceHandle*, WTF::PassRefPtr&lt;WebCore::SharedBuffer&gt;, int) ResourceLoader.cpp:506 
        | WebCore::SubresourceLoader::didReceiveBuffer(WTF::PassRefPtr&lt;WebCore::SharedBuffer&gt;, long long, WebCore::DataPayloadType) SubresourceLoader.cpp:258 
        | WebCore::SubresourceLoader::didReceiveDataOrBuffer(char const*, int, WTF::PassRefPtr&lt;WebCore::SharedBuffer&gt;, long long, WebCore::DataPayloadType) SubresourceLoader.cpp:277 
        | WebCore::CachedRawResource::addDataBuffer(WebCore::ResourceBuffer*) CachedRawResource.cpp:72 
        | WebCore::CachedRawResource::notifyClientsDataWasReceived(char const*, unsigned int) CachedRawResource.cpp:117 
        | WebCore::DocumentLoader::dataReceived(WebCore::CachedResource*, char const*, int) DocumentLoader.cpp:891 
        | WebCore::DocumentLoader::commitLoad(char const*, int) DocumentLoader.cpp:771 
        | WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int) WebFrameLoaderClient.mm:988 
        | -[WebDataSource(WebInternal) _receivedData:] WebDataSource.mm:252 
        | -[WebHTMLRepresentation receivedData:withDataSource:] WebHTMLRepresentation.mm:191 
        | -[WebFrame(WebInternal) _commitData:] WebFrame.mm:1002 
        | WebCore::DocumentLoader::commitData(char const*, unsigned long) DocumentLoader.cpp:846 
        | WebCore::DocumentWriter::addData(char const*, unsigned long) DocumentWriter.cpp:224 
        | WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter&amp;, char const*, unsigned long) DecodedDataDocumentParser.cpp:50 
        | WebCore::HTMLDocumentParser::append(WTF::PassRefPtr&lt;WTF::StringImpl&gt;) HTMLDocumentParser.cpp:430 
        | WebCore::HTMLDocumentParser::pumpTokenizerIfPossible(WebCore::HTMLDocumentParser::SynchronousMode) HTMLDocumentParser.cpp:190 
        | WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode) HTMLDocumentParser.cpp:293 
        | WebCore::HTMLDocumentParser::canTakeNextToken(WebCore::HTMLDocumentParser::SynchronousMode, WebCore::PumpSession&amp;) HTMLDocumentParser.cpp:238 
        | WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder() HTMLDocumentParser.cpp:218 
        | WebCore::HTMLScriptRunner::execute(WTF::PassRefPtr&lt;WebCore::Element&gt;, WTF::TextPosition const&amp;) HTMLScriptRunner.cpp:177 
        | WebCore::HTMLScriptRunner::runScript(WebCore::Element*, WTF::TextPosition const&amp;) HTMLScriptRunner.cpp:304 
        | WebCore::ScriptElement::prepareScript(WTF::TextPosition const&amp;, WebCore::ScriptElement::LegacyTypeSupport) ScriptElement.cpp:237 
        | WebCore::ScriptElement::executeScript(WebCore::ScriptSourceCode const&amp;) ScriptElement.cpp:301 
        | WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&amp;) ScriptController.cpp:168 
        | WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&amp;, WebCore::DOMWrapperWorld&amp;) ScriptController.cpp:152 
        | WebCore::JSMainThreadExecState::evaluate(JSC::ExecState*, JSC::SourceCode const&amp;, JSC::JSValue, JSC::JSValue*) JSMainThreadExecState.h:62 
        | JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&amp;, JSC::JSValue, JSC::JSValue*) Completion.cpp:82 
        | JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*) Interpreter.cpp:928 
        | JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) JITCode.cpp:56 
        | vmEntryToJavaScript 
        | llint_entry 
        | llint_slow_path_call LLIntSlowPaths.cpp:1160 
        | JSC::LLInt::genericCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind) LLIntSlowPaths.cpp:1154 
        | JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) LLIntSlowPaths.cpp:1090 
        | JSC::LLInt::handleHostCall(JSC::ExecState*, JSC::Instruction*, JSC::JSValue, JSC::CodeSpecializationKind) LLIntSlowPaths.cpp:1044 
        | long long JSC::APICallbackFunction::call&lt;JSC::JSCallbackFunction&gt;(JSC::ExecState*) APICallbackFunction.h:61 
        | selectTextWithCriteriaCallback(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) AccessibilityUIElement.cpp:273 
        | JSValueToStringCopy JSValueRef.cpp:416 
        | OpaqueJSString::create(WTF::String const&amp;) OpaqueJSString.cpp:41 
        | WTF::ThreadSafeRefCountedBase::operator new(unsigned long) ThreadSafeRefCounted.h:70 
        | WTF::fastMalloc(unsigned long) FastMalloc.cpp:282 
        | malloc 
        | malloc_zone_malloc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036279</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2014-09-19 19:36:56 -0700</bug_when>
    <thetext>* STEPS TO REPRODUCE
shell&gt; ./Tools/Scripts/run-webkit-tests --release platform/mac/accessibility/select-text.html --leaks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036280</commentid>
    <comment_count>2</comment_count>
      <attachid>238406</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2014-09-19 19:37:12 -0700</bug_when>
    <thetext>Created attachment 238406
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036293</commentid>
    <comment_count>3</comment_count>
      <attachid>238406</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-09-19 22:46:17 -0700</bug_when>
    <thetext>Comment on attachment 238406
[PATCH] Proposed Fix

Clearing flags on attachment: 238406

Committed r173789: &lt;http://trac.webkit.org/changeset/173789&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036294</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-09-19 22:46:19 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>238406</attachid>
            <date>2014-09-19 19:37:12 -0700</date>
            <delta_ts>2014-09-19 22:46:17 -0700</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>ax-leak.patch</filename>
            <type>text/plain</type>
            <size>1395</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1Rvb2xzL0NoYW5nZUxvZyBiL1R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