Results 1 to 7 of 7

Thread: Problems with QThreads

  1. #1
    Join Date
    May 2009
    Location
    Austria
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Problems with QThreads

    Hello,

    we are developing an application in a virtual-vm-ware on linux/debian. when i debug the application on the virtual-vm-ware it works really good an nothing bad happens.

    but when i compile the programm (arm-linux-gnueabi-g++) there are very strange problems now.

    here is the last problem what i got, when i debug on the device with gdb:

    Qt Code:
    1. Program received signal SIGSEGV, Segmentation fault.
    2. [Switching to Thread 0x4178a460 (LWP 534)]
    3. from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtNetwork.so.4
    4. (gdb) bt
    5. #0 0x4015dd7c in QNetworkInterface::QNetworkInterface(QNetworkInterface const&) ()
    6. from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtNetwork.so.4
    7. #1 0x0003a350 in cNetworkThread::run() ()
    8. #2 0x40222b90 in ?? () from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtCore.so.4
    9. #3 0x40222b90 in ?? () from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtCore.so.4
    10. Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    11. (gdb) info frame
    12. Stack level 0, frame at 0x41789c48:
    13. saved pc 0x3a350
    14. called by frame at 0x41789ca8
    15. Arglist at 0x41789c38, args:
    16. Locals at 0x41789c38, Previous frame's sp is 0x41789c48
    17. Saved registers:
    18. r4 at 0x41789c38, r5 at 0x41789c3c, r6 at 0x41789c40, lr at 0x41789c44
    19. (gdb) info stack
    20. #0 0x4015dd7c in QNetworkInterface::QNetworkInterface(QNetworkInterface const&) ()
    21. from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtNetwork.so.4
    22. #1 0x0003a350 in cNetworkThread::run() ()
    23. #2 0x40222b90 in ?? () from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtCore.so.4
    24. #3 0x40222b90 in ?? () from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtCore.so.4
    25. Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    26. (gdb) info bt
    27. Undefined info command: "bt". Try "help info".
    28. (gdb) bt
    29. #0 0x4015dd7c in QNetworkInterface::QNetworkInterface(QNetworkInterface const&) ()
    30. from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtNetwork.so.4
    31. #1 0x0003a350 in cNetworkThread::run() ()
    32. #2 0x40222b90 in ?? () from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtCore.so.4
    33. #3 0x40222b90 in ?? () from /usr/local/packages/qt-armel-qvfb-4.7.1/lib/libQtCore.so.4
    34. Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    To copy to clipboard, switch view to plain text mode 
    Here is my cNetworkThread.h:

    Qt Code:
    1. class cNetworkThread : public QThread
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6.  
    7. explicit cNetworkThread(QObject *parent = 0);
    8. void run();
    9.  
    10. };
    To copy to clipboard, switch view to plain text mode 

    and here is my .cpp:

    Qt Code:
    1. cNetworkThread::cNetworkThread(QObject *parent) :
    2. QThread(parent)
    3. {
    4. qDebug() << "Network-Thread Konstruktor";
    5. qDebug() << "Network-Thread ID" << currentThreadId();
    6. }
    7.  
    8. void cNetworkThread::run()
    9. {
    10. qDebug() << "Network-Thread run-Methode" << currentThreadId();
    11. while(true)
    12. {
    13. msleep(200);
    14. QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
    15.  
    16. for(int i = 0; i < ifaces.count(); i++)
    17. {
    18. msleep(200);
    19. QNetworkInterface iface = ifaces.at(i);
    20. QString interfaceName = ifaces[i].name();
    21. if(interfaceName == "eth0")
    22. {
    23. if(iface.flags().testFlag(QNetworkInterface::IsRunning) && !iface.flags().testFlag(QNetworkInterface::IsLoopBack))
    24. {
    25. // Connection still running
    26. }
    27. else
    28. {
    29. // Connection down
    30. cLedState::SetLED(LED_NETWORK);
    31. }
    32. }
    33. }
    34. ifaces.clear();
    35. }
    36. }
    To copy to clipboard, switch view to plain text mode 
    do you have any idea what is going wrong?

    i do also have some problems with "qt glibc detected corrupted double-linked list".

    i hope you can help me with my problem!
    attached you find my complete project!

    kind regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problems with QThreads

    Is cLedState::setLED() in any way related to GUI?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Location
    Austria
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems with QThreads

    Quote Originally Posted by wysota View Post
    Is cLedState::setLED() in any way related to GUI?
    We don`t have a GUI - the program loads data that we get from the CAN-Bus into a MySQL-Database.
    With cLedState::setLED() we can set the LED from the device in any case of error.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problems with QThreads

    The backtrace suggests you have a corrupt stack. This can happen either if you overwrite it yourself or if you have incompatible set of libraries.

    What do you have in your program apart this thread?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2009
    Location
    Austria
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems with QThreads

    Quote Originally Posted by wysota View Post
    The backtrace suggests you have a corrupt stack. This can happen either if you overwrite it yourself or if you have incompatible set of libraries.

    What do you have in your program apart this thread?
    what do you mean with what i have apart in this thread?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problems with QThreads

    Your program probably consists of something more than only a class inheriting QThread. The problem might be there and that's why I'm asking.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    May 2009
    Location
    Austria
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems with QThreads

    Quote Originally Posted by wysota View Post
    Your program probably consists of something more than only a class inheriting QThread. The problem might be there and that's why I'm asking.
    in our virtual-vm (64bit) runs the application without any problem - on the device we have the problems

Similar Threads

  1. progress bar in QThreads
    By jackajack01 in forum Qt Programming
    Replies: 2
    Last Post: 25th August 2012, 00:43
  2. Tangled in QThreads
    By spawn9997 in forum Qt Programming
    Replies: 7
    Last Post: 14th October 2009, 22:00
  3. Qthreads and webcam app
    By Schizo in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2007, 09:17
  4. Qthreads
    By Sheetal in forum Qt Programming
    Replies: 5
    Last Post: 23rd March 2007, 11:12
  5. QTcpSockets and QThreads
    By TheRonin in forum Newbie
    Replies: 3
    Last Post: 21st June 2006, 09:41

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.