<?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>136970</bug_id>
          
          <creation_ts>2014-09-19 18:46:31 -0700</creation_ts>
          <short_desc>Leak of mallocs under StructureSet::OutOfLineList::create</short_desc>
          <delta_ts>2014-09-19 20:02:00 -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>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="Ryosuke Niwa">rniwa</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>joepeck</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1036265</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2014-09-19 18:46:31 -0700</bug_when>
    <thetext>The leaks bot is seeing a lot of leaks of mallocs under StructureSet::OutOfLineList::create. The leak itself is small (48 bytes), but that is a large number of leaks:
&lt;http://build.webkit.org/builders/Apple%20MountainLion%20%28Leaks%29/builds/11637/steps/layout-test/logs/stdio&gt;

I don&apos;t have a test case, but the bots run frequently.

Example back traces show OutOfLineLists created in add, merge, and addOutOfLine:

	Call stack: [thread 0x12f65a000]: 
        | thread_start 
        | _pthread_start 
        | WTF::wtfThreadEntryPoint(void*) ThreadingPthreads.cpp:170 
        | WTF::threadEntryPoint(void*) Threading.cpp:68 
        | JSC::DFG::Worklist::threadFunction(void*) DFGWorklist.cpp:401 
        | JSC::DFG::Worklist::runThread(JSC::DFG::ThreadData*) DFGWorklist.cpp:358 
        | JSC::DFG::Plan::compileInThread(JSC::DFG::LongLivedState&amp;, JSC::DFG::ThreadData*) DFGPlan.cpp:162 
        | JSC::DFG::Plan::compileInThreadImpl(JSC::DFG::LongLivedState&amp;) DFGPlan.cpp:347 
        | JSC::DFG::performCFA(JSC::DFG::Graph&amp;) DFGCFAPhase.cpp:168 
        | bool JSC::DFG::runPhase&lt;JSC::DFG::CFAPhase&gt;(JSC::DFG::Graph&amp;) DFGPhase.h:87 
        | bool JSC::DFG::runAndLog&lt;JSC::DFG::CFAPhase&gt;(JSC::DFG::CFAPhase&amp;) DFGPhase.h:77 
        | JSC::DFG::CFAPhase::run() DFGCFAPhase.cpp:80 
        | JSC::DFG::CFAPhase::performForwardCFA() DFGCFAPhase.cpp:151 
        | JSC::DFG::CFAPhase::performBlockCFA(JSC::DFG::BasicBlock*) DFGCFAPhase.cpp:125 
        | JSC::DFG::AbstractInterpreter&lt;JSC::DFG::InPlaceAbstractState&gt;::execute(unsigned int) DFGAbstractInterpreterInlines.h:1992 
        | JSC::DFG::AbstractInterpreter&lt;JSC::DFG::InPlaceAbstractState&gt;::executeEffects(unsigned int, JSC::DFG::Node*) DFGAbstractInterpreterInlines.h:1655 
        | JSC::StructureSet::merge(JSC::StructureSet const&amp;) StructureSet.cpp:104 
        | JSC::StructureSet::OutOfLineList::create(unsigned int) StructureSet.cpp:387 
        | WTF::fastMalloc(unsigned long) FastMalloc.cpp:282 
        | malloc 
        | malloc_zone_malloc 

	Call stack: [thread 0x11b7a9000]: 
        | thread_start 
        | _pthread_start 
        | WTF::wtfThreadEntryPoint(void*) ThreadingPthreads.cpp:170 
        | WTF::threadEntryPoint(void*) Threading.cpp:68 
        | JSC::DFG::Worklist::threadFunction(void*) DFGWorklist.cpp:401 
        | JSC::DFG::Worklist::runThread(JSC::DFG::ThreadData*) DFGWorklist.cpp:358 
        | JSC::DFG::Plan::compileInThread(JSC::DFG::LongLivedState&amp;, JSC::DFG::ThreadData*) DFGPlan.cpp:162 
        | JSC::DFG::Plan::compileInThreadImpl(JSC::DFG::LongLivedState&amp;) DFGPlan.cpp:260 
        | JSC::DFG::performCFA(JSC::DFG::Graph&amp;) DFGCFAPhase.cpp:168 
        | bool JSC::DFG::runPhase&lt;JSC::DFG::CFAPhase&gt;(JSC::DFG::Graph&amp;) DFGPhase.h:87 
        | bool JSC::DFG::runAndLog&lt;JSC::DFG::CFAPhase&gt;(JSC::DFG::CFAPhase&amp;) DFGPhase.h:77 
        | JSC::DFG::CFAPhase::run() DFGCFAPhase.cpp:80 
        | JSC::DFG::CFAPhase::performForwardCFA() DFGCFAPhase.cpp:151 
        | JSC::DFG::CFAPhase::performBlockCFA(JSC::DFG::BasicBlock*) DFGCFAPhase.cpp:125 
        | JSC::DFG::AbstractInterpreter&lt;JSC::DFG::InPlaceAbstractState&gt;::execute(unsigned int) DFGAbstractInterpreterInlines.h:1992 
        | JSC::DFG::AbstractInterpreter&lt;JSC::DFG::InPlaceAbstractState&gt;::executeEffects(unsigned int, JSC::DFG::Node*) DFGAbstractInterpreterInlines.h:1489 
        | JSC::DFG::AbstractInterpreter&lt;JSC::DFG::InPlaceAbstractState&gt;::observeTransition(unsigned int, JSC::Structure*, JSC::Structure*) DFGAbstractInterpreter.h:2077 
        | void JSC::DFG::AbstractInterpreter&lt;JSC::DFG::InPlaceAbstractState&gt;::forAllValues&lt;JSC::DFG::AbstractValue::TransitionObserver&gt;(unsigned int, JSC::DFG::AbstractValue::TransitionObserver&amp;) DFGAbstractInterpreterInlines.h:2059 
        | JSC::DFG::AbstractValue::TransitionObserver::operator()(JSC::DFG::AbstractValue&amp;) DFGAbstractValue.h:131 
        | JSC::DFG::AbstractValue::observeTransition(JSC::Structure*, JSC::Structure*) DFGAbstractValue.h:113 
        | JSC::DFG::StructureAbstractValue::observeTransition(JSC::Structure*, JSC::Structure*) DFGStructureAbstractValue.cpp:95 
        | JSC::StructureSet::add(JSC::Structure*) StructureSet.cpp:50 
        | JSC::StructureSet::OutOfLineList::create(unsigned int) StructureSet.cpp:387 
        | WTF::fastMalloc(unsigned long) FastMalloc.cpp:282 
        | malloc 
        | malloc_zone_malloc 

Leak: 0x7f912ce560e0  size=64  zone: DefaultMallocZone_0x10b933000
	0x00000006 0x00000006 0x1a4937a0 0x00000001 	.........7I.....
	0x1a492c40 0x00000001 0x1a492460 0x00000001 	@,I.....`$I.....
	0x1a491b30 0x00000001 0x1a4984a0 0x00000001 	0.I.......I.....
	0x1a497ef0 0x00000001 0x00000000 0x00040000 	.~I.............
	Call stack: [thread 0x11fe42000]: 
        | thread_start 
        | _pthread_start 
        | WTF::wtfThreadEntryPoint(void*) ThreadingPthreads.cpp:170 
        | WTF::threadEntryPoint(void*) Threading.cpp:68 
        | JSC::DFG::Worklist::threadFunction(void*) DFGWorklist.cpp:401 
        | JSC::DFG::Worklist::runThread(JSC::DFG::ThreadData*) DFGWorklist.cpp:358 
        | JSC::DFG::Plan::compileInThread(JSC::DFG::LongLivedState&amp;, JSC::DFG::ThreadData*) DFGPlan.cpp:162 
        | JSC::DFG::Plan::compileInThreadImpl(JSC::DFG::LongLivedState&amp;) DFGPlan.cpp:207 
        | JSC::DFG::parse(JSC::DFG::Graph&amp;) DFGByteCodeParser.cpp:3941 
        | JSC::DFG::ByteCodeParser::parse() DFGByteCodeParser.cpp:3916 
        | JSC::DFG::ByteCodeParser::parseCodeBlock() DFGByteCodeParser.cpp:3856 
        | JSC::DFG::ByteCodeParser::parseBlock(unsigned int) DFGByteCodeParser.cpp:2854 
        | JSC::GetByIdStatus::computeFor(JSC::CodeBlock*, JSC::CodeBlock*, WTF::HashMap&lt;JSC::CodeOrigin, JSC::StructureStubInfo*, JSC::CodeOriginApproximateHash, WTF::HashTraits&lt;JSC::CodeOrigin&gt;, WTF::HashTraits&lt;JSC::StructureStubInfo*&gt; &gt;&amp;, WTF::HashMap&lt;JSC::CodeOrigin, JSC::StructureStubInfo*, JSC::CodeOriginApproximateHash, WTF::HashTraits&lt;JSC::CodeOrigin&gt;, WTF::HashTraits&lt;JSC::StructureStubInfo*&gt; &gt;&amp;, JSC::CodeOrigin, WTF::StringImpl*) GetByIdStatus.cpp:264 
        | JSC::GetByIdStatus::computeFor(JSC::CodeBlock*, WTF::HashMap&lt;JSC::CodeOrigin, JSC::StructureStubInfo*, JSC::CodeOriginApproximateHash, WTF::HashTraits&lt;JSC::CodeOrigin&gt;, WTF::HashTraits&lt;JSC::StructureStubInfo*&gt; &gt;&amp;, unsigned int, WTF::StringImpl*) GetByIdStatus.cpp:102 
        | JSC::GetByIdStatus::computeForStubInfo(JSC::ConcurrentJITLocker const&amp;, JSC::CodeBlock*, JSC::StructureStubInfo*, WTF::StringImpl*, JSC::CallLinkStatus::ExitSiteData) GetByIdStatus.cpp:208 
        | JSC::GetByIdStatus::appendVariant(JSC::GetByIdVariant const&amp;) GetByIdStatus.cpp:45 
        | JSC::GetByIdVariant::attemptToMerge(JSC::GetByIdVariant const&amp;) GetByIdVariant.cpp:99 
        | JSC::StructureSet::merge(JSC::StructureSet const&amp;) StructureSet.cpp:97 
        | JSC::StructureSet::add(JSC::Structure*) StructureSet.cpp:58 
        | JSC::StructureSet::addOutOfLine(JSC::Structure*) StructureSet.cpp:355 
        | JSC::StructureSet::OutOfLineList::create(unsigned int) StructureSet.cpp:387 
        | WTF::fastMalloc(unsigned long) FastMalloc.cpp:282 
        | malloc 
        | malloc_zone_malloc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036276</commentid>
    <comment_count>1</comment_count>
      <attachid>238405</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2014-09-19 19:34:40 -0700</bug_when>
    <thetext>Created attachment 238405
Fixes the leak</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036284</commentid>
    <comment_count>2</comment_count>
      <attachid>238405</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-09-19 20:01:57 -0700</bug_when>
    <thetext>Comment on attachment 238405
Fixes the leak

Clearing flags on attachment: 238405

Committed r173787: &lt;http://trac.webkit.org/changeset/173787&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1036285</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-09-19 20:02:00 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>238405</attachid>
            <date>2014-09-19 19:34:40 -0700</date>
            <delta_ts>2014-09-19 20:01:56 -0700</delta_ts>
            <desc>Fixes the leak</desc>
            <filename>bug-136970-20140919193423.patch</filename>
            <type>text/plain</type>
            <size>1265</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTczNzg1KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE1IEBA
CisyMDE0LTA5LTE5ICBSeW9zdWtlIE5pd2EgIDxybml3YUB3ZWJraXQub3JnPgorCisgICAgICAg
IExlYWsgb2YgbWFsbG9jcyB1bmRlciBTdHJ1Y3R1cmVTZXQ6Ok91dE9mTGluZUxpc3Q6OmNyZWF0
ZQorICAg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ClbbGlzdC0+bV9sZW5ndGhdID0gc3RydWN0dXJlOworICAgIE91
dE9mTGluZUxpc3Q6OmRlc3Ryb3kobGlzdCk7CiAgICAgc2V0KG5ld0xpc3QpOwogICAgIHJldHVy
biB0cnVlOwogfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>