Results 1 to 20 of 22

Thread: Segmentation fault while creating Object for QApplication

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Segmentation fault while creating Object for QApplication

    It's not required but you probably have to somehow tell QApplication not to try to connect to X server With Qtopia you would use QtopiaApplication but with bare Qt/Embedded you probably need to use QApplication. You did compile Qt/Embedded for your device, right? You didn't just cross-compile the desktop edition for ARM?
    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.


  2. The following user says thank you to wysota for this useful post:

    nrabara (25th August 2009)

  3. #2
    Join Date
    Sep 2008
    Posts
    58
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    11

    Default Re: Segmentation fault while creating Object for QApplication

    I do remember that i have used qt-embedded-linux-open-source-4.5.
    I am getting following message when i try to run qt application.

    # ./JS
    QWSSocket::connectToLocalFile could not connect :: Connection refused
    No Qt for embedded linux server appears to be running
    If you want to run the program as a server
    add -qws

    when I run with # ./JS -qws
    Segmentation fault

    any suggestion would be appreciable....

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

    Default Re: Segmentation fault while creating Object for QApplication

    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. #4
    Join Date
    Sep 2008
    Posts
    58
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    11

    Default Re: Segmentation fault while creating Object for QApplication

    Yes I have read it,

    I have used following..
    export QT_DIR=/home/qt
    export LD_LIBRARY_PATH=$QT_DIR/lib
    export QWD_DISPLAY=LinuxFb

    I have intalled libQtGui.so.4 , libQtCore.so.4 ,libQtNetwork.so.4 in my board at /home/qt/lib.(same path user while cross compiling with arm-linux-gcc)
    I have also intalled fonts to /home/qt/fonts
    i have place qmake in /usr/bin or my board

    I dont under understand why it's(segmentation fault) happening with QApplication only why not with QCoreApplicaton.

    Your suggestion would be a great help for me.

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

    Default Re: Segmentation fault while creating Object for QApplication

    Does the user have access rights to write to the framebuffer?

    QCoreApplication works because the application doesn't try to access the framebuffer.
    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. #6
    Join Date
    Sep 2008
    Posts
    58
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    11

    Default Re: Segmentation fault while creating Object for QApplication

    Yes user have rights to access /dev/fb0
    Even I can run qt example code of frambuffer(examples/qws/framebuffer.) on board, and Its show me three rectangles on my display.

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Segmentation fault while creating Object for QApplication

    Do other examples work as well?
    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.


  9. #8
    Join Date
    Sep 2008
    Posts
    58
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    11

    Default Re: Segmentation fault while creating Object for QApplication

    All the example having QApplication object show segmentation fault.

    But for QCoreApplication object, i can use QDateTime, QDate etc.. sub classes of QCoreApplication. It's works fine with QCoreApplication.

    Is there any other way to test QApplication object, I mean
    Can ./configure affect Qt Gui ?? I have tried with full configuration also.

    Your suggestion would be great help for me..

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

    Default Re: Segmentation fault while creating Object for QApplication

    Your problem is deployment, not compilation. Could you post a backtrace of an exemplory crash? An strace showing files being opened (and statuses of the calls) would be nice as well.
    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.


  11. #10
    Join Date
    Sep 2008
    Posts
    58
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    11

    Default Re: Segmentation fault while creating Object for QApplication

    Below is my test application code

    main.cpp file

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include <QLabel>
    3. #include "widget.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. printf("Inside main\n");
    8. unsigned int loop;
    9. QApplication a(argc, argv);
    10. printf("argc = %d \n",argc);
    11. for(loop=0;loop<argc;loop++)
    12. {
    13. printf("argv[%d] = %s \n",argc,argv[loop]);
    14. }
    15. Widget w;
    16. w.setFixedSize(200,200);
    17. w.show();
    18. return a.exec();
    19. }
    20.  
    21. [B][U]widget.cpp file[/U][/B]
    22.  
    23. #include "widget.h"
    24.  
    25. Widget::Widget(QWidget *parent)
    26. : QWidget(parent)
    27. {
    28. }
    29.  
    30. Widget::~Widget()
    31. {
    32.  
    33. }
    34.  
    35. [U][B]widget.h file[/B][/U]
    36.  
    37. #ifndef WIDGET_H
    38. #define WIDGET_H
    39.  
    40. #include <QtGui/QWidget>
    41.  
    42. class Widget : public QWidget
    43. {
    44. Q_OBJECT
    45.  
    46. public:
    47. Widget(QWidget *parent = 0);
    48. ~Widget();
    49. };
    50.  
    51. #endif // WIDGET_H
    To copy to clipboard, switch view to plain text mode 

    Back trace of the above code is attached - file : QApplication_backtrace.txt

    I have also attached back trace of qt's example code - framebuffer , file : QtFramebuffer_exampleCode.txt

    Your suggestion would be a great help for me..
    Attached Files Attached Files

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Segmentation fault while creating Object for QApplication

    This is an strace. What about a debugger backtrace?

    The strace suggests there is a problem with mapping the framebuffer to memory.
    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.


  13. #12
    Join Date
    Dec 2008
    Location
    France
    Posts
    93
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android
    Thanked 23 Times in 22 Posts

    Default Re: Segmentation fault while creating Object for QApplication

    Can you post result for the following command "fbset --info" too, thx.

Similar Threads

  1. Replies: 2
    Last Post: 17th June 2010, 00:58
  2. segmentation fault for no apparent reason
    By rishiraj in forum Newbie
    Replies: 1
    Last Post: 12th February 2009, 12:13
  3. segmentation fault
    By uchennaanyanwu in forum Newbie
    Replies: 3
    Last Post: 31st July 2008, 17:52
  4. Segmentation fault running any QT4 executables
    By jellis in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2007, 17:35
  5. Icons missing => segmentation fault
    By antonio.r.tome in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2006, 17:30

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
  •  
Qt is a trademark of The Qt Company.