Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Application crashes when built in debug mode. Runs fine under release and profile



  • In debug mode the program is compiled fine, however when I run it, it crashes. I receive following message under application output

    Starting ....
    The program has unexpectedly finished
    The process was ended forcefully
    .... crashed
    

    I also receive the warning:

    Qt5AxContainerd.lib(qaxbase.obj):-1: warning: LNK4099: PDB 'Qt5AxContainerd.pdb' was not found with 'Qt5AxContainerd.lib(qaxbase.obj)' or at ''; linking object as if no debug info
    

    I was wondering whether this warning could be the reason for the program to crash, ie. debug symbols are located in the .pdb file and since it does not find it, it crashes in debug mode. Which could also explain why it runs fine in profile and release mode.
    I have searched about this warning and it seems that the problem is that the .pdb file path and the path embedded in the corresponding .obj file are different. But I could not understand how this could be changed, such that they are the same.

    I should mention the program worked fine before on a different machine.



  • @saa_
    That warning may or may not be connected to your problem. In any case, since it crashes from debug build run your program under the debugger and look at the stack trace window when it crashes to see the trace back.



  • When I run the program under debugger, I get an error dialog saying
    "The CDB process terminated"
    I use MSVC 32-bit compiler and debugger is auto detected under kits



  • @saa_
    I know nothing about debugging Qt apps under Windows. From what you write, I would probably start by trying to compile & debug a standalone, simple Qt program to verify that debugging with CDB works at all.

    Also probably put a qDebug() statement as the very first line in your faulting application's main() to see whether you get as far as executing the first line or whether the issue/crash comes before you even get going.



  • @JonB thanks for the suggestions

    I put a qDebug statement at the first line and the program crahses before the first line. I tested CDB on another application where it worked fine



  • @saa_ said in Application crashes when built in debug mode. Runs fine under release and profile:

    I put a qDebug statement at the first line and the program crahses before the first line.

    Then I'm not sure debugging is going to tell you much. Since you are 32-bit I believe you compiled all Qt yourself, I would look at that, maybe try to resolve that warning. See if you can see any difference between the machine where it works and the one where it does not, e.g. does one of them have another version of Qt on it/from the past? Message sounds potentially as though it's not picking up the right thing from the right place, possibly. If you can in your faulting application, comment out any & all stuff to do with Qt5Ax temporarily and see if it works OK (or at least gets into main() correctly) without, then you know that is somehow the issue.



  • @JonB
    Thanks for the help. I will try and comment out the stuff with Qt5Ax and see what that leads to.
    I did not compile QT myself, I was just using 32-bit compiler.



  • @saa_ said in Application crashes when built in debug mode. Runs fine under release and profile:

    I did not compile QT myself, I was just using 32-bit compiler.

    ? I don't use Qt under Windows, but I looked around and found references stating that Qt do not release Windows 32-bit built versions...? I refer, for example, to @jsulm's https://forum.qt.io/topic/95823/qt5-32-bit-msvc-2017/2

    There are no official Qt MSVC 32bit builds. If you really need one you will need to build Qt by yourself.

    Maybe you're using MSVC 2015 and that works, I don't know.



  • @JonB
    I should clarify, my machine is 64-bit, I just installed QT IDE and selected MSVC 32-bit and 64-bit compiler. I have just been working with 32-bit compiler. I have now tried the 64-bit compiler crashes regardless of being in debug or profile mode.


  • Lifetime Qt Champion

    @saa_ What Qt version did you install? Qt Company does not provide official 32bit builds for recent Qt versions. So, I guess you have an old Qt version.



  • @jsulm
    I have version 5.15.2


  • Lifetime Qt Champion

    @saa_ Then you installed 64bit version



  • @jsulm
    So I should install an earlier version if I want support for 32 bit. But do you think this relates to the problem 32-bit compiler profile and release mode works and using 64-bit compiler no build version works?


  • Lifetime Qt Champion

    @saa_ Actually I was wrong: using online installer you can still install 32bit Qt builds of Qt5. There are no 32bit builds for Qt6 anymore.



  • @jsulm
    Ah ok, but thanks for the help. I think I will try and reinstall everything, maybe even restore my machine and try again


Log in to reply