<?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>185242</bug_id>
          
          <creation_ts>2018-05-03 01:49:17 -0700</creation_ts>
          <short_desc>[MSE][GStreamer] Delete properly the stream from the WebKitMediaSource</short_desc>
          <delta_ts>2018-05-17 05:04:56 -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>Media</component>
          <version>WebKit 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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>185277</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Yacine Bandou">bandou.yacine</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aboya</cc>
    
    <cc>calvaris</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eocanha</cc>
    
    <cc>olivier.blin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1420057</commentid>
    <comment_count>0</comment_count>
    <who name="Yacine Bandou">bandou.yacine</who>
    <bug_when>2018-05-03 01:49:17 -0700</bug_when>
    <thetext>When the sourceBuffer is removed from mediasource, the appropriate stream is not properly deleted from WebKitMediaSource.
The Appsrc and the Parser didn&apos;t removed from the WebKitMediaSource bin element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420079</commentid>
    <comment_count>1</comment_count>
    <who name="Enrique Ocaña">eocanha</who>
    <bug_when>2018-05-03 03:42:58 -0700</bug_when>
    <thetext>Is this SourceBuffer removal happening at any time point different from the player destruction? Specifically, do you have any use case where the player keeps being used after a single SourceBuffer is removed? This would mean that actual removal of the appsrc and parser elements on demand should be taken into account (currently isn&apos;t, as you pointed out).

Otherwise, the WebKitMediaSrc bin destruction should automatically trigger the destruction of the appsrc and parser elements. I don&apos;t remember the implications now, but probably the implementation is like this (removal deferred to bin destruction) in order to avoid transient states caused by the on-demand removal, which might complicate WebKitMediaSrc management without need in a moment where its final destruction is about to happen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420102</commentid>
    <comment_count>2</comment_count>
    <who name="Yacine Bandou">bandou.yacine</who>
    <bug_when>2018-05-03 06:30:27 -0700</bug_when>
    <thetext>(In reply to Enrique Ocaña from comment #1)
&gt; Is this SourceBuffer removal happening at any time point different from the
&gt; player destruction? Specifically, do you have any use case where the player
&gt; keeps being used after a single SourceBuffer is removed? This would mean
&gt; that actual removal of the appsrc and parser elements on demand should be
&gt; taken into account (currently isn&apos;t, as you pointed out).
&gt; 
&gt; Otherwise, the WebKitMediaSrc bin destruction should automatically trigger
&gt; the destruction of the appsrc and parser elements. I don&apos;t remember the
&gt; implications now, but probably the implementation is like this (removal
&gt; deferred to bin destruction) in order to avoid transient states caused by
&gt; the on-demand removal, which might complicate WebKitMediaSrc management
&gt; without need in a moment where its final destruction is about to happen.

Currently when there is an error in playback as no decryption key in the decryptor the implementation calls  HTMLMediaElement::noneSupported() wich 
detaches the MediaSource from MediaElement then it removes all its SourceBuffers.

When we remove SourceBuffer the function webKitMediaSrcFreeStream(m_webKitMediaSrc.get(), stream)  is called via PlaybackPipeline::removeSourceBuffer(sourceBufferPrivate).

Then the PlayerPrivate catch &quot;source-setup&quot; signal and calls MediaPlayerPrivateGStreamerMSE::sourceSetup wich calls setPrivateAndOpen via MediaSourceGStreamer::open.

The function setPrivateAndOpen tries to call the instance of MediaElement wich is already detached from MediaSource, thus causing a crash.  

When we properly delete the Stream by removing the appropriate appsrc and parser from the bin, the pipeline never send the &quot;source-setup&quot; signal.

Otherwise, I think the function webKitMediaSrcFreeStream should delete the Stream correctly without having this crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420505</commentid>
    <comment_count>3</comment_count>
      <attachid>339498</attachid>
    <who name="Yacine Bandou">bandou.yacine</who>
    <bug_when>2018-05-03 18:00:56 -0700</bug_when>
    <thetext>Created attachment 339498
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420593</commentid>
    <comment_count>4</comment_count>
      <attachid>339498</attachid>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2018-05-04 01:03:19 -0700</bug_when>
    <thetext>Comment on attachment 339498
Patch

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

I see this patch is ok though I prefer Enrique to give the final go.

&gt; Source/WebCore/ChangeLog:10
&gt; +        The Appsrc and the Parser didn&apos;t removed from the WebKitMediaSource bin element.

This sentence doesn&apos;t make too much sense to me.

&gt; Source/WebCore/ChangeLog:12
&gt; +        This patch avoid the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071

avoids.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420599</commentid>
    <comment_count>5</comment_count>
      <attachid>339498</attachid>
    <who name="Enrique Ocaña">eocanha</who>
    <bug_when>2018-05-04 02:25:07 -0700</bug_when>
    <thetext>Comment on attachment 339498
Patch

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

&gt; Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:543
&gt; +            source-&gt;priv-&gt;numberOfAudioStreams--;

These changes in numberOf{Audio,Video,Text}Streams must be protected by GST_OBJECT_{LOCK,UNLOCK}(webKitMediaSrc) (webKitMediaSrc is &quot;source&quot; in webKitMediaSrcFreeStream()). See PlaybackPipeline::attachTrack() and ::reattachTrack().

In order to avoid taking both the webKitMediaSrc and stream locks at the same time, split the code in two pieces, duplicating the &quot;if (stream-&gt;type != WebCore::Invalid) {&quot; block and its inner switch statement. The first &quot;if&quot; block would be protected by GST_OBJECT{LOCK,UNLOCK}(webKitMediaSrc) and would just change numberOf{Audio,Video,Text}Streams as quickly as possible. The second &quot;if&quot; block would be the original one, which locks on streamLock.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420611</commentid>
    <comment_count>6</comment_count>
      <attachid>339534</attachid>
    <who name="Yacine Bandou">bandou.yacine</who>
    <bug_when>2018-05-04 03:17:45 -0700</bug_when>
    <thetext>Created attachment 339534
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420617</commentid>
    <comment_count>7</comment_count>
      <attachid>339534</attachid>
    <who name="Enrique Ocaña">eocanha</who>
    <bug_when>2018-05-04 04:17:03 -0700</bug_when>
    <thetext>Comment on attachment 339534
Patch

Looks good. Let&apos;s wait for Xabier to +r it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420635</commentid>
    <comment_count>8</comment_count>
      <attachid>339534</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-05-04 06:26:18 -0700</bug_when>
    <thetext>Comment on attachment 339534
Patch

Clearing flags on attachment: 339534

Committed r231351: &lt;https://trac.webkit.org/changeset/231351&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420636</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-05-04 06:26:20 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1420637</commentid>
    <comment_count>10</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-05-04 06:27:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/39974810&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424292</commentid>
    <comment_count>11</comment_count>
      <attachid>339534</attachid>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2018-05-16 05:03:47 -0700</bug_when>
    <thetext>Comment on attachment 339534
Patch

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

&gt; Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:516
&gt; +        gst_element_set_state(stream-&gt;appsrc, GST_STATE_NULL);

This will deadlock whenever the streaming thread is waiting for some action that requires WebKit intervention. Note that:

a) Setting a source element state to NULL deactivates its pad and therefore attempts to tear down its streaming thread.

b) Tearing down a streaming thread is a stream-synchronized operation. The streaming thread is shared with other elements downstream. This means that we need to wait until no buffer or (stream synchronized) event is traveling through this stream.

c) A traveling buffer may be blocked waiting for something. For instance, usually the stream ends at the sinkpad of a queue element (the srcpad of the queue element starts a separate streaming thread, so for threading purposes that&apos;s separate stream). If the queue is full and won&apos;t gain any space until WebKit&apos;s main thread performs some action you&apos;ve got yourself in a catch 22, deadlock.

This is what is causing YTTV 18. MediaElementEvents to deadlock after this patch. Note that even though the test finishes when WebKit reports playback has ended, several seconds worth of frames are still queued in the playback pipeline because of a change of duration to a shorter value. The pipeline is set to PAUSED when the shorter duration is reached, so those extra frames are not played, but still try to continue travelling through the pipeline. When the sink element receives a frame in this PAUSED state it has to wait for a state change to PLAYING before doing anything with it (see gst_base_sink_wait_preroll()). This blocks the streaming thread containing the sink. Streaming threads upstream still continue pushing buffers for some time until the queue becomes full, then get blocked as well.

Summarizing: in order to tear down the source element you need to tear down its streaming thread. In order to tear down the streaming thread you need to wait for the current flowing buffer to complete its journey in this streaming thread, but that won&apos;t happen until the queue at the end of this stream has available space and therefore stops blocking the thread. The queue won&apos;t have available space until the sink is set to PLAYING or the pipeline is flushed. That won&apos;t ever happen (moreso when the main thread is waiting), therefore you&apos;ve got a deadlock.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424587</commentid>
    <comment_count>12</comment_count>
    <who name="Yacine Bandou">bandou.yacine</who>
    <bug_when>2018-05-16 19:52:28 -0700</bug_when>
    <thetext>(In reply to Alicia Boya García from comment #11)
&gt; Comment on attachment 339534 [details]
&gt; Patch
&gt; 
&gt; 
&gt; Summarizing: in order to tear down the source element you need to tear down
&gt; its streaming thread. In order to tear down the streaming thread you need to
&gt; wait for the current flowing buffer to complete its journey in this
&gt; streaming thread, but that won&apos;t happen until the queue at the end of this
&gt; stream has available space and therefore stops blocking the thread. The
&gt; queue won&apos;t have available space until the sink is set to PLAYING or the
&gt; pipeline is flushed. That won&apos;t ever happen (moreso when the main thread is
&gt; waiting), therefore you&apos;ve got a deadlock.

I agree with you, when I studied in detail what happen with encrypted-media WPT tests, I saw what you said.
For that, I tried to fix it with the patch 185592, but it is a bad solution.

After a detailed investigation, I found that, this patch doesn&apos;t fix the crash, it just replaces the crash by a blocking.

Here is the real root cause of the crash. (-&gt; : calls)

1.When an error occurs in playback pipeline (no decipher key), we receive an error message in MediaPlayerPrivateGStreamer::handleMessage -&gt; MediaPlayerPrivateGStreamer::loadingFailed (MediaPlayer::FormatError).

2.The function loadingFailed -&gt; HTMLMediaElement::mediaPlayerNetworkStateChanged (MediaPlayer::FormatError) -&gt; setNetworkState -&gt; mediaLoadingFailed -&gt; noneSupported go to the point 3
                              |
                               -&gt; HTMLMediaElement::mediaPlayerReadyStateChanged(MediaPlayer::HaveNothing) -&gt; setReadyState -&gt; updatePlayState() go to the point 5

3.nonSupported -&gt; detachMediaSource -&gt; MediaSource::detachFromElement -&gt; removeSourceBuffer -&gt; MediaSourceGStreamer::removeSourceBuffer -&gt; .. -&gt;PlaybackPipeline::removeSourceBuffer

4.PlaybackPipeline::removeSourceBuffer -&gt; webKitMediaSrcFreeStream . 

5.HTMLMediaElement::updatePlayState -&gt; potentiallyPlaying -&gt; stoppedDueToErrors ( This function returns false because (m_readyState &gt;= HAVE_METADATA &amp;&amp; m_error) is false, m_readyState equal to HaveNothing )

6.HTMLMediaElement::updatePlayState -&gt; MediaPlayer::play -&gt; MediaPlayerPrivateGStreamer::play -&gt; changePipelineState (set the pipeline to playing state)

7.WebkitMediaSourceGStreamer sends &quot;source-setup&quot; signal when its state change from Ready to Paused, the signal catched in MediaPlayerPrivateGStreamer::sourceSetupCallback

8.MediaPlayerPrivateGStreamer::sourceSetupCallback -&gt; MediaPlayerPrivateGStreamerMSE::sourceSetup -&gt; MediaSourceGStreamer::open -&gt; MediaSource::setPrivateAndOpen (crash in this function because the mediaSource is detached from mediaElement in the point 3, thus the variable  m_mediaElement is null).


In the point 5 the function &quot;HTMLMediaElement::stoppedDueToErrors&quot; returns false, because m_readyState equal to HaveNothing and it is not upper than HAVE_METADATA.
I think we don&apos;t have to set the ReadyState to HaveNothing when an error occurs in pipeline, we should just set NetworkState to error.


Here is the my roadmap:
1. I&apos;ll push a new patch to remove a part of this patch (185242) which caused the blocking.
2. I&apos;ll push an other new patch to fix the crash, this patch just set NetworkState without ReadyState when an error occurs in pipeline.
3. I&apos;ll close the bug 185592 as invalid bug.
4. I&apos;ll update the patch 185593 to depend on the two new patches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424658</commentid>
    <comment_count>13</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2018-05-17 03:14:26 -0700</bug_when>
    <thetext>&gt; 1. I&apos;ll push a new patch to remove a part of this patch (185242) which caused the blocking.

Is there a reason to keep some parts of this patch? Which ones?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424659</commentid>
    <comment_count>14</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2018-05-17 03:16:10 -0700</bug_when>
    <thetext>(Notice that, as explained in https://bugs.webkit.org/show_bug.cgi?id=185592#c13, you can&apos;t just remove the appsrc and assume the stream is gone).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424685</commentid>
    <comment_count>15</comment_count>
    <who name="Yacine Bandou">bandou.yacine</who>
    <bug_when>2018-05-17 05:04:56 -0700</bug_when>
    <thetext>(In reply to Alicia Boya García from comment #13)
&gt; &gt; 1. I&apos;ll push a new patch to remove a part of this patch (185242) which caused the blocking.
&gt; 
&gt; Is there a reason to keep some parts of this patch? Which ones?

I keep the part which update the &quot;source-&gt;priv-&gt;numberOfXXXXStreams&quot;

 527    GST_OBJECT_LOCK(source);
 528    switch (stream-&gt;type) {
 529    case WebCore::Audio:
 530        source-&gt;priv-&gt;numberOfAudioStreams--;
 531        break;
 532    case WebCore::Video:
 533        source-&gt;priv-&gt;numberOfVideoStreams--;
 534        break;
 535    case WebCore::Text:
 536        source-&gt;priv-&gt;numberOfTextStreams--;
 537        break;
 538    default:
 539        break;
 540    }
 541    GST_OBJECT_UNLOCK(source);</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>339498</attachid>
            <date>2018-05-03 18:00:56 -0700</date>
            <delta_ts>2018-05-04 03:17:40 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-185242-20180504030055.patch</filename>
            <type>text/plain</type>
            <size>2906</size>
            <attacher name="Yacine Bandou">bandou.yacine</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjMxMDQ0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZTE4MmIwYThjYjhkN2E4
NmVkNWY1OWE4MTlmNDVmYzU1ZTEwZmQ3ZS4uZmYyNzlmYWZjMmU2YTA1YjFjZDVjYzU2ZGEyNzI2
OGRhZTdmYjgwYiAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE5IEBACisyMDE4LTA1LTAzICBZYWNp
bmUgQmFuZG91ICA8eWFjaW5lLmJhbmRvdV9leHRAc29mdGF0aG9tZS5jb20+CisKKyAgICAgICAg
W01TRV1bR1N0cmVhbWVy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ICAgYnJlYWs7CiAgICAgICAgIGNhc2UgV2ViQ29yZTo6VGV4dDoKKyAgICAgICAgICAgIHNvdXJj
ZS0+cHJpdi0+bnVtYmVyT2ZUZXh0U3RyZWFtcy0tOwogICAgICAgICAgICAgc2lnbmFsID0gU0lH
TkFMX1RFWFRfQ0hBTkdFRDsKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBkZWZhdWx0Ogo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>339534</attachid>
            <date>2018-05-04 03:17:45 -0700</date>
            <delta_ts>2018-05-04 06:26:18 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-185242-20180504121744.patch</filename>
            <type>text/plain</type>
            <size>2794</size>
            <attacher name="Yacine Bandou">bandou.yacine</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjMxMDQ0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZTE4MmIwYThjYjhkN2E4
NmVkNWY1OWE4MTlmNDVmYzU1ZTEwZmQ3ZS4uNzcxYmE0NmM1MmZiZjYzNTM0N2VjMTFhMzgzYjIw
NTE0M2M0MTU4MyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE5IEBACisyMDE4LTA1LTAzICBZYWNp
bmUgQmFuZG91ICA8eWFjaW5lLmJhbmRvdV9leHRAc29mdGF0aG9tZS5jb20+CisKKyAgICAgICAg
W01TRV1bR1N0cmVhbWVyXSBEZWxldGUgcHJvcGVybHkgdGhlIHN0cmVhbSBmcm9tIHRoZSBXZWJL
aXRNZWRpYVNvdXJjZQorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2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JJTihzb3VyY2UpLCBzdHJlYW0tPmFwcHNyYyk7CisgICAgICAg
IHN0cmVhbS0+YXBwc3JjID0gbnVsbHB0cjsKICAgICB9CiAKKyAgICBpZiAoc3RyZWFtLT5wYXJz
ZXIpIHsKKyAgICAgICAgZ3N0X2VsZW1lbnRfc2V0X3N0YXRlKHN0cmVhbS0+cGFyc2VyLCBHU1Rf
U1RBVEVfTlVMTCk7CisgICAgICAgIGdzdF9iaW5fcmVtb3ZlKEdTVF9CSU4oc291cmNlKSwgc3Ry
ZWFtLT5wYXJzZXIpOworICAgICAgICBzdHJlYW0tPnBhcnNlciA9IG51bGxwdHI7CisgICAgfQor
CisgICAgR1NUX09CSkVDVF9MT0NLKHNvdXJjZSk7CisgICAgc3dpdGNoIChzdHJlYW0tPnR5cGUp
IHsKKyAgICBjYXNlIFdlYkNvcmU6OkF1ZGlvOgorICAgICAgICBzb3VyY2UtPnByaXYtPm51bWJl
ck9mQXVkaW9TdHJlYW1zLS07CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgV2ViQ29yZTo6Vmlk
ZW86CisgICAgICAgIHNvdXJjZS0+cHJpdi0+bnVtYmVyT2ZWaWRlb1N0cmVhbXMtLTsKKyAgICAg
ICAgYnJlYWs7CisgICAgY2FzZSBXZWJDb3JlOjpUZXh0OgorICAgICAgICBzb3VyY2UtPnByaXYt
Pm51bWJlck9mVGV4dFN0cmVhbXMtLTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAg
ICAgICAgYnJlYWs7CisgICAgfQorICAgIEdTVF9PQkpFQ1RfVU5MT0NLKHNvdXJjZSk7CisKICAg
ICBpZiAoc3RyZWFtLT50eXBlICE9IFdlYkNvcmU6OkludmFsaWQpIHsKICAgICAgICAgR1NUX0RF
QlVHKCJGcmVlaW5nIHRyYWNrLXJlbGF0ZWQgaW5mbyBvbiBzdHJlYW0gJXAiLCBzdHJlYW0pOwog
Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>