Important: Please read the Qt Code of Conduct -

[SOLVED] Debugger constantly stops in qglobal#qVersion()

  • Hey there,

    when debugging via qtcreator (v3.4.2) the debugger (gdb from Qt5.2.1) stops at qglobal qVersion() after each step once it stopped at the first breakpoint. Pressing F5 to go to the next breakpoint does not help.

    Opening the Threads Tab of the breakpoint view, I can see an ntdll!RtEnableEarlyCriticalSectionEventCreation calling qVersion.

    This is quite annoying and I do not understand why debugger stops at that location having no breakpoint. I did not find any configuration in the debugger properties which may causing this behaviour.

    Any idea? What would you help to help?

    Please advice. Much appreciated!



  • Hi and welcome to devnet

    Do you see another popup window indicating a problem?

    When you have encountered a problem in debugger you cannot simply continue assume that the debugger will handle this. The same message and stop will come up repeatbly. That would explain the debhaviour as you describe.

  • @koahnig thanks for welcoming :)

    No, unfortunately there is no info indicating a problem at all. Any idea what I could check else?



  • One thing I noticed:

    The problem only occurs when stepping in a function call (pressing F11) ... After that, it occurs on all debug step actions.

    When I step over (F10) it is working, but forces me to set breakpoints at exactly the right place.

  • Does the problem also occur on small "Hello world" programs?
    What the OS?
    What compiler and version are you using?

  • Hmm, it does not occur (of course) ...

    I tried to step to the location in code where lots of initialization stuff is going on, and now it works again!

    However, now the debugger stops at QCoreApplication app(argc, argv); each time I start the application. Don't ask why. At least this is a location which is reached just once and I could leave with it.

    On the other hand, I still don't understand why the debugger once in a while stops somewhere in code where no breakpoint exist. If tomorrow it would stop anywhere else in code I may have the same problem as in the beginning ...


    • qt: v5.1.2
    • qtcreator: v3.4.2
    • g++/gdb: mingw48_32
    • OS: Windows7 64bit Professional, SP1

  • I have a similar setup on win7, but I am using newer Qt libs 5.4.1,
    Independent of Qt lib versions the debugger stops once at the beginning, but sometimes it doesn't. Also sometimes it has breakpoints but those are not marked in the debugger. Hitting F9 once at such a location does not change anything. Hitting F9 again shows the breakpoint bullet on the left. Therefore, I think this has to do with my multiple sessions I am using. Those session are using parts of the same code, which I think is the explanation. This seems to confuse the debugger setup.

    Anyway you problem seems different. If you do not see the problem with a simple hello world program or with one of the examples, it has something to do with your code. Rerunning qmake in creator and doing a complete rebuild is sometimes helping.
    Otherwise it may have its origin in some static initializations of your code.
    Also you may want to consider updating to newer version of Qt.

  • @koahnig actually the project is using lots of locally compiled libs so a "quick" recompiling is not a possible solution to try out (qt uses different compiler with version newer than v5.2).

    However, once getting back to my problem I tested some debug config checkboxes and it turned out that the debug helpers were the "problem". Turning off showing thread names did not cause the debugger to stop deep in qt code several times anymore.

    In the end it is a pity not understanding what is going on when ticking that config option, though I am glad getting back to debugging now!

Log in to reply