[prev in list] [next in list] [prev in thread] [next in thread] 

List:       calligra-devel
Subject:    Review Request 110593: Check for null image in drop event
From:       "Elvis Stansvik" <elvstone () gmail ! com>
Date:       2013-05-22 13:39:41
Message-ID: 20130522133941.24821.30103 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110593/
-----------------------------------------------------------

Review request for Calligra and C. Boemann.


Description
-------

When dropping this particular cat

http://www.mrwallpaper.com/wallpapers/Cat-Sad-Annoyed.jpg

which I've come to call Cat Astrophy, from Chromium 27.0.1453.93 onto \
Calligra Words, I get:

Application: Calligra Words (calligrawords), signal: Aborted
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f1591110780 (LWP 28742))]

Thread 2 (Thread 0x7f156d38f700 (LWP 28743)):
#0  0x00007f158a19909d in poll () from /usr/lib/libc.so.6
#1  0x00007f158565d134 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f158565d23c in g_main_context_iteration () from \
/usr/lib/libglib-2.0.so.0 #3  0x00007f158b0448f6 in \
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
() from /usr/lib/libQtCore.so.4 #4  0x00007f158b01696f in \
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from \
/usr/lib/libQtCore.so.4 #5  0x00007f158b016c65 in \
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from \
/usr/lib/libQtCore.so.4 #6  0x00007f158af1567f in QThread::exec() () from \
/usr/lib/libQtCore.so.4 #7  0x00007f158aff8113 in ?? () from \
/usr/lib/libQtCore.so.4 #8  0x00007f158af17d1f in ?? () from \
/usr/lib/libQtCore.so.4 #9  0x00007f158ac88dd2 in start_thread () from \
/usr/lib/libpthread.so.0 #10 0x00007f158a1a1ced in clone () from \
/usr/lib/libc.so.6

Thread 1 (Thread 0x7f1591110780 (LWP 28742)):
[KCrash Handler]
#5  0x00007f158a0f11c9 in raise () from /usr/lib/libc.so.6
#6  0x00007f158a0f25c8 in abort () from /usr/lib/libc.so.6
#7  0x00007f158af0d8df in qt_message_output(QtMsgType, char const*) () from \
/usr/lib/libQtCore.so.4 #8  0x00007f158af0da69 in ?? () from \
/usr/lib/libQtCore.so.4 #9  0x00007f158af0e274 in qFatal(char const*, ...) \
() from /usr/lib/libQtCore.so.4 #10 0x00007f1572f2d8bd in \
PictureShapeFactory::createShape (this=0x1e5d8b0, params=0x7fff51f7f660, \
documentResources=0x1e47790) at \
/home/estan/kde4/src/calligra/plugins/pictureshape/PictureShapeFactory.cpp:71
 #11 0x00007f157b1bc597 in KWView::addImages (this=0x23d1a10, \
imageList=..., insertAt=...) at \
/home/estan/kde4/src/calligra/words/part/KWView.cpp:1134 #12 \
0x00007f1590a88804 in KoView::dropEvent (this=0x23d1a10, \
event=0x7fff51f7fd20) at \
/home/estan/kde4/src/calligra/libs/main/KoView.cpp:277 #13 \
0x00007f158bf371be in QWidget::event(QEvent*) () from \
/usr/lib/libQtGui.so.4 #14 0x00007f158bee80ac in \
QApplicationPrivate::notify_helper(QObject*, QEvent*) () from \
/usr/lib/libQtGui.so.4 #15 0x00007f158beef4fe in \
QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4 #16 \
0x00007f1590a1827a in KoApplication::notify (this=0x7fff51f80470, \
receiver=0x2571c00, event=0x7fff51f7fd20) at \
/home/estan/kde4/src/calligra/libs/main/KoApplication.cpp:556 #17 \
0x00007f158b017c3d in QCoreApplication::notifyInternal(QObject*, QEvent*) \
() from /usr/lib/libQtCore.so.4 #18 0x00007f158bf6d481 in ?? () from \
/usr/lib/libQtGui.so.4 #19 0x00007f158bf519bd in \
QApplication::x11ClientMessage(QWidget*, _XEvent*, bool) () from \
/usr/lib/libQtGui.so.4 #20 0x00007f158bf5e88f in \
QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4 #21 \
0x00007f158bf84fb2 in ?? () from /usr/lib/libQtGui.so.4 #22 \
0x00007f158565ce46 in g_main_context_dispatch () from \
/usr/lib/libglib-2.0.so.0 #23 0x00007f158565d198 in ?? () from \
/usr/lib/libglib-2.0.so.0 #24 0x00007f158565d23c in \
g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #25 \
0x00007f158b0448d5 in \
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
() from /usr/lib/libQtCore.so.4 #26 0x00007f158bf85066 in ?? () from \
/usr/lib/libQtGui.so.4 #27 0x00007f158b01696f in \
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from \
/usr/lib/libQtCore.so.4 #28 0x00007f158b016c65 in \
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from \
/usr/lib/libQtCore.so.4 #29 0x00007f158b01bccb in QCoreApplication::exec() \
() from /usr/lib/libQtCore.so.4 #30 0x00007f1590d4d2f4 in kdemain (argc=1, \
argv=0x7fff51f80658) at /home/estan/kde4/src/calligra/words/app/main.cpp:43 \
#31 0x00000000004009d2 in main (argc=1, argv=0x7fff51f80658) at \
/home/estan/kde4/build/calligra/words/app/calligrawords_dummy.cpp:3

Apparently it can happen that QMimeData::hasImage() can return true, but \
QMimeData::imageData returns a null QImage. I guess this should be \
considered a Qt bug.

This fix simply introduces a check for a null image to avoid the crash. I \
guess I should investigate why Qt ends up in this state in the first place, \
but it doesn't hurt to be careful.


Diffs
-----

  libs/main/KoView.cpp c9c82e5 

Diff: http://git.reviewboard.kde.org/r/110593/diff/


Testing
-------

Dropped Cat Astrophy before and after the fix and the crash is gone.


Thanks,

Elvis Stansvik


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px \
#c9c399 solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/110593/">http://git.reviewboard.kde.org/r/110593/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px \
black solid;">  <tr>
  <td>

<div>Review request for Calligra and C. Boemann.</div>
<div>By Elvis Stansvik.</div>







<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description \
</h1>  <table width="100%" bgcolor="#ffffff" cellspacing="0" \
cellpadding="10" style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">When dropping this particular cat

http://www.mrwallpaper.com/wallpapers/Cat-Sad-Annoyed.jpg

which I&#39;ve come to call Cat Astrophy, from Chromium 27.0.1453.93 onto \
Calligra Words, I get:

Application: Calligra Words (calligrawords), signal: Aborted
Using host libthread_db library &quot;/usr/lib/libthread_db.so.1&quot;.
[Current thread is 1 (Thread 0x7f1591110780 (LWP 28742))]

Thread 2 (Thread 0x7f156d38f700 (LWP 28743)):
#0  0x00007f158a19909d in poll () from /usr/lib/libc.so.6
#1  0x00007f158565d134 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f158565d23c in g_main_context_iteration () from \
/usr/lib/libglib-2.0.so.0 #3  0x00007f158b0448f6 in \
QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) \
() from /usr/lib/libQtCore.so.4 #4  0x00007f158b01696f in \
QEventLoop::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () \
from /usr/lib/libQtCore.so.4 #5  0x00007f158b016c65 in \
QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from \
/usr/lib/libQtCore.so.4 #6  0x00007f158af1567f in QThread::exec() () from \
/usr/lib/libQtCore.so.4 #7  0x00007f158aff8113 in ?? () from \
/usr/lib/libQtCore.so.4 #8  0x00007f158af17d1f in ?? () from \
/usr/lib/libQtCore.so.4 #9  0x00007f158ac88dd2 in start_thread () from \
/usr/lib/libpthread.so.0 #10 0x00007f158a1a1ced in clone () from \
/usr/lib/libc.so.6

Thread 1 (Thread 0x7f1591110780 (LWP 28742)):
[KCrash Handler]
#5  0x00007f158a0f11c9 in raise () from /usr/lib/libc.so.6
#6  0x00007f158a0f25c8 in abort () from /usr/lib/libc.so.6
#7  0x00007f158af0d8df in qt_message_output(QtMsgType, char const*) () from \
/usr/lib/libQtCore.so.4 #8  0x00007f158af0da69 in ?? () from \
/usr/lib/libQtCore.so.4 #9  0x00007f158af0e274 in qFatal(char const*, ...) \
() from /usr/lib/libQtCore.so.4 #10 0x00007f1572f2d8bd in \
PictureShapeFactory::createShape (this=0x1e5d8b0, params=0x7fff51f7f660, \
documentResources=0x1e47790) at \
/home/estan/kde4/src/calligra/plugins/pictureshape/PictureShapeFactory.cpp:71
 #11 0x00007f157b1bc597 in KWView::addImages (this=0x23d1a10, \
imageList=..., insertAt=...) at \
/home/estan/kde4/src/calligra/words/part/KWView.cpp:1134 #12 \
0x00007f1590a88804 in KoView::dropEvent (this=0x23d1a10, \
event=0x7fff51f7fd20) at \
/home/estan/kde4/src/calligra/libs/main/KoView.cpp:277 #13 \
0x00007f158bf371be in QWidget::event(QEvent*) () from \
/usr/lib/libQtGui.so.4 #14 0x00007f158bee80ac in \
QApplicationPrivate::notify_helper(QObject*, QEvent*) () from \
/usr/lib/libQtGui.so.4 #15 0x00007f158beef4fe in \
QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4 #16 \
0x00007f1590a1827a in KoApplication::notify (this=0x7fff51f80470, \
receiver=0x2571c00, event=0x7fff51f7fd20) at \
/home/estan/kde4/src/calligra/libs/main/KoApplication.cpp:556 #17 \
0x00007f158b017c3d in QCoreApplication::notifyInternal(QObject*, QEvent*) \
() from /usr/lib/libQtCore.so.4 #18 0x00007f158bf6d481 in ?? () from \
/usr/lib/libQtGui.so.4 #19 0x00007f158bf519bd in \
QApplication::x11ClientMessage(QWidget*, _XEvent*, bool) () from \
/usr/lib/libQtGui.so.4 #20 0x00007f158bf5e88f in \
QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4 #21 \
0x00007f158bf84fb2 in ?? () from /usr/lib/libQtGui.so.4 #22 \
0x00007f158565ce46 in g_main_context_dispatch () from \
/usr/lib/libglib-2.0.so.0 #23 0x00007f158565d198 in ?? () from \
/usr/lib/libglib-2.0.so.0 #24 0x00007f158565d23c in \
g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #25 \
0x00007f158b0448d5 in \
QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) \
() from /usr/lib/libQtCore.so.4 #26 0x00007f158bf85066 in ?? () from \
/usr/lib/libQtGui.so.4 #27 0x00007f158b01696f in \
QEventLoop::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () \
from /usr/lib/libQtCore.so.4 #28 0x00007f158b016c65 in \
QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from \
/usr/lib/libQtCore.so.4 #29 0x00007f158b01bccb in QCoreApplication::exec() \
() from /usr/lib/libQtCore.so.4 #30 0x00007f1590d4d2f4 in kdemain (argc=1, \
argv=0x7fff51f80658) at /home/estan/kde4/src/calligra/words/app/main.cpp:43 \
#31 0x00000000004009d2 in main (argc=1, argv=0x7fff51f80658) at \
/home/estan/kde4/build/calligra/words/app/calligrawords_dummy.cpp:3

Apparently it can happen that QMimeData::hasImage() can return true, but \
QMimeData::imageData returns a null QImage. I guess this should be \
considered a Qt bug.

This fix simply introduces a check for a null image to avoid the crash. I \
guess I should investigate why Qt ends up in this state in the first place, \
but it doesn&#39;t hurt to be careful.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing \
</h1> <table width="100%" bgcolor="#ffffff" cellspacing="0" \
cellpadding="10" style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Dropped Cat Astrophy before and after the fix and the crash is \
gone.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
</h1> <ul style="margin-left: 3em; padding-left: 0;">

 <li>libs/main/KoView.cpp <span style="color: grey">(c9c82e5)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/110593/diff/" \
style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic