Results 1 to 3 of 3

Thread: Strange crashing

  1. #1
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Strange crashing

    I am trying to create a slightly updated version of the Blanchette - Summerfield "slider - spinbox" example. The updating consists in creating the GUI in the Designer and using the .ui file in my code. The main window is a class MyFrame with a default ctor:

    Qt Code:
    1. MyFrame::MyFrame() : QMainWindow()
    2. {
    3. ui.setupUi(this);
    4.  
    5. connect(ui.slider,SIGNAL(valueChanged(int)),ui.spinbox,SLOT(setValue(int)));
    6. connect(ui.spinbox,SIGNAL(valueChanged(int)),ui.slider,SLOT(setValue(int)));
    7.  
    8. show();
    9. }
    To copy to clipboard, switch view to plain text mode 

    The program compiles and runs nicely. When I click the 'x' button on the titlebar, the program closes gracefully sometimes (about 50 % chance) and sometimes produces a crash output:

    Qt Code:
    1. *** glibc detected *** /home/radek/Desktop/C++/project/slider-release/slider: free(): invalid next size (fast): 0x00000000008a1f90 ***
    2. ======= Backtrace: =========
    3. /lib/x86_64-linux-gnu/libc.so.6(+0x76d76)[0x7f35be0d0d76]
    4. /lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f35be0d5aac]
    5. /home/radek/Desktop/C++/project/slider-release/slider[0x403c57]
    6. /home/radek/Desktop/C++/project/slider-release/slider[0x403a7d]
    7. /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f35be078ead]
    8. /home/radek/Desktop/C++/project/slider-release/slider[0x403ac5]
    To copy to clipboard, switch view to plain text mode 

    but then I get informed that

    Qt Code:
    1. /home/radek/Desktop/C++/project/slider-release/slider exited with code 0
    To copy to clipboard, switch view to plain text mode 

    I cannot find out any rule, when the program exits normally and when it crashes. Any ideas?

  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: Strange crashing

    Line 8 is typically unnecessary because you call show() from outside the object (in main()).

    What is main() doing? How are you creating/destroying a MyFrame instance?

  3. #3
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Strange crashing

    Here is the project.
    Attached Files Attached Files

Similar Threads

  1. Qwt app crashing
    By K4ELO in forum Qwt
    Replies: 0
    Last Post: 25th March 2013, 12:57
  2. App TRK crashing on Nokia E7
    By mvbhavsar in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 31st March 2011, 07:56
  3. Crashing without debug mode- No crashing with gdb debugger
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 1
    Last Post: 7th February 2011, 11:27
  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.