Bug 50341 - Progressbar rendering crash
Summary: Progressbar rendering crash
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL: http://crbug.com/57706
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-12-01 12:00 PST by Sadrul Habib Chowdhury
Modified: 2010-12-09 21:44 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.75 KB, patch)
2010-12-01 12:00 PST, Sadrul Habib Chowdhury
no flags Details | Formatted Diff | Diff
Fixed the style. (1.75 KB, patch)
2010-12-02 09:33 PST, Sadrul Habib Chowdhury
eric: review-
Details | Formatted Diff | Diff
Updated patch to use std::max. Add a layouttest (3.70 KB, patch)
2010-12-04 16:08 PST, Sadrul Habib Chowdhury
no flags Details | Formatted Diff | Diff
Address reviews (3.85 KB, patch)
2010-12-08 07:19 PST, Sadrul Habib Chowdhury
tkent: review-
Details | Formatted Diff | Diff
comments and changelog (4.04 KB, patch)
2010-12-08 16:57 PST, Sadrul Habib Chowdhury
commit-queue: commit-queue-
Details | Formatted Diff | Diff
updated (4.04 KB, patch)
2010-12-08 22:08 PST, Sadrul Habib Chowdhury
tkent: review-
Details | Formatted Diff | Diff
updated (3.95 KB, patch)
2010-12-08 22:37 PST, Sadrul Habib Chowdhury
tkent: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff
blank lines (3.96 KB, patch)
2010-12-09 10:55 PST, Sadrul Habib Chowdhury
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sadrul Habib Chowdhury 2010-12-01 12:00:57 PST
Created attachment 75299 [details]
Patch

The bug report against chrome: http://crbug.com/57706
Comment 1 Lucas Forschler 2010-12-01 17:08:39 PST
<rdar://problem/8718962>
Comment 2 Abhishek Arya 2010-12-02 09:01:18 PST
This is not security. Null ptr crashes are not security bugs. We dont have security labels on the chromium bug either.
Comment 3 WebKit Review Bot 2010-12-02 09:03:36 PST
Attachment 75299 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'WebCore/ChangeLog', u'WebCore/rendering/RenderThemeChromiumSkia.cpp']" exit_code: 1
WebCore/rendering/RenderThemeChromiumSkia.cpp:844:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Sadrul Habib Chowdhury 2010-12-02 09:33:40 PST
Created attachment 75387 [details]
Fixed the style.
Comment 5 Eric Seidel (no email) 2010-12-03 10:27:13 PST
Comment on attachment 75299 [details]
Patch

You can use webkit-patch upload to uplaod patches and it will automatically obsolete previous patches for you.
Comment 6 Eric Seidel (no email) 2010-12-03 10:28:29 PST
Comment on attachment 75387 [details]
Fixed the style.

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

> WebCore/ChangeLog:13
> +        No new tests. (OOPS!)

This will block the commit-queue.  Is this not testable?  Please replace this line with a description of what tests this affects.

> WebCore/rendering/RenderThemeChromiumSkia.cpp:844
> +        if (width < 1)

It seems like you just want std::min here.
Comment 7 Eric Seidel (no email) 2010-12-03 10:28:41 PST
std::max I mean.
Comment 8 Sadrul Habib Chowdhury 2010-12-04 16:08:10 PST
Created attachment 75619 [details]
Updated patch to use std::max. Add a layouttest

PS: I am still figuring out how to use webkit-patch with non-sequential series of commits. So for now, I am uploading the patch manually.
Comment 9 Hajime Morrita 2010-12-07 20:18:11 PST
Comment on attachment 75619 [details]
Updated patch to use std::max. Add a layouttest

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

Sadrul, thank you for the fix.

> WebCore/rendering/RenderThemeChromiumSkia.cpp:-843
> -        IntSize valueTileSize(static_cast<int>(valueImage->width() * tileScale), valueRect.height());

How about to move this computation out of if() and add the "0 < valueTileSize.width()" to that if's condition ?
It looks basically the same kind of  check.
Comment 10 Sadrul Habib Chowdhury 2010-12-07 20:28:36 PST
Comment on attachment 75619 [details]
Updated patch to use std::max. Add a layouttest

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

>> WebCore/rendering/RenderThemeChromiumSkia.cpp:-843
>> -        IntSize valueTileSize(static_cast<int>(valueImage->width() * tileScale), valueRect.height());
> 
> How about to move this computation out of if() and add the "0 < valueTileSize.width()" to that if's condition ?
> It looks basically the same kind of  check.

Using it as a condition for this block of code ends up not showing anything at all for the progress-bar. Using a lower-bound value of 1 for the width at least shows a very tiny progress bar. I think that's better?
Comment 11 Kent Tamura 2010-12-07 20:47:21 PST
Comment on attachment 75619 [details]
Updated patch to use std::max. Add a layouttest

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

> LayoutTests/ChangeLog:6
> +        Layouttest for progress element crash with style.
> +        http://crbug.com/57706

You should put the WebKit bug URL.

> LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash.html:13
> +    window.setTimeout(function() {
> +          if (window.layoutTestController)
> +              layoutTestController.notifyDone();
> +    }, 1000);

Do we really need this 1000 msec delay?  It mean this test takes at least 1000 msec.

> WebCore/ChangeLog:5
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Adjust the width of the tile to be non-zero.

You should put a 1-line summary of the bug and the WebKit bug URL.  See other ChangeLog entries.
Comment 12 Sadrul Habib Chowdhury 2010-12-08 07:18:57 PST
Comment on attachment 75619 [details]
Updated patch to use std::max. Add a layouttest

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

Thanks for reviews :)

>> LayoutTests/ChangeLog:6
>> +        http://crbug.com/57706
> 
> You should put the WebKit bug URL.

Done.

>> LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash.html:13
>> +    }, 1000);
> 
> Do we really need this 1000 msec delay?  It mean this test takes at least 1000 msec.

A timeout is necessary to trigger the crash. I have reduced the timeout to 10 msec (it reliably reproduces the crash for me so the fix can be verified).

>> WebCore/ChangeLog:5
>> +        Adjust the width of the tile to be non-zero.
> 
> You should put a 1-line summary of the bug and the WebKit bug URL.  See other ChangeLog entries.

Done.
Comment 13 Sadrul Habib Chowdhury 2010-12-08 07:19:49 PST
Created attachment 75900 [details]
Address reviews

Addressed the comments and updated the patch.
Comment 14 Kent Tamura 2010-12-08 15:57:40 PST
Comment on attachment 75900 [details]
Address reviews

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

> LayoutTests/ChangeLog:8
> +        The scaled tile width can be very small at times (e.g. with 'style: font 1
> +        required'). So use a minimum width of 1 instead of using 0 (which leads to a
> +        crash).
> +        https://bugs.webkit.org/show_bug.cgi?id=50341

Please make this synchronized with WebCore/ChangeLog

> LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash.html:13
> +    window.setTimeout(function() {
> +          if (window.layoutTestController)
> +              layoutTestController.notifyDone();
> +    }, 10);

Would you add a comment about the reason of setTimeout()?
Comment 15 Sadrul Habib Chowdhury 2010-12-08 16:46:38 PST
Regarding the comment for setTimeout, should I add the comment in the test-file, or here as a comment?
Comment 16 Kent Tamura 2010-12-08 16:47:57 PST
(In reply to comment #15)
> Regarding the comment for setTimeout, should I add the comment in the test-file, or here as a comment?

Please add a comment to progress-element-with-style-crash.html.
Comment 17 Sadrul Habib Chowdhury 2010-12-08 16:57:32 PST
Created attachment 75986 [details]
comments and changelog

Done. Thanks for reviewing.
Comment 18 Kent Tamura 2010-12-08 16:59:32 PST
Comment on attachment 75986 [details]
comments and changelog

ok
Comment 19 WebKit Commit Bot 2010-12-08 20:51:34 PST
The commit-queue encountered the following flaky tests while processing attachment 75986 [details]:

java/lc3/JSObject/ToObject-001.html

Please file bugs against the tests.  These tests were authored by ap@webkit.org.  The commit-queue is continuing to process your patch.
Comment 20 WebKit Commit Bot 2010-12-08 21:33:34 PST
Comment on attachment 75986 [details]
comments and changelog

Rejecting patch 75986 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']" exit_code: 2
Last 500 characters of output:
sts/websocket/tests/workers ......
http/tests/workers .....
http/tests/xhtmlmp .
http/tests/xmlhttprequest ............................................................................................................................................................................
http/tests/xmlhttprequest/web-apps ...............
http/tests/xmlhttprequest/workers .........
642.79s total testing time

22152 test cases (99%) succeeded
1 test case (<1%) was new
12 test cases (<1%) had stderr output

Full output: http://queues.webkit.org/results/6980001
Comment 21 Kent Tamura 2010-12-08 21:41:23 PST
Comment on attachment 75986 [details]
comments and changelog

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

> LayoutTests/ChangeLog:13
> +        * platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt: Added.

This is platform-independent.  It should be put to LayoutTests/fast/dom/HTMLProgressElement/.

> LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash.html:20
> +  <h1>Test for <a href="https://crbug.com/57706">Chromium bug 57706</a>. It is not OK to crash.</h1>

Do not have a link to crbug.com.  It should be a link to bugs.webkit.org.
Comment 22 Sadrul Habib Chowdhury 2010-12-08 22:07:51 PST
Comment on attachment 75986 [details]
comments and changelog

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

>> LayoutTests/ChangeLog:13
>> +        * platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt: Added.
> 
> This is platform-independent.  It should be put to LayoutTests/fast/dom/HTMLProgressElement/.

Done.

>> LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash.html:20
>> +  <h1>Test for <a href="https://crbug.com/57706">Chromium bug 57706</a>. It is not OK to crash.</h1>
> 
> Do not have a link to crbug.com.  It should be a link to bugs.webkit.org.

Done.
Comment 23 Sadrul Habib Chowdhury 2010-12-08 22:08:21 PST
Created attachment 76014 [details]
updated
Comment 24 Kent Tamura 2010-12-08 22:13:31 PST
Comment on attachment 76014 [details]
updated

I found no changes since the previous patch.
Comment 25 Sadrul Habib Chowdhury 2010-12-08 22:37:10 PST
Created attachment 76015 [details]
updated

My bad. Sorry about that. Uploading the correct patch.
Comment 26 Kent Tamura 2010-12-08 22:38:21 PST
Comment on attachment 76015 [details]
updated

ok
Comment 27 WebKit Commit Bot 2010-12-09 01:46:05 PST
The commit-queue encountered the following flaky tests while processing attachment 76015 [details]:

accessibility/aria-activedescendant-crash.html
fast/dom/HTMLProgressElement/progress-element-with-style-crash.html

Please file bugs against the tests.  These tests were authored by adele@apple.com and cfleizach@apple.com.  The commit-queue is continuing to process your patch.
Comment 28 WebKit Commit Bot 2010-12-09 04:38:36 PST
Comment on attachment 76015 [details]
updated

Rejecting patch 76015 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']" exit_code: 2
Last 500 characters of output:
t ...
fast/dom/HTMLMetaElement .
fast/dom/HTMLMeterElement ............
fast/dom/HTMLObjectElement ....
fast/dom/HTMLObjectElement/form .
fast/dom/HTMLOptionElement ....
fast/dom/HTMLOutputElement .....
fast/dom/HTMLProgressElement ....
fast/dom/HTMLProgressElement/progress-element-with-style-crash.html -> failed

Exiting early after 1 failures. 7241 tests run.
191.46s total testing time

7240 test cases (99%) succeeded
1 test case (<1%) had incorrect layout
3 test cases (<1%) had stderr output

Full output: http://queues.webkit.org/results/6948007
Comment 29 Kent Tamura 2010-12-09 05:33:31 PST
(In reply to comment #28)
> fast/dom/HTMLProgressElement/progress-element-with-style-crash.html -> failed

I tried the test locally on SnowLeopard.  The result diff:

--- /tmp/layout-test-results/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt	2010-12-09 22:31:19.000000000 +0900
+++ /tmp/layout-test-results/fast/dom/HTMLProgressElement/progress-element-with-style-crash-actual.txt	2010-12-09 22:31:19.000000000 +0900
@@ -1 +1,3 @@
 Test for Bug 50341. It is not OK to crash.
+
+
Comment 30 Sadrul Habib Chowdhury 2010-12-09 10:55:38 PST
Created attachment 76095 [details]
blank lines

Added the blank lines at the end in the expected file.
Comment 31 Kent Tamura 2010-12-09 15:49:43 PST
Comment on attachment 76095 [details]
blank lines

ok.
But how did you make the expected results in the prior patches?
Comment 32 Sadrul Habib Chowdhury 2010-12-09 15:54:03 PST
I created the expected results manually. Strangely enough, the tests pass for me with and without the blank lines at the end.
Comment 33 Sadrul Habib Chowdhury 2010-12-09 15:54:22 PST
(On linux, I do not know if that may be relevant)
Comment 34 WebKit Commit Bot 2010-12-09 20:58:00 PST
Comment on attachment 76095 [details]
blank lines

Rejecting patch 76095 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'build', '--no-clean', '--no-update', '--build-style=both']" exit_code: 1
ERROR: Working directory has local commits, pass --force-clean to continue.

Full output: http://queues.webkit.org/results/6972022
Comment 35 Eric Seidel (no email) 2010-12-09 21:05:10 PST
Comment on attachment 76095 [details]
blank lines

bug 50766  hopefully fixed this cq error.
Comment 36 WebKit Commit Bot 2010-12-09 21:44:46 PST
Comment on attachment 76095 [details]
blank lines

Clearing flags on attachment: 76095

Committed r73685: <http://trac.webkit.org/changeset/73685>
Comment 37 WebKit Commit Bot 2010-12-09 21:44:54 PST
All reviewed patches have been landed.  Closing bug.