<?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>89346</bug_id>
          
          <creation_ts>2012-06-18 06:51:27 -0700</creation_ts>
          <short_desc>[Cairo] Fix memory leaks in GLContextGLX.cpp</short_desc>
          <delta_ts>2012-06-18 22:34:45 -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>WebKitGTK</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="Sudarsana Nagineni (babu)">naginenis</reporter>
          <assigned_to name="Sudarsana Nagineni (babu)">naginenis</assigned_to>
          <cc>mrobinson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>651357</commentid>
    <comment_count>0</comment_count>
    <who name="Sudarsana Nagineni (babu)">naginenis</who>
    <bug_when>2012-06-18 06:51:27 -0700</bug_when>
    <thetext>The following memory leaks found in GLContextGLX with different scenarios.

1) The last element in the ActiveContextList is not getting deleted, so pbuffer returned by glXCreatePbuffer is leaking.
http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp#L74

==27018== 264 (208 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 13,415 of 14,618
==27018==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27018==    by 0x1091340A: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==27018==    by 0x1090D513: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==27018==    by 0x1090DAC2: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==27018==    by 0x8276603: WebCore::GLContextGLX::createPbufferContext(__GLXcontextRec*) (GLContextGLX.cpp:135)
==27018==    by 0x82769A1: WebCore::GLContextGLX::createContext(unsigned long, WebCore::GLContext*) (GLContextGLX.cpp:212)
==27018==    by 0x8277AFA: WebCore::GLContext::createOffscreenContext(WebCore::GLContext*) (GLContext.cpp:54)
==27018==    by 0x7CE3C64: WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:41)
==27018==    by 0x7CE3BF8: WebCore::GraphicsContext3DPrivate::create(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:36)
==27018==    by 0x7CE26E7: WebCore::GraphicsContext3D::GraphicsContext3D(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, bool) (GraphicsContext3DCairo.cpp:79)
==27018==    by 0x7CE254A: WebCore::GraphicsContext3D::create(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, WebCore::GraphicsContext3D::RenderStyle) (GraphicsContext3DCairo.cpp:62)
==27018==    by 0x7CAD268: WebCore::WebGLRenderingContext::create(WebCore::HTMLCanvasElement*, WebCore::WebGLContextAttributes*) (WebGLRenderingContext.cpp:414)
==27018==    by 0x737AE71: WebCore::HTMLCanvasElement::getContext(WTF::String const&amp;, WebCore::CanvasContextAttributes*) (HTMLCanvasElement.cpp:201)
==27018==    by 0x6F640BF: WebCore::JSHTMLCanvasElement::getContext(JSC::ExecState*) (JSHTMLCanvasElementCustom.cpp:77)
==27018==    by 0x7E54616: WebCore::jsHTMLCanvasElementPrototypeFunctionGetContext(JSC::ExecState*) (JSHTMLCanvasElement.cpp:210)

2) pbuffer is leaking when the context is null.
http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp#L141

==11123== 1,488 (208 direct, 1,280 indirect) bytes in 1 blocks are definitely lost in loss record 13,955 of 14,422
==11123==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11123==    by 0x1091340A: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==11123==    by 0x1090D513: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==11123==    by 0x1090DAC2: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==11123==    by 0x8276603: WebCore::GLContextGLX::createPbufferContext(__GLXcontextRec*) (GLContextGLX.cpp:135)
==11123==    by 0x8276995: WebCore::GLContextGLX::createContext(unsigned long, WebCore::GLContext*) (GLContextGLX.cpp:212)
==11123==    by 0x8277AEE: WebCore::GLContext::createOffscreenContext(WebCore::GLContext*) (GLContext.cpp:54)
==11123==    by 0x8277A09: WebCore::GLContext::sharingContext() (GLContext.cpp:35)
==11123==    by 0x7CE3C52: WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:41)
==11123==    by 0x7CE3BF8: WebCore::GraphicsContext3DPrivate::create(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:36)
==11123==    by 0x7CE26E7: WebCore::GraphicsContext3D::GraphicsContext3D(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, bool) (GraphicsContext3DCairo.cpp:79)
==11123==    by 0x7CE254A: WebCore::GraphicsContext3D::create(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, WebCore::GraphicsContext3D::RenderStyle) (GraphicsContext3DCairo.cpp:62)
==11123==    by 0x7CAD268: WebCore::WebGLRenderingContext::create(WebCore::HTMLCanvasElement*, WebCore::WebGLContextAttributes*) (WebGLRenderingContext.cpp:414)
==11123==    by 0x737AE71: WebCore::HTMLCanvasElement::getContext(WTF::String const&amp;, WebCore::CanvasContextAttributes*) (HTMLCanvasElement.cpp:201)
==11123==    by 0x6F640BF: WebCore::JSHTMLCanvasElement::getContext(JSC::ExecState*) (JSHTMLCanvasElementCustom.cpp:77)
==11123==    by 0x7E54616: WebCore::jsHTMLCanvasElementPrototypeFunctionGetContext(JSC::ExecState*) (JSHTMLCanvasElement.cpp:210)

3) The reason for this leak is same as 1), when we call createPixmapContext().

==11123== 32 bytes in 1 blocks are definitely lost in loss record 4,574 of 14,422
==11123==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11123==    by 0x108EBAE9: glXCreateGLXPixmap (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==11123==    by 0x8276808: WebCore::GLContextGLX::createPixmapContext(__GLXcontextRec*) (GLContextGLX.cpp:184)
==11123==    by 0x82769D7: WebCore::GLContextGLX::createContext(unsigned long, WebCore::GLContext*) (GLContextGLX.cpp:214)
==11123==    by 0x8277AEE: WebCore::GLContext::createOffscreenContext(WebCore::GLContext*) (GLContext.cpp:54)
==11123==    by 0x7CE3C64: WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:41)
==11123==    by 0x7CE3BF8: WebCore::GraphicsContext3DPrivate::create(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:36)
==11123==    by 0x7CE26E7: WebCore::GraphicsContext3D::GraphicsContext3D(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, bool) (GraphicsContext3DCairo.cpp:79)
==11123==    by 0x7CE254A: WebCore::GraphicsContext3D::create(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, WebCore::GraphicsContext3D::RenderStyle) (GraphicsContext3DCairo.cpp:62)
==11123==    by 0x7CAD268: WebCore::WebGLRenderingContext::create(WebCore::HTMLCanvasElement*, WebCore::WebGLContextAttributes*) (WebGLRenderingContext.cpp:414)
==11123==    by 0x737AE71: WebCore::HTMLCanvasElement::getContext(WTF::String const&amp;, WebCore::CanvasContextAttributes*) (HTMLCanvasElement.cpp:201)
==11123==    by 0x6F640BF: WebCore::JSHTMLCanvasElement::getContext(JSC::ExecState*) (JSHTMLCanvasElementCustom.cpp:77)
==11123==    by 0x7E54616: WebCore::jsHTMLCanvasElementPrototypeFunctionGetContext(JSC::ExecState*) (JSHTMLCanvasElement.cpp:210)

4) visualInfo is leaking here.
http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp#L185

==11123== 640 bytes in 1 blocks are definitely lost in loss record 13,620 of 14,422
==11123==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11123==    by 0x11DB7915: XGetVisualInfo (VisUtil.c:78)
==11123==    by 0x108EAE5F: glXChooseVisual (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==11123==    by 0x827671C: WebCore::GLContextGLX::createPixmapContext(__GLXcontextRec*) (GLContextGLX.cpp:168)
==11123==    by 0x82769D7: WebCore::GLContextGLX::createContext(unsigned long, WebCore::GLContext*) (GLContextGLX.cpp:214)
==11123==    by 0x8277AEE: WebCore::GLContext::createOffscreenContext(WebCore::GLContext*) (GLContext.cpp:54)
==11123==    by 0x8277A09: WebCore::GLContext::sharingContext() (GLContext.cpp:35)
==11123==    by 0x7CE3C52: WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:41)
==11123==    by 0x7CE3BF8: WebCore::GraphicsContext3DPrivate::create(WebCore::GraphicsContext3D*) (GraphicsContext3DPrivate.cpp:36)
==11123==    by 0x7CE26E7: WebCore::GraphicsContext3D::GraphicsContext3D(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, bool) (GraphicsContext3DCairo.cpp:79)
==11123==    by 0x7CE254A: WebCore::GraphicsContext3D::create(WebCore::GraphicsContext3D::Attributes, WebCore::HostWindow*, WebCore::GraphicsContext3D::RenderStyle) (GraphicsContext3DCairo.cpp:62)
==11123==    by 0x7CAD268: WebCore::WebGLRenderingContext::create(WebCore::HTMLCanvasElement*, WebCore::WebGLContextAttributes*) (WebGLRenderingContext.cpp:414)
==11123==    by 0x737AE71: WebCore::HTMLCanvasElement::getContext(WTF::String const&amp;, WebCore::CanvasContextAttributes*) (HTMLCanvasElement.cpp:201)
==11123==    by 0x6F640BF: WebCore::JSHTMLCanvasElement::getContext(JSC::ExecState*) (JSHTMLCanvasElementCustom.cpp:77)
==11123==    by 0x7E54616: WebCore::jsHTMLCanvasElementPrototypeFunctionGetContext(JSC::ExecState*) (JSHTMLCanvasElement.cpp:210)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651379</commentid>
    <comment_count>1</comment_count>
      <attachid>148096</attachid>
    <who name="Sudarsana Nagineni (babu)">naginenis</who>
    <bug_when>2012-06-18 07:34:12 -0700</bug_when>
    <thetext>Created attachment 148096
Patch

Fixed memory leaks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651387</commentid>
    <comment_count>2</comment_count>
      <attachid>148096</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-06-18 07:58:52 -0700</bug_when>
    <thetext>Comment on attachment 148096
Patch

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

&gt; Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:75
&gt; -    for (size_t i = 0; i &lt; contextList.size(); ++i)
&gt; -        delete contextList[i];
&gt; +    for (size_t i = contextList.size(); i &gt; 0; --i)
&gt; +        delete contextList[i - 1];

I&apos;m not sure I understand this. Why is the last element leaking here and why does iterating backward help?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651417</commentid>
    <comment_count>3</comment_count>
      <attachid>148096</attachid>
    <who name="Sudarsana Nagineni (babu)">naginenis</who>
    <bug_when>2012-06-18 08:57:56 -0700</bug_when>
    <thetext>Comment on attachment 148096
Patch

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

&gt;&gt; Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:75
&gt;&gt; +        delete contextList[i - 1];
&gt; 
&gt; I&apos;m not sure I understand this. Why is the last element leaking here and why does iterating backward help?

contextList.size() is getting updated after removing the element from the vector in GLContextGLX::removeActiveContext(). So, the for loop termination condition returns always false in the last iteration, when we have more than one element. For example, when we have two elements in the vector, after the first iteration the size becomes 1 and the loop exits, so the second element leaks. 

I&apos;m iterating the vector backward so that the loop termination condition doesn&apos;t fail until the contextList.size() reaches 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651439</commentid>
    <comment_count>4</comment_count>
      <attachid>148096</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-06-18 09:27:59 -0700</bug_when>
    <thetext>Comment on attachment 148096
Patch

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

&gt;&gt;&gt; Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:75
&gt;&gt;&gt; +        delete contextList[i - 1];
&gt;&gt; 
&gt;&gt; I&apos;m not sure I understand this. Why is the last element leaking here and why does iterating backward help?
&gt; 
&gt; contextList.size() is getting updated after removing the element from the vector in GLContextGLX::removeActiveContext(). So, the for loop termination condition returns always false in the last iteration, when we have more than one element. For example, when we have two elements in the vector, after the first iteration the size becomes 1 and the loop exits, so the second element leaks. 
&gt; 
&gt; I&apos;m iterating the vector backward so that the loop termination condition doesn&apos;t fail until the contextList.size() reaches 0.

This sort of thing deserves a comment, I think. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651586</commentid>
    <comment_count>5</comment_count>
      <attachid>148096</attachid>
    <who name="Sudarsana Nagineni (babu)">naginenis</who>
    <bug_when>2012-06-18 11:42:30 -0700</bug_when>
    <thetext>Comment on attachment 148096
Patch

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

&gt;&gt;&gt;&gt; Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:75
&gt;&gt;&gt;&gt; +        delete contextList[i - 1];
&gt;&gt;&gt; 
&gt;&gt;&gt; I&apos;m not sure I understand this. Why is the last element leaking here and why does iterating backward help?
&gt;&gt; 
&gt;&gt; contextList.size() is getting updated after removing the element from the vector in GLContextGLX::removeActiveContext(). So, the for loop termination condition returns always false in the last iteration, when we have more than one element. For example, when we have two elements in the vector, after the first iteration the size becomes 1 and the loop exits, so the second element leaks. 
&gt;&gt; 
&gt;&gt; I&apos;m iterating the vector backward so that the loop termination condition doesn&apos;t fail until the contextList.size() reaches 0.
&gt; 
&gt; This sort of thing deserves a comment, I think. :)

Sure. I will add a comment and update the changelog also.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651596</commentid>
    <comment_count>6</comment_count>
      <attachid>148143</attachid>
    <who name="Sudarsana Nagineni (babu)">naginenis</who>
    <bug_when>2012-06-18 11:49:02 -0700</bug_when>
    <thetext>Created attachment 148143
Patch

Updated patch taking Martin&apos;s feedback into consideration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651605</commentid>
    <comment_count>7</comment_count>
      <attachid>148143</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-06-18 11:55:04 -0700</bug_when>
    <thetext>Comment on attachment 148143
Patch

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

&gt; Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:75
&gt; +    // Iterate the vector backwards, so that the loop termination condition
&gt; +    // doesn&apos;t fail until the size() reaches 0.

This still leaves the situation slightly obscure. The comment should specifically mention that delete contextList[i -1] removes the context from the vector as a side effect. In fact, maybe it&apos;s better to just do a check in GLContextGLX::removeActiveContext that we aren&apos;t cleaning up the list at exit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651609</commentid>
    <comment_count>8</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-06-18 12:06:42 -0700</bug_when>
    <thetext>If you like, I can make this change and land the patch or you can update the patch and use the cq. It&apos;s up to you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652039</commentid>
    <comment_count>9</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-06-18 22:34:45 -0700</bug_when>
    <thetext>Committed r120673: &lt;http://trac.webkit.org/changeset/120673&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>148096</attachid>
            <date>2012-06-18 07:34:12 -0700</date>
            <delta_ts>2012-06-18 11:49:02 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>89346.patch</filename>
            <type>text/plain</type>
            <size>2438</size>
            <attacher name="Sudarsana Nagineni (babu)">naginenis</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyMGIzMDY1Li42N2QzNjMwIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMjEg
QEAKKzIwMTItMDYtMTggIFN1ZGFyc2FuYSBOYWdpbmVuaSAgPHN1ZGFyc2FuYS5uYWdpbmVuaUBs
aW51eC5pbnRlbC5jb20+CisKKyAgICAgICAgW0NhaXJvXSBGaXggbWVtb3J5IGxlYWtzIGluIEdM
Q29udGV4dEdMWC5jcHAKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcu
Y2dpP2lkPTg5MzQ2CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAg
ICAgICAgRml4IG1lbW9yeSBsZWFrcyBmb3VuZCBpbiBHTENvbnRleHRHTFguY3BwLgorCisgICAg
ICAgICogcGxhdGZvcm0vZ3JhcGhp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y8gR0xYUGJ1ZmZlciBhbmQgWElEIGFyZSBib3Ro
IHRoZSBzYW1lIHR5cGVzIHVuZGVybmVhdGgsIHNvIHdlIGhhdmUgdG8gc2hhcmUKICAgICAvLyBh
IGNvbnN0cnVjdG9yIGhlcmUgd2l0aCB0aGUgd2luZG93IHBhdGguCkBAIC0xODMsNiArMTg1LDcg
QEAgUGFzc093blB0cjxHTENvbnRleHRHTFg+IEdMQ29udGV4dEdMWDo6Y3JlYXRlUGl4bWFwQ29u
dGV4dChHTFhDb250ZXh0IHNoYXJpbmdDb24KICAgICAgICAgcmV0dXJuIG51bGxwdHI7CiAgICAg
fQogCisgICAgWEZyZWUodmlzdWFsSW5mbyk7CiAgICAgcmV0dXJuIGFkb3B0UHRyKG5ldyBHTENv
bnRleHRHTFgoY29udGV4dCwgcGl4bWFwLCBnbHhQaXhtYXApKTsKIH0KIAo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>148143</attachid>
            <date>2012-06-18 11:49:02 -0700</date>
            <delta_ts>2012-06-18 16:56:00 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>89346.patch</filename>
            <type>text/plain</type>
            <size>2756</size>
            <attacher name="Sudarsana Nagineni (babu)">naginenis</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyMGIzMDY1Li5jODZhNGNmIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMjMg
QEAKKzIwMTItMDYtMTggIFN1ZGFyc2FuYSBOYWdpbmVuaSAgPHN1ZGFyc2FuYS5uYWdpbmVuaUBs
aW51eC5pbnRlbC5jb20+CisKKyAgICAgICAgW0NhaXJvXSBGaXggbWVtb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dXJuIGFkb3B0UHRyKG5ldyBHTENvbnRleHRHTFgoY29udGV4dCwgcGl4bWFw
LCBnbHhQaXhtYXApKTsKIH0KIAo=
</data>
<flag name="review"
          id="155786"
          type_id="1"
          status="+"
          setter="mrobinson"
    />
          </attachment>
      

    </bug>

</bugzilla>