Results 1 to 5 of 5

Thread: Installed Qwt & also set ldconfig, but application is crashing

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Installed Qwt & also set ldconfig, but application is crashing

    Hi,

    I downloaded qwt-6.1.0 and installed as said in installation procedure.
    Qt Code:
    1. cd qwt-6.1.0
    2. /usr/local/Qt-5.0.1/bin/qmake qwt.pro
    3. make
    4. sudo make install
    To copy to clipboard, switch view to plain text mode 

    I didn' want the designed plugin, so didn't tinker with it.

    Then I did set the lib path by
    Qt Code:
    1. export LD_LIBRARY_PATH="/usr/local/qwt-6.1.0/lib"
    To copy to clipboard, switch view to plain text mode 

    My .pro file looks like this
    Qt Code:
    1. QT += core gui
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. CONFIG += qwt
    6.  
    7. TARGET = QPrac
    8. TEMPLATE = app
    9.  
    10. INCLUDEPATH += /usr/local/qwt-6.1.0/include
    11.  
    12. LIBS += -L/usr/local/qwt-6.1.0/lib -lqwt
    13.  
    14. SOURCES += main.cpp\
    15. cwidget.cpp
    16.  
    17. HEADERS += cwidget.h
    To copy to clipboard, switch view to plain text mode 

    The application output is giving the following -
    Qt Code:
    1. Starting /home/rahul/Documents/QPrac/QPrac...
    2. *** glibc detected *** /home/rahul/Documents/QPrac/QPrac: realloc(): invalid pointer: 0xb6f77e9c ***
    3. ======= Backtrace: =========
    4. /lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xb68beee2]
    5. /lib/i386-linux-gnu/libc.so.6(realloc+0x25d)[0xb68c356d]
    6. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZN9QListData7reallocEi+0x37)[0xb6bb8e67]
    7. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZN9QListData6appendEi+0x7c)[0xb6bb8f4c]
    8. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZN9QListData6appendEv+0x23)[0xb6bb8fd3]
    9. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(+0x6c2c8)[0xb6b742c8]
    10. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(+0x6a4fd)[0xb6b724fd]
    11. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(+0x6b0d8)[0xb6b730d8]
    12. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_Z20qMessageFormatString9QtMsgTypeRK18QMessageLogContextRK7QString+0x6cc)[0xb6b738ec]
    13. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(+0x6ba72)[0xb6b73a72]
    14. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(+0x69227)[0xb6b71227]
    15. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(+0x69383)[0xb6b71383]
    16. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZNK14QMessageLogger5fatalEPKcz+0x3f)[0xb6b7194f]
    17. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZN9QMetaType22registerNormalizedTypeERK10QByteArrayPFvPvEPFS3_PKvES5_PFS3_S3_S7_Ei6QFlagsINS_8TypeFlagEEPK11QMetaObject+0x57f)[0xb6d6752f]
    18. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZN9QMetaType12registerTypeEPKcPFvPvEPFS2_PKvES4_PFS2_S2_S6_Ei6QFlagsINS_8TypeFlagEEPK11QMetaObject+0x67)[0xb6d675e7]
    19. /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5(_ZN9QMetaType12registerTypeEPKcPFvPvEPFS2_PKvE+0x57)[0xb6d676a7]
    20. /usr/lib/i386-linux-gnu/libQtGui.so.4(+0x328a8e)[0xb5f4ba8e]
    21. /usr/lib/i386-linux-gnu/libQtGui.so.4(+0x126f40)[0xb5d49f40]
    22. /lib/ld-linux.so.2(+0xeeab)[0xb7704eab]
    23. /lib/ld-linux.so.2(+0xef94)[0xb7704f94]
    24. /lib/ld-linux.so.2(+0x120f)[0xb76f720f]
    25. ======= Memory map: ========
    26. 08048000-0804b000 r-xp 00000000 08:01 1843399 /home/rahul/Documents/QPrac/QPrac
    27. 0804b000-0804c000 r--p 00002000 08:01 1843399 /home/rahul/Documents/QPrac/QPrac
    28. 0804c000-0804d000 rw-p 00003000 08:01 1843399 /home/rahul/Documents/QPrac/QPrac
    29. 08336000-08357000 rw-p 00000000 00:00 0 [heap]
    30. b35f8000-b35fc000 rw-p 00000000 00:00 0
    31. b35fc000-b3601000 r-xp 00000000 08:01 135631 /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
    32. b3601000-b3602000 r--p 00004000 08:01 135631 /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
    33. b3602000-b3603000 rw-p 00005000 08:01 135631 /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
    34.  
    35.  
    36. // [LOT OF SIMILAR MESSAGES HERE]
    37.  
    38.  
    39. b5c22000-b5c23000 rw-p 00000000 00:00 0
    40. b5c23000-b66cd000 r-xp 00000000 08:01 133481 /usr/lib/i386-linux-gnu/libQtGui.so.4.8.1
    41. b66cd000-b66ef000 r--p 00aa9000 08:01 133481 /usr/lib/i386-linux-gnu/libQtGui.so.4.8.1
    42. b66ef000-b66f3000 rw-p 00acb000 08:01 133481 /usr/lib/i386-linux-gnu/libQtGui.so.4.8.1
    43. b66f3000-b66f6000 rw-p 00000000 00:00 0
    44. b66f6000-b67ec000 r-xp 00000000 08:01 133455 /usr/lib/i386-linux-gnu/libQtOpenGL.so.4.8.1
    45. b67ec000-b67ee000 r--p 000f6000 08:01 133455 /usr/lib/i386-linux-gnu/libQtOpenGL.so.4.8.1
    46. b67ee000-b67f2000 rw-p 000f8000 08:01 133455 /usr/lib/i386-linux-gnu/libQtOpenGL.so.4.8.1
    47. b67f2000-b67f4000 rw-p 00000000 00:00 0
    48. b67f4000-b6847000 r-xp 00000000 08:01 133460 /usr/lib/i386-linux-gnu/libQtSvg.so.4.8.1
    49. b6847000-b6848000 r--p 00052000 08:01 133460 /usr/lib/i386-linux-gnu/libQtSvg.so.4.8.1
    50. b6848000-b6849000 rw-p 00053000 08:01 133460 /usr/lib/i386-linux-gnu/libQtSvg.so.4.8.1
    51. b6849000-b69ed000 r-xp 00000000 08:01 532188 /lib/i386-linux-gnu/libc-2.15.so
    52. b69ed000-b69ef000 r--p 001a4000 08:01 532188 /lib/i386-linux-gnu/libc-2.15.so
    53. b69ef000-b69f0000 rw-p 001a6000 08:01 532188 /lib/i386-linux-gnu/libc-2.15.so
    54. b69f0000-b69f3000 rw-p 00000000 00:00 0
    55. b69f3000-b6a0f000 r-xp 00000000 08:01 525142 /lib/i386-linux-gnu/libgcc_s.so.1
    56. b6a0f000-b6a10000 r--p 0001b000 08:01 525142 /lib/i386-linux-gnu/libgcc_s.so.1
    57. b6a10000-b6a11000 rw-p 0001c000 08:01 525142 /lib/i386-linux-gnu/libgcc_s.so.1
    58. b6a11000-b6ae9000 r-xp 00000000 08:01 136163 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    59. b6ae9000-b6aea000 ---p 000d8000 08:01 136163 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    60. b6aea000-b6aee000 r--p 000d8000 08:01 136163 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    61. b6aee000-b6aef000 rw-p 000dc000 08:01 136163 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    62. b6aef000-b6af6000 rw-p 00000000 00:00 0
    63. b6b07000-b6b08000 rw-p 00000000 00:00 0
    64. b6b08000-b6f71000 r-xp 00000000 08:01 808964 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5.1.1
    65. b6f71000-b6f72000 ---p 00469000 08:01 808964 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5.1.1
    66. b6f72000-b6f77000 r--p 00469000 08:01 808964 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5.1.1
    67. b6f77000-b6f8a000 rw-p 0046e000 08:01 808964 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5.1.1
    68. b6f8a000-b6f8c000 rw-p 00000000 00:00 0
    69. b6f8c000-b758b000 r-xp 00000000 08:01 809012 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Widgets.so.5.1.1
    70. b758b000-b75a0000 r--p 005fe000 08:01 809012 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Widgets.so.5.1.1
    71. b75a0000-b75b8000 rw-p 00613000 08:01 809012 /opt/Qt5.1.1/5.1.1/gcc/lib/libQt5Widgets.so.5.1.1
    72. b75b8000-b76ea000 r-xp 00000000 08:01 548194 /usr/local/qwt-6.1.0/lib/libqwt.so.6.1.0
    73. b76ea000-b76eb000 ---p 00132000 08:01 548194 /usr/local/qwt-6.1.0/lib/libqwt.so.6.1.0
    74. b76eb000-b76f0000 r--p 00132000 08:01 548194 /usr/local/qwt-6.1.0/lib/libqwt.so.6.1.0
    75. b76f0000-b76f3000 rw-p 00137000 08:01 548194 /usr/local/qwt-6.1.0/lib/libqwt.so.6.1.0
    76. b76f3000-b76f5000 rw-p 00000000 00:00 0
    77. b76f5000-b76f6000 r-xp 00000000 00:00 0 [vdso]
    78. b76f6000-b7716000 r-xp 00000000 08:01 532178 /lib/i386-linux-gnu/ld-2.15.so
    79. b7716000-b7717000 r--p 0001f000 08:01 532178 /lib/i386-linux-gnu/ld-2.15.so
    80. b7717000-b7718000 rw-p 00020000 08:01 532178 /lib/i386-linux-gnu/ld-2.15.so
    81. bfab5000-bfad6000 rw-p 00000000 00:00 0 [stack]
    82. The program has unexpectedly finished.
    83. /home/rahul/Documents/QPrac/QPrac exited with code 0
    To copy to clipboard, switch view to plain text mode 

    I used QwtPlot and added it to a QHBoxLayout and tried to build & run. The compilation works fine, but if I run, it crashes. Kindly help me.
    Thank you.
    Last edited by rawfool; 24th October 2013 at 19:03.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Installed Qwt & also set ldconfig, but application is crashing

    Invalid pointer is fairly descriptive. Since we cannot see your code we have no idea what it is doing to trigger this.

  3. #3
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Installed Qwt & also set ldconfig, but application is crashing

    By looking at application output, even I thought that, I might have done something wrong with pointer declaration. But nothing seems wrong to me in my code.
    I'm getting the same error even if I run the examples given in the qwt-6.1.0/examples

    Is it something related to path permissions ??

    Qt Code:
    1. // header file
    2. #ifndef CWIDGET_H
    3. #define CWIDGET_H
    4.  
    5. #include <QWidget>
    6. #include <QHBoxLayout>
    7. #include <qwt_plot.h>
    8.  
    9. class CWidget : public QWidget
    10. {
    11. Q_OBJECT
    12.  
    13. public:
    14. CWidget(QWidget *parent = 0);
    15. ~CWidget();
    16. private:
    17. QHBoxLayout * hLyt;
    18. QwtPlot * plot;
    19. };
    20.  
    21. #endif // CWIDGET_H
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. // source file
    2. #include "cwidget.h"
    3.  
    4. CWidget::CWidget(QWidget *parent)
    5. : QWidget(parent)
    6. {
    7. hLyt = new QHBoxLayout();
    8. plot = new QwtPlot();
    9. hLyt->addWidget(plot);
    10. this->setLayout(hLyt);
    11. }
    12.  
    13. CWidget::~CWidget()
    14. {
    15. delete plot;
    16. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. // main.cpp
    2. #include "cwidget.h"
    3. #include <QApplication>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication a(argc, argv);
    8. CWidget w;
    9. w.show();
    10.  
    11. return a.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by rawfool; 25th October 2013 at 08:58.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Installed Qwt & also set ldconfig, but application is crashing

    By placing the plot in a layout and setting that on the widget the Qwt plot has its parent set and will be deleted automatically when the parent is. Cwidget.cpp line 13 may result in a double delete at shutdown.

    Make sure that your application is picking up the version of Qwt it was built against and the corresponding Qt version. If your machine contains several qwt or qt libraries you may be getting the wrong one. You can use the ldd command.

  5. #5
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Installed Qwt & also set ldconfig, but application is crashing

    I'm using Ubuntu 12.04 and I have installed Qt 5.1.1 and Qwt 6.1.0.
    The /etc/alternatives/qmake is showing that it's a symbolic link to qmake-qt4.
    Qt Code:
    1. rahul@e18hteen:/etc/alternatives$ file qmake
    2. qmake: symbolic link to `/usr/bin/qmake-qt4'
    To copy to clipboard, switch view to plain text mode 

    How to I make sure that I compile Qwt against the latest qmake ?

    Thank you.
    Last edited by rawfool; 27th October 2013 at 05:48.

Similar Threads

  1. Main Application is crashing
    By vijayQt in forum Newbie
    Replies: 5
    Last Post: 23rd May 2011, 11:41
  2. QML Application crashing on exit
    By fgungor in forum Qt Quick
    Replies: 0
    Last Post: 12th March 2011, 10:19
  3. Access Violation - Crashing Application
    By LIRiot in forum Qt Programming
    Replies: 9
    Last Post: 5th December 2010, 23:10
  4. Application crashing
    By addu in forum Qt Programming
    Replies: 9
    Last Post: 22nd May 2009, 10:37
  5. Application is Crashing
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2007, 17:04

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.