Unsolved RGB QImages failing to paint
-
Hello, I'm working with a QImage that originally came from a JPEG decoded to an RGB pixel-format. However, when I enter my PaintEvent function, my application crashes in
qt_convert_rgb888_to_rgb32_neon
it also crashes in
__memcpy_neon ()
My guess is that my RGB data may be incorrect, but my tests show that it appears to be okay. Of note is that I'm developing on embedded Linux (ARM).
Backtrace (qt_convert_rgb888_to_rgb32_neon):
#0 0xffffffff in qt_convert_rgb888_to_rgb32_neon(unsigned int*, unsigned char const*, int) (dst=<optimized out>, src=<optimized out>, len=<optimized out>) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/gui/image/qimage_neon.cpp:77 #1 0xffffffff in convert_RGB888_to_RGB32_neon(QImageData*, QImageData const*, QFlags<Qt::ImageConversionFlag>) (dest=0x199cc0, src=0xb2b01728) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/gui/image/qimage_neon.cpp:124 #2 0xffffffff in QImage::convertToFormat_helper(QImage::Format, QFlags<Qt::ImageConversionFlag>) const (this=this@entry=0xbefff268, format=format@entry=QImage::Format_ARGB32_Premultiplied, flags=flags@entry=...) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/gui/image/qimage.cpp:2008 #3 0xffffffff in QRasterPlatformPixmap::createPixmapForImage(QImage&, QFlags<Qt::ImageConversionFlag>, bool) (flags=..., f=QImage::Format_ARGB32_Premultiplied, this=0xbefff268) at ../../include/QtGui/../../../git/src/gui/image/qimage.h:172 #4 0xffffffff in QRasterPlatformPixmap::createPixmapForImage(QImage&, QFlags<Qt::ImageConversionFlag>, bool) (this=0x191700, sourceImage=..., flags=..., inPlace=<optimized out>) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/gui/image/qpixmap_raster.cpp:332 #5 0xffffffff in QPixmap::fromImageInPlace(QImage&, QFlags<Qt::ImageConversionFlag>) (image=..., flags=flags@entry=...) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/gui/image/qpixmap.cpp:1632 #6 0x00013858 in Display::paintEvent(QPaintEvent*) (flags=..., image=<unknown type in /home/root/videotest/videotest, CU 0x3214f, DIE 0x5ab89>) at /home/tom/sitara2/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/qt5/QtGui/qpixmap.h:130 #7 0x00013858 in Display::paintEvent(QPaintEvent*) (this=0xbefffad0, paintEvent=0xbefff4dc) at display.cpp:23 #8 0xffffffff in QWidget::event(QEvent*) (this=this@entry=0xbefffad0, event=event@entry=0xbefff4dc) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidget.cpp:8903 #9 0xffffffff in QFrame::event(QEvent*) (this=0xbefffad0, e=0xbefff4dc) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/widgets/qframe.cpp:544 #10 0xffffffff in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0xbefffad0, e=0xbefff4dc) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qapplication.cpp:3804 #11 0xffffffff in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0xbefffad0, e=0xbefff4dc) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qapplication.cpp:3561 #12 0xffffffff in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0xbefffad0, event=event@entry=0xbefff4dc) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qcoreapplication.cpp:1015 #13 0xffffffff in QWidgetPrivate::sendPaintEvent(QRegion const&) (event=0xbefff4dc, receiver=<optimized out>) at ../../include/QtCore/../../../git/src/corelib/kernel/qcoreapplication.h:228 #14 0xffffffff in QWidgetPrivate::sendPaintEvent(QRegion const&) (this=this@entry=0x152e18, toBePainted=...) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidget.cpp:5671 #15 0xffffffff in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) (this=this@entry=0x152e18, pdev=0x1acd60, rgn=..., offset=..., flags=flags@entry=37, sharedPainter=sharedPainter@entry=0x0, backingStore=backingStore@entry=0x18c9f0) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidget.cpp:5611 #16 0xffffffff in QWidgetBackingStore::doSync() (this=this@entry=0x18c9f0) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidgetbackingstore.cpp:1388 #17 0xffffffff in QWidgetBackingStore::sync() (this=0x18c9f0) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidgetbackingstore.cpp:1173 #18 0xffffffff in QWidgetPrivate::syncBackingStore() (this=0x152e18) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidget.cpp:1947 #19 0xffffffff in QWidget::event(QEvent*) (this=this@entry=0xbefffad0, event=event@entry=0x19b960) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qwidget.cpp:9056 #20 0xffffffff in QFrame::event(QEvent*) (this=0xbefffad0, e=0x19b960) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/widgets/qframe.cpp:544 #21 0xffffffff in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0xbefffad0, e=0x19b960) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qapplication.cpp:3804 #22 0xffffffff in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0xbefffad0, e=0x19b960) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qapplication.cpp:3561 #23 0xffffffff in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0xbefffad0, event=event@entry=0x19b960) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qcoreapplication.cpp:1015 #24 0xffffffff in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (event=0x19b960, receiver=<optimized out>) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qcoreapplication.h:225 #25 0xffffffff in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x142d40) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qcoreapplication.cpp:1650 #26 0xffffffff in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x150610, flags=flags@entry=...) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qeventdispatcher_unix.cpp:579 #27 0xffffffff in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/platformsupport/eventdispatchers/qunixeventdispatcher.cpp:62 #28 0xffffffff in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0xbefffa94, flags=flags@entry=...) at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qeventloop.cpp:206 #29 0xffffffff in QCoreApplication::exec() () at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/corelib/kernel/qcoreapplication.cpp:1285 #30 0xffffffff in QGuiApplication::exec() () at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/gui/kernel/qguiapplication.cpp:1607 #31 0xffffffff in QApplication::exec() () at /usr/src/debug/qtbase/5.6.2+gitAUTOINC+b4ada3f0d8-r0.arago12.tisdk2/git/src/widgets/kernel/qapplication.cpp:2979 #32 0x000133c4 in main(int, char**) (argc=78788, argv=0x0) at main.cpp:13
Backtrace (__memcpy_neon ())
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb34dd440 (LWP 1584)] __memcpy_neon () at ../sysdeps/arm/armv7/multiarch/memcpy_impl.S:747 747 ../sysdeps/arm/armv7/multiarch/memcpy_impl.S: No such file or directory. (gdb) bt #0 0xffffffff in __memcpy_neon () at ../sysdeps/arm/armv7/multiarch/memcpy_impl.S:747 #1 0xffffffff in gst_vpe_buffer_pool_dequeue (pool=0xb21031a0 [GstVpeBufferPool]) at gstvpebufferpool.c:281 #2 0xffffffff in gst_vpe_dequeue_loop (data=0x170040) at gstvpe.c:504 #3 0xffffffff in gst_task_func (task=0x182028 [GstTask]) at ../../gstreamer-1.6.3/gst/gsttask.c:331 #4 0xffffffff in g_thread_pool_thread_proxy (data=<optimized out>) at ../../glib-2.46.2/glib/gthreadpool.c:307 #5 0xffffffff in g_thread_proxy (data=0xb24f0) at ../../glib-2.46.2/glib/gthread.c:778 #6 0xffffffff in start_thread (arg=0x1) at pthread_create.c:335 #7 0xffffffff in () at ../sysdeps/unix/sysv/linux/arm/clone.S:89
-
Perhaps your tests fail to detect the situation and it is one of the cases where memory is all well and good during testing but fails in "real" execution. I would double check that the image's pixel buffer is well at all phases of its life and make deep copy of the image earlier to make sure of it (yourImage.copy()).
-
Further testing with some standalone gstreamer tools (which is what I'm using for these buffers/decoding the image) is that the buffers may indeed be dereferencing incorrectly, rather than the data being incorrect.