Qt World Summit: Register Today!

SIGSEGV Error when debugging with Qt creator.

  • A related discuss can be found at

    First of all, my environment:
    [quote]Ubuntu 12.04
    C++ gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
    Qt Creator 2.4.1 Based on Qt 4.8.0 (32 bit) Built on Mar 21 2012 at 23:05:03
    Eclipse IDE for C/C++ Linux Developers Version: Indigo Service Release 2 Build id: 20120216-1857[/quote]

    I tried both Eclipse and QtCreator. Under Eclipse, my application runs fine, but under QtCreator, the application always got the SIGSEGV error:

    [quote]The inferior stopped because it received a signal from the Operating System.

    Signal name :
    Signal meaning :
    Segmentation fault[/quote]

    Why the same code passed one IDE, but failed the other????weird...


  • The SIGSEGV is a problem in your code, an indication that something is wrong.

    Different behavior may have all kind of reasons, ranging from different builds, different environments, diffferent execution order (including some introduced by the debugging itself) to different timing etc.

  • To add an hint to the previous reply, try to check your code at locations where you use pointers (if you do so).

  • Moderators

    You get a SIGSEGV if your application tries to access memory illegally. Some examples are here: http://en.wikipedia.org/wiki/Segmentation_fault#Segmentation.2C_page_fault.2C_and_access_violation

    In QtCreator, run the debugger (gdb). When you get the SIGSEGV signal, the debugger will show you where the error is, so you can fix it.

    From your description, my best guess is that your program uses uninitialized pointers, which is dangerous, and sometimes causes SIGSEGV.

  • When you got the SIGSEGV while debugging, click away the debugger message box and look at the stack with the call history. There you'll find the procedure that was last called (as JKSH wrote).

Log in to reply