Results 1 to 3 of 3

Thread: probleme in multithreading and xcb in a Qt application

  1. #1
    Join Date
    Feb 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default probleme in multithreading and xcb in a Qt application

    i have trouble to run my application
    where i have a MainWindow to display pictures
    i have 2 threads : one to get the pictures and the other to display it
    i display the pictures using a QPainter object and the methode drawimage()
    when running, i have this error message:
    Qt Code:
    1. xcb_lock.c*:33*:*_XCBUnlockDisplay: assertion «*xcb_get_request_sent(dpy->xcb->connection) == dpy->request*» failed.
    To copy to clipboard, switch view to plain text mode 
    the backtrace of the main thread and the thread dispalying pictures are the following:

    Qt Code:
    1. Thread 1 (Thread 0xb6cc46d0 (LWP 11980)):
    2. #0 0xffffe430 in __kernel_vsyscall ()
    3. #1 0xb6d4f900 in raise () from /lib/libc.so.6
    4. #2 0xb6d51238 in abort () from /lib/libc.so.6
    5. #3 0xb6d4870e in __assert_fail () from /lib/libc.so.6
    6. #4 0xb729880e in ?? () from /usr/lib/libX11.so.6
    7. #5 0xb7281aaa in XEventsQueued () from /usr/lib/libX11.so.6
    8. ---Type <return> to continue, or q <return> to quit---
    9. #6 0xb764341b in ?? () from /usr/lib/libQtGui.so.4
    10. #7 0xb71b42ca in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
    11. #8 0xb71b448a in QEventLoop::exec () from /usr/lib/libQtCore.so.4
    12. #9 0xb71b666d in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
    13. #10 0xb75b8d47 in QApplication::exec () from /usr/lib/libQtGui.so.4
    14. #11 0x0804f9ab in main ()
    15.  
    16. Thread 5 (Thread 0xb66c4b90 (LWP 12007)):
    17. #0 0xffffe430 in __kernel_vsyscall ()
    18. #1 0xb7fecc15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
    19. #2 0xb6ce50ff in _xcb_lock_io () from /usr/lib/libxcb.so.1
    20. #3 0xb6cf66d2 in xcb_xlib_lock () from /usr/lib/libxcb-xlib.so.0
    21. #4 0xb7298879 in ?? () from /usr/lib/libX11.so.6
    22. #5 0xb72731b6 in XFreeGC () from /usr/lib/libX11.so.6
    23. ---Type <return> to continue, or q <return> to quit---
    24. #6 0xb7678abe in ?? () from /usr/lib/libQtGui.so.4
    25. #7 0xb7678cb2 in ?? () from /usr/lib/libQtGui.so.4
    26. #8 0xb766b9da in QPixmap::fromImage () from /usr/lib/libQtGui.so.4
    27. #9 0xb76a293c in QPaintEngine::drawImage () from /usr/lib/libQtGui.so.4
    28. #10 0xb773c579 in ?? () from /usr/lib/libQtGui.so.4
    29. #11 0xb76b150f in QPainter::drawImage () from /usr/lib/libQtGui.so.4
    30. #12 0x0804fc13 in DrawPicture::paintEvent ()
    31. #13 0xb760af61 in QWidget::event () from /usr/lib/libQtGui.so.4
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: probleme in multithreading and xcb in a Qt application

    Make your code thread safe.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. #3
    Join Date
    Feb 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: probleme in multithreading and xcb in a Qt application

    Thanks, i have tried XInitThread(), and it works.

Similar Threads

  1. Probleme d'execution Qt/XML
    By fhorizon in forum General Programming
    Replies: 2
    Last Post: 11th May 2009, 11:00
  2. probleme dowloading file with QFtp::get()
    By hbill in forum Qt Programming
    Replies: 6
    Last Post: 3rd July 2008, 13:43
  3. probleme with cast from double to QString
    By hbill in forum Qt Programming
    Replies: 7
    Last Post: 17th May 2008, 00:00
  4. Strange Release probleme
    By Simz in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2008, 05:07
  5. Probleme mit QT4
    By ensacom1 in forum Qt Programming
    Replies: 2
    Last Post: 9th January 2007, 21:26

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.