Getting segfault for no reason



  • I am trying to debug a code that I worked on, but it's giving me segfault although the last time I worked on it, it worked. I am also getting segfault on all the previous version of the same code that worked not long ago? I checked my memory and there doesn't seem to be anything wrong. Also, now it won't even output anything. Just a minute ago, it would at least output a few lines of code. This is driving me insane. Also, even before that, the code didn't work at the first attempt. I had to run it twice and after that it would run fine indefinitely.

    UPDATE:

    I am getting instant segfault now.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What does a run through the debugger give ?

    Depending on your changes, did you do a full rebuild ?

    What Qt/OS combination are you using ?



  • Initially, I got some output, now, it doesn't give me anything.

    I tried rebuilding everything, but it didn't change anything.

    I am using QT 5.2.0 on Windows.



  • I am reinstalling the program to see if the problem persists.




  • Moderators

    [quote author="debugg" date="1392511075"]http://i.stack.imgur.com/bxJaK.jpg

    I am getting this[/quote]Hi,

    Pay attention to the bottom-left window (a table with the headers "Level", "Function", "File", and "Line". That's a stack trace. It helps you track down the function calls that cause the segfault.

    What compiler are you using? Do you have multiple compilers installed in your system?



  • ermm.. yeah should I just reinstall the program?

    I am currently downloading ver 5.1.0.

    Do I just have to install it, or do I need to do something more?

    The first time I installed it, I just had to open the executable.


  • Moderators

    [quote author="debugg" date="1392515317"]ermm.. yeah should I just reinstall the program?[/quote]The code that you showed us did not use anything from Qt, so I don't think reinstalling will help you.

    I can think of 2 possibilities:

    • Your compiler is producing broken code, OR
    • Your program is loading the wrong DLLs at startup

    To solve your problem, please tell us what compiler you are using: MinGW or Visual Studio?

    (Are there any terms that I used that you don't understand? I can elaborate further if you like)

    [quote]I am currently downloading ver 5.1.0. [/quote]That's old. I recommend Qt 5.2.1: http://qt-project.org/downloads

    [quote author="debugg" date="1392515317"]Do I just have to install it, or do I need to do something more?

    The first time I installed it, I just had to open the executable.[/quote]For Qt's part, you just need to install it.

    However, Qt Creator relies on other things in your system (like a compiler, which is NOT is not part of Qt). You might need to do extra setup for your compiler, or you might need to clean your system to make sure there are no conflicting files.



  • Wow... I reinstalled the program and it worked the first time and then it doesn't work anymore.



  • I am using the MinGw compiler.

    I get these messages:

    Error while parsing file C:/Users/.../untitled/untitled.pro. Giving up.
    Could not find qmake configuration file default.
    Error while parsing file C:/Qt/Qt5.2.1/Tools/QtCreator/bin/assign2/assign2.pro. Giving up.
    Could not find qmake configuration file default.

    21:41:38: Running steps for project untitled1...
    21:41:38: Configuration unchanged, skipping qmake step.
    21:41:38: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
    C:/Qt/Qt5.2.1/Tools/mingw48_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.2.1/Tools/QtCreator/bin/build-untitled1-Desktop_Qt_5_2_1_MinGW_32bit-Debug'
    mingw32-make[1]: Nothing to be done for 'first'.
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.2.1/Tools/QtCreator/bin/build-untitled1-Desktop_Qt_5_2_1_MinGW_32bit-Debug'
    21:41:39: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
    21:41:39: Elapsed time: 00:01.



  • I don't think it's my compiler. I mean it worked the first time I compiled it and then after that it stopped working.



  • bq. Function: ntdll!RtlAppendStringToString
    0x771745e1 <+0x05b8> add %al,(



  • I had some hardware problems. My computer crashed and I had to remove the dust. Maybe the problem is related to that.



  • Wow, fuck!! Those little...!!!!!!!!!

    I disabled some process called search protect conduit, which is supposedly a malware and now it's working. LOL THOSE LITTLE WORMS!!! Sorry.

    I was getting seg fault probably because they were getting access to some protected parts of the memory or something.


  • Moderators

    [quote author="debugg" date="1392520256"]Wow, fuck!! Those little...!!!!!!!!!

    I disabled some process called search protect conduit, which is supposedly a malware and now it's working. LOL THOSE LITTLE WORMS!!! Sorry.

    I was getting seg fault probably because they were getting access to some protected parts of the memory or something.[/quote]Ouch! I hate malware.

    I'm glad that you've found a solution. All the best with your projects, and feel free to post back if you have any other questions.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.