Results 1 to 4 of 4

Thread: Sigsegv

  1. #1
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Default Sigsegv

    What is SIGSEGV ? and what causes it?

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Sigsegv

    That is a signal OS gives to a process when it makes an invalid memory reference (aka Segmentation Fault) and most of the reasons are pointer mistakes: dereference a null pointer, write beyond and array size-1 (buffer overflow), using uninitialized pointers, attempt to access/alter memory the program does not own, double deletion (careful with the parent-child relation ship, what the parent delete and what you must delete or create on stack)

  3. #3
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Sigsegv

    How to detect and pinpoint which one is the actual root cause?

  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: Sigsegv

    There are a couple of techniques you can use.

    You can use a debugger. Set a couple of break points and analyse the code.
    You can run a static code analyser which analyses the code before it is run to find possible problems.
    You can run a memory checking utility like Valgrind to see where problems might be, although Qt isn't really good to be used with memory checking tools since Qt does its own memory management in some base classes which confuse some of those tools.

    Or, you can simply write a few qDebug() << "..." lines and narrow down to the problem. This method will require more time though.

Similar Threads

  1. QTextEdit SIGSEGV
    By Flayer in forum Qt Programming
    Replies: 4
    Last Post: 14th January 2010, 22:52
  2. sigsegv ?
    By mero in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2009, 18:01
  3. QSqlQueryModel::setQuery - SIGSEGV
    By onamatic in forum Qt Programming
    Replies: 14
    Last Post: 27th January 2009, 10:26
  4. QAbstractSocket::abort() with SIGSEGV
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2008, 17:05
  5. Program crashes (SIGSEGV)
    By Voldemort in forum Qt Programming
    Replies: 47
    Last Post: 21st May 2007, 20:09

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.