Results 1 to 15 of 15

Thread: Bizzare behavior under X (Qt 4.3.0)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Bizzare behavior under X (Qt 4.3.0)

    This is about Qt 4.3.0 running on Fedora Core 6 system with fully updated libraries (upgraded with the provided "Software Updater" utility).

    I've written a somewhat simple qt program to recieve data from another computer via TCP. This action occurs in a worker QThread. The data is passed into a global data class. The GUI reads this data and draws a graph and displays various things. I the details are likely irrelevent to my problem.

    After an arbitrary amount of time(anywhere from 15 minutes to half a day), the GUI freezes and begins spitting out the following cluster of error messages (and it will continue to do so until killed):

    X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
    Major opcode: 55 (X_CreateGC)
    Resource id: 0x10000000
    X Error: BadGC (invalid GC parameter) 13
    Major opcode: 59 (X_SetClipRectangles)
    Resource id: 0x10000000
    X Error: BadGC (invalid GC parameter) 13
    Major opcode: 56 (X_ChangeGC)
    Resource id: 0x10000000
    X Error: BadGC (invalid GC parameter) 13
    Major opcode: 62 (X_CopyArea)
    Resource id: 0x10000000
    X Error: BadGC (invalid GC parameter) 13
    Major opcode: 60 (X_FreeGC)
    Resource id: 0x10000000
    The program does not crash, so it's proven somewhat difficult to debug. I've run the program under valgrind, and this is the only error message produced:

    ==8886== Syscall param writev(vector[...]) points to uninitialised byte(s)
    ==8886== at 0x3F502C7923: writev (in /lib64/libc-2.5.so)
    ==8886== by 0x3F5164646B: (within /usr/lib64/libX11.so.6.2.0)
    ==8886== by 0x3F5164B2FE: _XSend (in /usr/lib64/libX11.so.6.2.0)
    ==8886== by 0x3F5163BE2D: (within /usr/lib64/libX11.so.6.2.0)
    ==8886== by 0x3F5163BFCA: XPutImage (in /usr/lib64/libX11.so.6.2.0)
    ==8886== by 0x4E8B25C: QPixmap::fromImage(QImage const&, QFlags<Qt::ImageConversionFlag>) (qpixmap_x11.cpp:1172)
    ==8886== by 0x4EB9BE3: QPaintEngine::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) (qpaintengine.cpp:516)
    ==8886== by 0x4F569C2: QX11PaintEngine::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) (qpaintengine_x11.cpp:1560
    )
    ==8886== by 0x4EC6725: QPainterPrivate::draw_helper(QPainterPath const&, QPainterPrivate::DrawOperation) (qpainter.cpp:233)
    ==8886== by 0x4EC8901: QPainter::drawRects(QRect const*, int) (qpainter.cpp:2660)
    ==8886== by 0x4DFD1E7: QPainter::drawRect(QRect const&) (qpainter.h:557)
    ==8886== by 0x4EC8B6B: QPainter::fillRect(QRect const&, QBrush const&) (qpainter.cpp:5302)
    ==8886== by 0x5104734: QCleanlooksStyle::drawControl(QStyle::ControlEleme nt, QStyleOption const*, QPainter*, QWidget const*) const (qcleanlooksstyle.cpp:2
    134)
    ==8886== by 0x51D8232: QMenuBar::paintEvent(QPaintEvent*) (qmenubar.cpp:928)
    ==8886== by 0x4E098FB: QWidget::event(QEvent*) (qwidget.cpp:6163)
    ==8886== by 0x51D9B3F: QMenuBar::event(QEvent*) (qmenubar.cpp:1344)
    ==8886== by 0x4DB0860: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:3538)
    ==8886== by 0x4DB26FF: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:3479)
    ==8886== by 0x5BE7F8F: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:509)
    ==8886== by 0x4DBD85A: QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (qcoreapplication.h:189)
    ==8886== by 0x4E16D46: qt_sendSpontaneousEvent(QObject*, QEvent*) (qapplication_x11.cpp:4367)
    ==8886== by 0x4F6B2DD: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int) (qbackingstore.cpp:1126)
    ==8886== by 0x4F6BB5F: QWidgetBackingStore::paintSiblingsRecursive(QPaint Device*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int) (qbacki
    ngstore.cpp:1031)
    ==8886== by 0x4F6B6A3: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int) (qbackingstore.cpp:1162)
    ==8886== by 0x4F6BFEB: QWidgetBackingStore::cleanRegion(QRegion const&, QWidget*, bool) (qbackingstore.cpp:934)
    ==8886== by 0x4F6C816: qt_syncBackingStore(QWidget*) (qbackingstore.cpp:312)
    ==8886== by 0x4E09F01: QWidget::event(QEvent*) (qwidget.cpp:6305)
    ==8886== by 0x4DB0860: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:3538)
    ==8886== by 0x4DB26FF: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:3479)
    ==8886== by 0x5BE7F8F: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:509)
    ==8886== by 0x4DAD944: QCoreApplication::sendEvent(QObject*, QEvent*) (qcoreapplication.h:186)
    ==8886== by 0x5BE8542: QCoreApplicationPrivate::sendPostedEvents(QObject* , int, QThreadData*) (qcoreapplication.cpp:1085)
    ==8886== by 0x5BE87C1: QCoreApplication::sendPostedEvents(QObject*, int) (qcoreapplication.cpp:970)
    ==8886== by 0x5C151F3: postEventSourceDispatch(_GSource*, int (*)(void*), void*) (qeventdispatcher_glib.cpp:194)
    ==8886== by 0x3F5122CF63: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.1200.9)
    ==8886== by 0x3F5122FD9C: (within /lib64/libglib-2.0.so.0.1200.9)
    ==8886== by 0x3F512302CD: g_main_context_iteration (in /lib64/libglib-2.0.so.0.1200.9)
    ==8886== by 0x5C146F9: QEventDispatcherGlib::processEvents(QFlags<QEventL oop::ProcessEventsFlag>) (qeventdispatcher_glib.cpp:325)
    ==8886== by 0x4E52F3E: QGuiEventDispatcherGlib::processEvents(QFlags<QEve ntLoop::ProcessEventsFlag>) (qguieventdispatcher_glib.cpp:178)
    ==8886== by 0x5BE4B44: QEventLoop::processEvents(QFlags<QEventLoop::Proce ssEventsFlag>) (qeventloop.cpp:126)
    ==8886== Address 0x98CB015 is 125 bytes inside a block of size 16,384 alloc'd
    ==8886== at 0x4A04BA2: calloc (vg_replace_malloc.c:279)
    ==8886== by 0x3F51637166: XOpenDisplay (in /usr/lib64/libX11.so.6.2.0)
    ==8886== by 0x4E27AE2: qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long) (qapplication_x11.cpp:1519)
    ==8886== by 0x4DB9840: QApplicationPrivate::construct(_XDisplay*, unsigned long, unsigned long) (qapplication.cpp:696)
    ==8886== by 0x4DBA983: QApplication::QApplication(int&, char**, QApplication::Type, int) (qapplication.cpp:672)
    ==8886== by 0x41107A: main (main.cpp:17)
    Might this be related to my X error?

    There are also a few reported memory leaks in places that don't make much sense to me. They're generally small things that don't grow over time, so I won't include them right now.

    I've taken the step of recompiling Qt without Xrender and Xcursor enabled, but all this seemed to do was slow the appearance of the bug. Previously it would happen ~15-60 minutes into execution, now it makes an appearance after many hours.

    So, my questions are this:
    What is resource ID 0x100000000? That sounds like a base address to me, so I'm referencing address zero within some block? What does this mean?

    Are valgrind-listed memory leaks within Qt modules something I should worry about? Might they be related to this problem?

    And, lastly, what important information have I failed to provide in this post?

    Thanks for your time.
    Last edited by jacek; 30th July 2007 at 21:48. Reason: changed [code] to [quote]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.