Bug 50631 - GeneratedImage::drawPattern() crashes when it fails to create ImageBuffer
Summary: GeneratedImage::drawPattern() crashes when it fails to create ImageBuffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-07 08:20 PST by Yong Li
Modified: 2010-12-09 11:05 PST (History)
5 users (show)

See Also:


Attachments
the patch (1.36 KB, patch)
2010-12-07 09:23 PST, Yong Li
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yong Li 2010-12-07 08:20:38 PST
void GeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
                                 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect)
{
    ...
    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(adjustedSize);
    ASSERT(imageBuffer.get());

Why do we assert here? ImageBuffer::create() is allowed to return 0:

        static PassOwnPtr<ImageBuffer> create(const IntSize& size, ImageColorSpace colorSpace = DeviceRGB)
        {
            bool success = false;
            OwnPtr<ImageBuffer> buf(new ImageBuffer(size, colorSpace, success));
            if (success)
                return buf.release();
            return 0;
        }
Comment 1 Yong Li 2010-12-07 09:23:15 PST
Created attachment 75822 [details]
the patch
Comment 2 Darin Adler 2010-12-07 09:42:22 PST
Comment on attachment 75822 [details]
the patch

I silently drawing nothing the most useful behavior? Do callers need to know nothing was drawn?
Comment 3 WebKit Review Bot 2010-12-07 10:00:48 PST
Attachment 75822 [details] did not pass style-queue:

Failed to run "[u'git', u'reset', u'--hard', u'refs/remotes/trunk']" exit_code: 128
error: Could not write new index file.
fatal: Could not reset index file to revision 'refs/remotes/trunk'.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Yong Li 2010-12-07 10:59:03 PST
(In reply to comment #2)
> (From update of attachment 75822 [details])
> I silently drawing nothing the most useful behavior? Do callers need to know nothing was drawn?

ImageBuffer::create() rarely fails currently. Probably the best solution is never let ImageBuffer::create() fail, and let it do some alternative job when it cannot create platform resource.
Comment 5 WebKit Review Bot 2010-12-07 11:01:55 PST
Attachment 75822 [details] did not pass style-queue:

Failed to run "[u'git', u'reset', u'--hard', u'refs/remotes/trunk']" exit_code: 128
error: Could not write new index file.
fatal: Could not reset index file to revision 'refs/remotes/trunk'.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 WebKit Review Bot 2010-12-07 12:03:15 PST
Attachment 75822 [details] did not pass style-queue:

Failed to run "[u'git', u'reset', u'--hard', u'refs/remotes/trunk']" exit_code: 128
error: Could not write new index file.
fatal: Could not reset index file to revision 'refs/remotes/trunk'.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 WebKit Review Bot 2010-12-07 21:41:13 PST
Attachment 75822 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/update-webkit']" exit_code: 2
Updating OpenSource
Incomplete data: Delta source ended unexpectedly at /usr/lib/git-core/git-svn line 5061

Died at WebKitTools/Scripts/update-webkit line 132.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 WebKit Commit Bot 2010-12-08 00:18:17 PST
Comment on attachment 75822 [details]
the patch

Rejecting patch 75822 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/6730115
Comment 9 WebKit Commit Bot 2010-12-09 09:32:39 PST
The commit-queue encountered the following flaky tests while processing attachment 75822 [details]:

webarchive/test-link-rel-icon.html
http/tests/loading/basic-credentials-sent-automatically.html

Please file bugs against the tests.  These tests were authored by beidson@apple.com and ddkilzer@webkit.org.  The commit-queue is continuing to process your patch.
Comment 10 WebKit Commit Bot 2010-12-09 10:27:05 PST
Comment on attachment 75822 [details]
the patch

Clearing flags on attachment: 75822

Committed r73622: <http://trac.webkit.org/changeset/73622>
Comment 11 WebKit Commit Bot 2010-12-09 10:27:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 WebKit Review Bot 2010-12-09 11:05:27 PST
http://trac.webkit.org/changeset/73622 might have broken GTK Linux 64-bit Debug