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. Heap Corruption
QtWS25 Last Chance

Heap Corruption

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 3.2k Views
  • 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.
  • S Offline
    S Offline
    Sayan Bera
    wrote on last edited by
    #1

    My Qt app represents a vehicle's dashboard. For all the gauges(like speed, rpm, oil), i,m using the QMeter widget(.dll) from qt-apps.org. This qt app is a client getting inputs from another C++ app (server). The qt app crashes sometimes only in debug at _ASSERTE(_CrtIsValidHeapPointer(pUserData)); in the call stack i got, the QMeter::setvalue(double ) is called and few function of qt base class like
    update(),update(QRect), markdirty(QRect,Qwidget,bool,bool),adddirtywidget, Qvector::append, qfree ,free and then it crashes at _ASSERTE(_CrtIsValidHeapPointer(pUserData));
    I,m using VS 2008.
    How to fix this heap corruption?

    Regards
    Sayan

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Can you post some piece of code?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MuldeR
        wrote on last edited by
        #3

        Seems like you are freeing a "dangling" pointer, i.e. a pointer that was never initialized or has already been free'd. The reason why you only see the "crash" in the Debug build is because the Debug CRT contains additional checks to catch this kind of errors. It doesn't mean that the problem doesn't exist in the Release version! Instead it's more likely that the problem remains unnoticed in Release builds and may cause other mischief...

        Try to strip down your program to find the "problematic" code. Other than that, you might be able to track this down with a tool like Bounds Checker or Insure++. And there's always Valgrind, but only on Linux :(

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sayan Bera
          wrote on last edited by
          #4

          Hi mcosta,
          U can find source code of the .dll(ie QMeter) in "http://qt-apps.org/content/show.php?content=72850".

          Regards
          Sayan

          1 Reply Last reply
          0
          • JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            [quote author="Sayan Bera" date="1354944622"]Hi mcosta,
            U can find source code of the .dll(ie QMeter) in "http://qt-apps.org/content/show.php?content=72850".[/quote]If the error is in someone else's code, you'll have to contact the author to correct it. We can only help you with errors in your own code.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            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