<?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>48707</bug_id>
          
          <creation_ts>2010-10-29 19:37:03 -0700</creation_ts>
          <short_desc>[Qt][WK2] Crash in drawUpdateChunkIntoBackingStore</short_desc>
          <delta_ts>2010-10-30 07:50:12 -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>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Kling">kling</reporter>
          <assigned_to name="QtWebKit Unassigned">webkit-qt-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>302237</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-10-29 19:37:03 -0700</bug_when>
    <thetext>UpdateChunk images should be created using the QImage constructor that takes a bytesPerLine value, or the data length won&apos;t match UpdateChunk::size().

Crashiness is easily reproduced by manually resizing MiniBrowser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302238</commentid>
    <comment_count>1</comment_count>
      <attachid>72429</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-10-29 19:37:47 -0700</bug_when>
    <thetext>Created attachment 72429
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302239</commentid>
    <comment_count>2</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-10-29 19:40:12 -0700</bug_when>
    <thetext>Valgrind stack from such a crash (Invalid read of size 1):

memcpy (mc_replace_strmem.c:497)
qt_blend_rgb32_on_rgb32(unsigned char*, int, unsigned char const*, int, int, int, int) (string3.h:52)
QRasterPaintEngine::drawImage(QPointF const&amp;, QImage const&amp;) (qpaintengine_raster.cpp:2490)
QPainter::drawImage(QPointF const&amp;, QImage const&amp;) (qpainter.cpp:5618)
WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore(WebKit::UpdateChunk*) (qpainter.h:923)
WebKit::ChunkedUpdateDrawingAreaProxy::didSetSize(WebKit::UpdateChunk*) (ChunkedUpdateDrawingAreaProxy.cpp:130)
WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) (ChunkedUpdateDrawingAreaProxy.cpp:168)
WebKit::ChunkedUpdateDrawingAreaProxy::paint(WebCore::IntRect const&amp;, QPainter*) (ChunkedUpdateDrawingAreaProxy.cpp:70)
QWKPagePrivate::paint(QPainter*, QRect) (qwkpage.cpp:149)
_q_paintItem(QGraphicsItem*, QPainter*, QStyleOptionGraphicsItem const*, QWidget*, bool, bool) (qgraphicsscene.cpp:4314)
QGraphicsScenePrivate::drawItemHelper(QGraphicsItem*, QPainter*, QStyleOptionGraphicsItem const*, QWidget*, bool) (qgraphicsscene.cpp:4427)
QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, double, QTransform const*, bool, bool) (qgraphicsscene.cpp:4962)
QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, double, QTransform const*) (qgraphicsscene.cpp:4853)
QGraphicsScenePrivate::drawItems(QPainter*, QTransform const*, QRegion*, QWidget*) (qgraphicsscene.cpp:4735)
QGraphicsView::paintEvent(QPaintEvent*) (qgraphicsview.cpp:3472)
QWidget::event(QEvent*) (qwidget.cpp:8407)
QFrame::event(QEvent*) (qframe.cpp:557)
QGraphicsView::viewportEvent(QEvent*) (qgraphicsview.cpp:2867)
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (qcoreapplication.cpp:870)
QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4443)
QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4326)
QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:760)
QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&amp;, QPoint const&amp;, int, QPainter*, QWidgetBackingStore*) (qcoreapplication.h:234)
QWidgetBackingStore::sync() (qbackingstore.cpp:1325)
QWidgetPrivate::syncBackingStore() (qwidget.cpp:1842)
QWidget::event(QEvent*) (qwidget.cpp:8554)
QMainWindow::event(QEvent*) (qmainwindow.cpp:1480)
QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4447)
QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4326)
QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:760)
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (qcoreapplication.h:231)
QGraphicsScenePrivate::_q_processDirtyItems() (qgraphicsview_p.h:200)
QGraphicsScene::qt_metacall(QMetaObject::Call, int, void**) (moc_qgraphicsscene.cpp:130)
QObject::event(QEvent*) (qobject.cpp:1192)
QGraphicsScene::event(QEvent*) (qgraphicsscene.cpp:3545)
QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4447)
QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4326)
QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:760)
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (qcoreapplication.h:231)
postEventSourceDispatch(_GSource*, int (*)(void*), void*) (qcoreapplication.h:236)
g_main_context_dispatch (in /lib/libglib-2.0.so.0.2600.0)
??? (in /lib/libglib-2.0.so.0.2600.0)
g_main_context_iteration (in /lib/libglib-2.0.so.0.2600.0)
QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (qeventdispatcher_glib.cpp:417)
QGuiEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (qguieventdispatcher_glib.cpp:204)
QEventLoop::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (qeventloop.cpp:149)
QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (qeventloop.cpp:201)
QCoreApplication::exec() (qcoreapplication.cpp:1032)
main (main.cpp:53)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302267</commentid>
    <comment_count>3</comment_count>
      <attachid>72429</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-10-30 00:53:36 -0700</bug_when>
    <thetext>Comment on attachment 72429
Proposed patch

What size does it get by default?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302283</commentid>
    <comment_count>4</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-10-30 04:20:27 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; What size does it get by default?

It would allocate width * height * 4 bytes, (UpdateChunk::size() returns this) but the default QImage ctor will prefer making every scanline 32-bit aligned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302305</commentid>
    <comment_count>5</comment_count>
      <attachid>72429</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-10-30 07:50:03 -0700</bug_when>
    <thetext>Comment on attachment 72429
Proposed patch

Clearing flags on attachment: 72429

Committed r70981: &lt;http://trac.webkit.org/changeset/70981&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302306</commentid>
    <comment_count>6</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-10-30 07:50:12 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>72429</attachid>
            <date>2010-10-29 19:37:47 -0700</date>
            <delta_ts>2010-10-30 07:50:03 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>bug-48707.diff</filename>
            <type>text/plain</type>
            <size>1280</size>
            <attacher name="Andreas Kling">kling</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdDIvQ2hhbmdlTG9nIGIvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXgg
ZTUzMDVlNy4uYjMyNTQwNSAxMDA2NDQKLS0tIGEvV2ViS2l0Mi9DaGFuZ2VMb2cKKysrIGIvV2Vi
S2l0Mi9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNyBAQAorMjAxMC0xMC0yOSAgQW5kcmVhcyBLbGlu
ZyAgPGtsaW5nQHdlYmtpdC5vcmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BT
ISkuCisKKyAgICAgICAgW1F0XVtXSzJdIENyYXNoIGluIGRyYXdVcGRhdGVDaHVua0ludG9CYWNr
aW5nU3RvcmUKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lk
PTQ4NzA3CisKKyAgICAgICAgVXBkYXRlQ2h1bmsgaW1hZ2VzIGhhdmUgdG8gYmUgY3JlYXRlZCB1
c2luZyB0aGUgUUltYWdlIGNvbnN0cnVjdG9yCisgICAgICAgIHRoYXQgdGFrZXMgYSBieXRlc1Bl
ckxpbmUgKHN0cmlkZSkgdmFsdWUsIG9yIHRoZSBkYXRhIGxlbmd0aCB3b24ndAorICAgICAgICBt
YXRjaCBVcGRhdGVDaHVuazo6c2l6ZSgpLgorCisgICAgICAgICogU2hhcmVkL3F0L1VwZGF0ZUNo
dW5rLmNwcDoKKyAgICAgICAgKF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