Results 1 to 20 of 50

Thread: Program crashes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program crashes

    already did, nothing wrong

  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: Program crashes

    Post your backtrace.

  3. #3
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program crashes

    Did you mean this?:
    Signal name: SIGSEGV
    Signal meaning: Segmentation fault
    if not:
    http://pastebin.com/R5uubZPf
    ---The text that you have entered is too long (46227 characters). Please shorten it to 10000 characters long.
    anything else?

  4. #4
    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: Program crashes

    No, that is the compiled code of a QWidget::setParent function.

    But it might get us closer to the error.
    If your program fails in this function, you're creating a widget with a non valid parent.

    I guess Channel is a widget?
    And the first argument in the constructor is the parent?
    Does "this" exist?

  5. #5
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program crashes

    Channel is a widget yes, and "this" exist while calling it and yes the first arguemnt is QWidget

  6. #6
    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: Program crashes

    I would love to see the backtrace.

    What system are you using? Window, Linux, MacOs, ... ?
    What IDE are you using? Qt Creator, ... ?

  7. #7
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program crashes

    Windows, Qt creator (to debug), and Qt Command Line to compile. how do i get the backtrace?

  8. #8
    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: Program crashes

    In Qt Creator, in stead of running the program normally, run the program in the debugger.
    When it crashes, go to the stack view (should be the list on the left I think), it should contain the backtrace.

  9. #9
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program crashes

    nope, cant see anything

  10. #10
    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: Program crashes

    I'm not in front of my computer at the moment so I can't help you with that at the moment.

    But to give some more information:
    The backtrace is a list of functions that were the last functions being run in your program.
    The very last function in this list usually contains the crash. You can then follow the list of functions to see where the problem first occured.

    Segmentation faults happen when you try to access memory that you should never access (like the memory segment of the kernel). Most of the time this happens when the pointer to an object is 0.

    The stack list should be the list on the left in the debugging section of Qt Creator.

  11. #11
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Program crashes

    I agree that running in a debugger will be the fastest solution here. Another point: you never check the results of your "find" operation. Despite your insistence that there's a space to be found in the string, it's poor form not to check that the operation actually succeeded.

    You could also simply print the results of each line shown to cerr, which would at least isolate the line that is causing the problem. Printing out tmp prior to the string manipulations would also shed some light.

  12. #12
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program crashes

    ok i have made something like this:
    Qt Code:
    1. if(sscanf(tmp.c_str(), "/join %s", buffer) > 0) {
    To copy to clipboard, switch view to plain text mode 
    and then read->append(buffer) and it worked but i commented out the:
    Qt Code:
    1. m_chan = new Channel(this, QString(buffer), socket);
    2. tabs->addTab(m_chan, QString(buffer));
    To copy to clipboard, switch view to plain text mode 
    so its something wrong with them.

Similar Threads

  1. qstringlist array crashes program
    By chrisb123 in forum Newbie
    Replies: 4
    Last Post: 23rd October 2009, 15:03
  2. Program crashes on creating new dialog
    By eekhoorn12 in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 11:52
  3. program crashes (QtTestRunner)
    By fmariusd in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2008, 09:27
  4. Program crashes (SIGSEGV)
    By Voldemort in forum Qt Programming
    Replies: 47
    Last Post: 21st May 2007, 20:09
  5. Reading from TCP Socket crashes program
    By OnionRingOfDoom in forum Qt Programming
    Replies: 26
    Last Post: 27th January 2006, 19:32

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.