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. Help! Windows QML Image corruption/crash problem
Forum Updated to NodeBB v4.3 + New Features

Help! Windows QML Image corruption/crash problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.8k 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.
  • M Offline
    M Offline
    marksutton
    wrote on last edited by
    #1

    I have a large and rambling Windows QML/Javascript/C++ game project that's developed a mysterious and intermittent crash - I'm running out of ideas for what might be causing it, so was hoping that someone here might be able to give me some ideas.

    After playing for a while, the game starts displaying corrupted images apparently at random - sometimes these look like noise, sometimes like other images, sometimes like bits of screen texture (e.g. they have text overlaid by the program appearing as part of the image). Eventually program freezes or crashes after these corruption issues become worse. To my mind this smacks of memory corruption. On one occasion at least Windows has reported a graphics-driver crash when the program went down.

    Images are simply QML Images as part of compound QML items. Sources are set dynamically using JS (not via C++), and items are loaded dynamically (again via JS). The program is pretty big, and there QML items in existence at any one time

    The problem doesn't seem to occur on every machine. I've yet to identify any pattern, but I have one Win7 64 machine on which it occurs, and another on which it doesn't. Graphics driver issues are the obvious suspect, BUT changing from OpenGL to Angle didn't solve anything!

    Thing's I've tried without success:
    Moving from Qt 5.3 -> 5.4
    Moving from MinGW to VCC
    Moving from OpenGL to Angle
    Moving images out of resource files and into 'plain' filesystem

    This MIGHT of course simply be a bug in my code, but if so I would have thought that it would have to be something to do with dynamic creation and destruction of QML items. Careful logging of all such activities reveals no obvious problems - i.e. everything that's created is destroyed, nothing is destroyed that's not created, nothing is destroyed twice.

    Has anyone ever come across anything similar, or have any ideas what the problem might be???

    Thanks!

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

      Solved! In case anyone else runs into this - it was an out-of-memory issue. Seems the Javascript garbage collector, on some machines at least, was not running automatically, or at least not until memory usage approached 2Gb. Inserting timed (and strategic) calls to the JS function gc() keeps memory usage sane, and seems to stop the problem.

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

        OK, scratch that, not fixed, but now understood better. Memory management issue is to to with integrated graphics on some laptops - Intel 4000 at least. Destroyed QML items don't seem to free up allocated video RAM. Any idea how to deal with???

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

          Hi,

          That looks like something you should bring on the interest mailing list. You'll find there Qt's developers/maintainers (this forum is more user oriented)

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

          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