<?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>73351</bug_id>
          
          <creation_ts>2011-11-29 12:43:42 -0800</creation_ts>
          <short_desc>[Chromium] ASSERT fails in updateState ACTION_DRAW case</short_desc>
          <delta_ts>2011-12-02 22:47:57 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Android</rep_platform>
          <op_sys>Android</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="Armand">armand.navabi</reporter>
          <assigned_to name="Armand">armand.navabi</assigned_to>
          <cc>cc-bugs</cc>
    
    <cc>darin</cc>
    
    <cc>dglazkov</cc>
    
    <cc>jamesr</cc>
    
    <cc>nduca</cc>
    
    <cc>shanestephens</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>511018</commentid>
    <comment_count>0</comment_count>
    <who name="Armand">armand.navabi</who>
    <bug_when>2011-11-29 12:43:42 -0800</bug_when>
    <thetext>The ASSERT in case ACTION_DRAW of CCSchedulerStateMachine::updateState(Action action) fails.

A potential fix is to change the assert to ASSERT(m_needsCommit || !m_visible).  The issue arises because updateState is being called right after m_needsCommit has been set to true and m_visible has been set to false.  This will set m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW in the ACTION_COMMIT case.  Then on the draw action the assert is triggered and fails because it asserts only that m_needsCommit is true.

Other solutions may be that m_needsCommit should not be set to true, m_visible may be incorrectly being set to false or m_needsForcedRedraw should not be set.  The main question is what should the ASSERT statement be asserting in the ACTION_DRAW case of updateState.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>511460</commentid>
    <comment_count>1</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-11-30 00:23:59 -0800</bug_when>
    <thetext>Are you talking about this assertion:

    case ACTION_DRAW:
        m_needsRedraw = false;
        m_needsForcedRedraw = false;
        if (m_insideVSync)
            m_lastFrameNumberWhereDrawWasCalled = m_currentFrameNumber;
        if (m_commitState == COMMIT_STATE_WAITING_FOR_FIRST_DRAW) {
            ASSERT(m_needsCommit); &lt;----here
            m_commitState = COMMIT_STATE_IDLE;
        }
        return;

?

If so I&apos;m not sure how we are hitting this in the scenario you describe - if m_needsCommit is true then that assertion shouldn&apos;t fire.  Or are you referring to a different assertion?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>511756</commentid>
    <comment_count>2</comment_count>
    <who name="Nat Duca">nduca</who>
    <bug_when>2011-11-30 08:12:03 -0800</bug_when>
    <thetext>Armand, are you planning on putting up your patch, or is your expectation that someone else fixes this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>511927</commentid>
    <comment_count>3</comment_count>
    <who name="Armand">armand.navabi</who>
    <bug_when>2011-11-30 11:17:43 -0800</bug_when>
    <thetext>Yes that is the failing ASSERT.  I&apos;m sorry, my initial report had a typo.  

The state we get into is one in which m_needsCommit is *false* and m_visible is *false*.  In such a state, ACTION_COMMIT in updateState will set m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_TO_DRAW (since !m_visible is true).

Then, an ACTION_DRAW happens where m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_TO_DRAW and m_needsCommit is false (and m_visible is false).  Here the assertion fails.

Nat: I was not planning on putting up my patch because I am not confident it is the correct solution.  The patch I had was to change the assertion to ASSERT(m_needsCommit || !m_visible) in ACTION_DRAW.  While this would solve this particular failure, I am not familiar enough with this code to know if this is correct.

One question is, should ACTION_DRAW even be triggered when m_visible is false?  If not, then the assertion in question is not the problem, but the problem is that ACTION_DRAW is being called even though m_visible is false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>511968</commentid>
    <comment_count>4</comment_count>
    <who name="Armand">armand.navabi</who>
    <bug_when>2011-11-30 11:42:24 -0800</bug_when>
    <thetext>Yes that is the failing ASSERT.  I&apos;m sorry, my initial report had a typo.  

The state we get into is one in which m_needsCommit is *false* and m_visible is *false*.  In such a state, ACTION_COMMIT in updateState will set m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_TO_DRAW (since !m_visible is true).

Then, an ACTION_DRAW happens where m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_TO_DRAW and m_needsCommit is false (and m_visible is false).  Here the assertion fails.

Nat: I was not planning on putting up my patch because I am not confident it is the correct solution.  The patch I had was to change the assertion to ASSERT(m_needsCommit || !m_visible) in ACTION_DRAW.  While this would solve this particular failure, I am not familiar enough with this code to know if this is correct.

One question is, should ACTION_DRAW even be triggered when m_visible is false?  If not, then the assertion in question is not the problem, but the problem is that ACTION_DRAW is being called even though m_visible is false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>512198</commentid>
    <comment_count>5</comment_count>
    <who name="Nat Duca">nduca</who>
    <bug_when>2011-11-30 15:54:58 -0800</bug_when>
    <thetext>I liked your original patch, I think you were correct. I suggest putting it up here. I&apos;ll double check it, but in general, I think its good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>512349</commentid>
    <comment_count>6</comment_count>
    <who name="Shane Stephens">shanestephens</who>
    <bug_when>2011-11-30 19:14:31 -0800</bug_when>
    <thetext>Armand, I&apos;ve tentatively assigned this bug to you as you have a proposed fix for the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>513882</commentid>
    <comment_count>7</comment_count>
    <who name="Armand">armand.navabi</who>
    <bug_when>2011-12-02 10:07:02 -0800</bug_when>
    <thetext>Great.  I will submit my patch for this.  I&apos;ll try to get to it soon (next couple days).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514295</commentid>
    <comment_count>8</comment_count>
      <attachid>117716</attachid>
    <who name="Armand">armand.navabi</who>
    <bug_when>2011-12-02 17:27:56 -0800</bug_when>
    <thetext>Created attachment 117716
Text file of patch (ChangeLog and diff)

First patch I am submitting.  This is for the following bug:
https://bugs.webkit.org/show_bug.cgi?id=73351

Please let me know if I took the correct steps for future patches I submit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514303</commentid>
    <comment_count>9</comment_count>
      <attachid>117716</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-12-02 17:42:24 -0800</bug_when>
    <thetext>Comment on attachment 117716
Text file of patch (ChangeLog and diff)

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

&gt; Source/WebCore/ChangeLog:10
&gt; +	Changed ASSERT in CCSchedulerStateMachine to include ( || !m_visible) as discussed in bug 
&gt; +	report. m_commitState is set to COMMIT_STATE_WAITING_FOR_FIRST_DRAW if m_needsCommit or
&gt; +	!m_visible, so in ACTION_DRAW the assert should have both conditions.

the intendentation here is off - see other entries in this file</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514326</commentid>
    <comment_count>10</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-12-02 18:05:10 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; Created an attachment (id=117716) [details]
&gt; Text file of patch (ChangeLog and diff)
&gt; 
&gt; First patch I am submitting.  This is for the following bug:
&gt; https://bugs.webkit.org/show_bug.cgi?id=73351
&gt; 
&gt; Please let me know if I took the correct steps for future patches I submit.

I left one comment inline. Also, new patches should have the &quot;review?&quot; flag set.  &quot;webkit-patch upload&quot; should take care of that automatically.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514333</commentid>
    <comment_count>11</comment_count>
      <attachid>117724</attachid>
    <who name="Armand">armand.navabi</who>
    <bug_when>2011-12-02 18:14:59 -0800</bug_when>
    <thetext>Created attachment 117724
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514341</commentid>
    <comment_count>12</comment_count>
      <attachid>117724</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-12-02 18:19:48 -0800</bug_when>
    <thetext>Comment on attachment 117724
Patch

Great! That&apos;s perfect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514370</commentid>
    <comment_count>13</comment_count>
      <attachid>117724</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-02 19:09:37 -0800</bug_when>
    <thetext>Comment on attachment 117724
Patch

Attachment 117724 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10695457

New failing tests:
svg/custom/linking-uri-01-b.svg</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514376</commentid>
    <comment_count>14</comment_count>
      <attachid>117724</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-12-02 19:19:08 -0800</bug_when>
    <thetext>Comment on attachment 117724
Patch

Flake, let&apos;s try again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514432</commentid>
    <comment_count>15</comment_count>
      <attachid>117724</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-02 22:47:51 -0800</bug_when>
    <thetext>Comment on attachment 117724
Patch

Clearing flags on attachment: 117724

Committed r101911: &lt;http://trac.webkit.org/changeset/101911&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>514433</commentid>
    <comment_count>16</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-02 22:47:57 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>117716</attachid>
            <date>2011-12-02 17:27:56 -0800</date>
            <delta_ts>2011-12-02 18:14:55 -0800</delta_ts>
            <desc>Text file of patch (ChangeLog and diff)</desc>
            <filename>bug73351.patch</filename>
            <type>text/plain</type>
            <size>1627</size>
            <attacher name="Armand">armand.navabi</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEwMTg3MSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE3IEBACisyMDExLTEyLTAyICBBcm1hbmQg
TmF2YWJpICA8YXJtYW5kLm5hdmFiaUBnbWFpbC5jb20+CisKKyAgICAgICAgQVNTRVJUIGZhaWxz
IGluIHVwZGF0ZVN0YXRlIEFDVElPTl9EUkFXIGNhc2UKKyAgICAgICAgaHR0cHM6Ly9idWdzLndl
YmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTczMzUxCisJCisgICAgICAgIFJldmlld2VkIGJ5IE5P
Qk9EWSAoT09QUyEpLgorCisJQ2hhbmdlZCBBU1NFUlQgaW4gQ0NTY2hlZHVsZXJTdGF0ZU1hY2hp
bmUgdG8gaW5jbHVkZSAoIHx8ICFtX3Zpc2libGUpIGFzIGRpc2N1c3NlZCBpbiBidWcgCisJcmVw
b3J0LiBtX2NvbW1pdFN0YXRlIGlzIHNldCB0byBDT01NSVRfU1RBVEVfV0FJVElOR19GT1JfRklS
U1RfRFJBVyBpZiBtX25lZWRzQ29tbWl0IG9yCisJIW1fdmlzaWJsZSwgc28gaW4gQUNUSU9OX0RS
QVcgdGhlIGFzc2VydCBzaG91bGQgaGF2ZSBib3RoIGNvbmRpdGlvbnMuCisKKyAgICAgICAgKiBw
bGF0Zm9ybS9ncmFwaGljcy9jaHJvbW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FUlQobV9uZWVkc0NvbW1pdCB8fCAh
bV92aXNpYmxlKTsKICAgICAgICAgICAgIG1fY29tbWl0U3RhdGUgPSBDT01NSVRfU1RBVEVfSURM
RTsKICAgICAgICAgfQogICAgICAgICByZXR1cm47Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>117724</attachid>
            <date>2011-12-02 18:14:59 -0800</date>
            <delta_ts>2011-12-02 22:47:51 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-73351-20111202181458.patch</filename>
            <type>text/plain</type>
            <size>1647</size>
            <attacher name="Armand">armand.navabi</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEwMTg3MSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE3IEBACisyMDExLTEyLTAyICBBcm1hbmQg
TmF2YWJpICA8YXJtYW5kLm5hdmFiaUBnbWFpbC5jb20+CisKKyAgICAgICAgQVNTRVJUIGZhaWxz
IGluIHVwZGF0ZVN0YXRlIEFDVElPTl9EUkFXIGNhc2UKKyAgICAgICAgaHR0cHM6Ly9idWdzLndl
YmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTczMzUxCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9C
T0RZIChPT1BTISkuCisKKyAgICAgICAgQ2hhbmdlZCBBU1NFUlQgaW4gQ0NTY2hlZHVsZXJTdGF0
ZU1hY2hpbmUgdG8gaW5jbHVkZSAoIHx8ICFtX3Zpc2libGUpIGFzIGRpc2N1c3NlZCBpbiBidWcg
CisgICAgICAgIHJlcG9ydC4gbV9jb21taXRT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2lkZVZTeW5jKQogICAgICAgICAgICAgbV9sYXN0RnJhbWVO
dW1iZXJXaGVyZURyYXdXYXNDYWxsZWQgPSBtX2N1cnJlbnRGcmFtZU51bWJlcjsKICAgICAgICAg
aWYgKG1fY29tbWl0U3RhdGUgPT0gQ09NTUlUX1NUQVRFX1dBSVRJTkdfRk9SX0ZJUlNUX0RSQVcp
IHsKLSAgICAgICAgICAgIEFTU0VSVChtX25lZWRzQ29tbWl0KTsKKyAgICAgICAgICAgIEFTU0VS
VChtX25lZWRzQ29tbWl0IHx8ICFtX3Zpc2libGUpOwogICAgICAgICAgICAgbV9jb21taXRTdGF0
ZSA9IENPTU1JVF9TVEFURV9JRExFOwogICAgICAgICB9CiAgICAgICAgIHJldHVybjsK
</data>

          </attachment>
      

    </bug>

</bugzilla>