Results 1 to 6 of 6

Thread: Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

  1. #1
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

    Hello,

    I have Qt GUI library which shows dialogs such as login. We use it with Firefox which calls the Qt library that should show a dialog. But at this point Firefox is closed with segmantation error.

    I can use my Qt GUI library from non-Qt application by providing the QApplication inside the library and it works. I have the GTK 2.0 installed.

    Thanks for any help you provide.

    Barak

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

    That's way too few information to give a good answer.

    So, install and/or rebuild the respective packages (firefox, qt, etc...) with debug information.
    Then run it all through gdb and get a backtrace. Using the backtrace you can already see where the problem might be. If not, use the information to step through the program and look at the registers and variables.

    A segmentation fault happens when you try to access memory you're not supposed to access (like in an uninitialized pointer)

  3. #3
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

    Thanks. How do I add debug information to my Qt library? Could it be related to the gtk-qt?

  4. #4
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

    OK it is crashing when I create the QApplication object:

    Qt Code:
    1. QApplication * a = new QApplication(NULL,NULL);
    To copy to clipboard, switch view to plain text mode 

  5. #5
    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: Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

    Passing it two nulls is probably what's causing the crash. You can't pass arbitrary values to objects and expect them to work.
    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.


  6. #6
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)

    The full code is:
    Qt Code:
    1. QApplication * a = 0;
    2. if (!qApp){
    3.  
    4. int argc = 1;
    5.  
    6. char *argv[] = { "asePinDialog", NULL };
    7.  
    8. a = new QApplication(argc,argv);
    9.  
    10. //QApplication b(argc,argv);
    11.  
    12. }
    13.  
    14.  
    15. m_iLastSlotId = aseData.slotID;
    16.  
    17. ChangePin *pinDlg = new ChangePin(aseData);
    18.  
    19. m_pOpenDialog = pinDlg;
    20.  
    21. pinDlg->exec();
    22. //pinDlg->show();
    23.  
    24.  
    25. bool bRet = (pinDlg->result() == QDialog::Accepted);
    26.  
    27. delete pinDlg;
    28.  
    29. m_pOpenDialog = NULL;
    30.  
    31. m_iLastSlotId = 0;
    32.  
    33. if(a){
    34.  
    35. a->exit();
    36.  
    37. delete a;
    38.  
    39. a = 0;
    40.  
    41. }
    42.  
    43. return bRet;
    To copy to clipboard, switch view to plain text mode 
    Last edited by barak; 25th July 2010 at 11:17.

Similar Threads

  1. Replies: 0
    Last Post: 15th June 2010, 14:22
  2. Can't Compile on Ubuntu Linux
    By mpauley in forum Newbie
    Replies: 6
    Last Post: 9th April 2010, 22:00
  3. Replies: 10
    Last Post: 13th November 2009, 19:31
  4. Replies: 0
    Last Post: 4th November 2009, 07:45
  5. Replies: 5
    Last Post: 6th March 2009, 09:58

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.