Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Crash in release mode
Forum Updated to NodeBB v4.3 + New Features

[Solved] Crash in release mode

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Joel BodenmannJ Offline
    Joel BodenmannJ Offline
    Joel Bodenmann
    wrote on last edited by Joel Bodenmann
    #1

    I have a larger application built using Qt 5.4. It works very well in debug mode. However, when running the version compiled with the release mode the application crashes once I click an icon in my QToolBar:

    DBusMenuExporterPrivate::addAction(): Already tracking Action XXX under id YYY

    Can anyone give me a hint how to debug this? In release mode I don't have the debugging symbols available so the debugger doesn't help me at all.
    I create an action and add it to a QMenu and the QToolBar. I assume that this is not a problem because that is how QActions are supposed to be used, right?

    Anyway, I would be thankful for any hint. Google didn't help much and I cannot debug this.

    Industrial process automation software: https://simulton.com
    Embedded Graphics & GUI library: https://ugfx.io

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bnogal
      wrote on last edited by bnogal
      #2

      try these flags in your qmake:

      QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
      QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO

      if it is not enough, build your app on linux and use valgrind.

      1 Reply Last reply
      2
      • Joel BodenmannJ Offline
        Joel BodenmannJ Offline
        Joel Bodenmann
        wrote on last edited by
        #3

        Thank you, these macros are very helpful.

        The error turned out to be that I did: Q_ASSERT(_activeProject->open()); without knowing that Q_ASSERT() has no effect in Release mode (when QT_NO_DEBUG IS TRUE).
        The error message I got (the one I stated in my first post) was therefore completely unrelated to this issue.

        Thank you for the help!

        Industrial process automation software: https://simulton.com
        Embedded Graphics & GUI library: https://ugfx.io

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Q_ASSERT follows the same rules as assert that's why it doesn't do anything in release mode. A rule of thumb is to always check the returned value and not the function itself

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          Joel BodenmannJ 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            Q_ASSERT follows the same rules as assert that's why it doesn't do anything in release mode. A rule of thumb is to always check the returned value and not the function itself

            Joel BodenmannJ Offline
            Joel BodenmannJ Offline
            Joel Bodenmann
            wrote on last edited by
            #5

            @SGaist Thank you for the advice. This is definitely a rule I will always follow from now on :)

            Industrial process automation software: https://simulton.com
            Embedded Graphics & GUI library: https://ugfx.io

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved