Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Getting error ASSERT: "(toFree & objectBitmap[i]) == toFree" in file C:\Users\qt\work\qt\qtdeclarative\src\qml\memory\qv4mm.cpp, line 275
Forum Updated to NodeBB v4.3 + New Features

Getting error ASSERT: "(toFree & objectBitmap[i]) == toFree" in file C:\Users\qt\work\qt\qtdeclarative\src\qml\memory\qv4mm.cpp, line 275

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 2 Posters 503 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.
  • H Offline
    H Offline
    HOUESSOU Alexandre
    wrote on 30 Sept 2024, 12:12 last edited by
    #1

    My Qt application stops during operation returning the following error:

    ASSERT: "(toFree & objectBitmap[i]) == toFree" in file C:\Users\qt\work\qt\qtdeclarative\src\qml\memory\qv4mm.cpp, line 275

    I use Qt 6.6.2 under windows 10 with MSVC2019 as compiler

    J 1 Reply Last reply 30 Sept 2024, 12:20
    0
    • H HOUESSOU Alexandre
      30 Sept 2024, 12:12

      My Qt application stops during operation returning the following error:

      ASSERT: "(toFree & objectBitmap[i]) == toFree" in file C:\Users\qt\work\qt\qtdeclarative\src\qml\memory\qv4mm.cpp, line 275

      I use Qt 6.6.2 under windows 10 with MSVC2019 as compiler

      J Offline
      J Offline
      JonB
      wrote on 30 Sept 2024, 12:20 last edited by
      #2

      @HOUESSOU-Alexandre
      Per my reply at old/deleted https://forum.qt.io/topic/158954/getting-assert-tofree-objectbitmap-i-tofree-in-file-c-users-qt-work-qt-qtdeclarative-src-qml-memory-qv4mm-cpp-line-275-error

      You might get some further information if you ran under a debugger and looked at the stack trace when the assertion fails. But being QML you may not get much useful information that way.

      You may need to show relevant QML code causing the problem.

      H 1 Reply Last reply 30 Sept 2024, 12:40
      0
      • J JonB
        30 Sept 2024, 12:20

        @HOUESSOU-Alexandre
        Per my reply at old/deleted https://forum.qt.io/topic/158954/getting-assert-tofree-objectbitmap-i-tofree-in-file-c-users-qt-work-qt-qtdeclarative-src-qml-memory-qv4mm-cpp-line-275-error

        You might get some further information if you ran under a debugger and looked at the stack trace when the assertion fails. But being QML you may not get much useful information that way.

        You may need to show relevant QML code causing the problem.

        H Offline
        H Offline
        HOUESSOU Alexandre
        wrote on 30 Sept 2024, 12:40 last edited by
        #3

        @JonB I added these lines in my main method:
        qputenv("QT_DEBUG_PLUGINS", "1");
        qputenv("QML_IMPORT_TRACE", "1");

        I then looked in the debug information but the only concrete information I found was what I mentioned in the post.

        Until a few days ago, I continued to work normally on the application. I hadn't noticed anything. It was after compiling the application and sending it for testing that I was notified of the problem. So I'm having a lot of trouble finding exactly the part concerned and the debug information isn't helping me much at the moment.

        J 1 Reply Last reply 30 Sept 2024, 12:50
        0
        • H HOUESSOU Alexandre
          30 Sept 2024, 12:40

          @JonB I added these lines in my main method:
          qputenv("QT_DEBUG_PLUGINS", "1");
          qputenv("QML_IMPORT_TRACE", "1");

          I then looked in the debug information but the only concrete information I found was what I mentioned in the post.

          Until a few days ago, I continued to work normally on the application. I hadn't noticed anything. It was after compiling the application and sending it for testing that I was notified of the problem. So I'm having a lot of trouble finding exactly the part concerned and the debug information isn't helping me much at the moment.

          J Offline
          J Offline
          JonB
          wrote on 30 Sept 2024, 12:50 last edited by JonB
          #4

          @HOUESSOU-Alexandre
          I don't think those environment variables will reveal much for this error. I did mean actually run under a debugger to see the stack trace when it asserts. But I don't know how much that would reveal/help.

          I don't have Qt/QML source, but in Qt5 at a slightly different line number but doubtless the same function I see at https://codebrowser.dev/qt5/qtdeclarative/src/qml/memory/qv4mm.cpp.html#318

                  quintptr toFree = objectBitmap[i] ^ blackBitmap[i];
                  Q_ASSERT((toFree & objectBitmap[i]) == toFree); // check all black objects are marked as being used
          

          So it is failing on you having "a black object which should be marked as being used/needing freeing", but it's not. Goodness knows how you get into this situation or what you are supposed to do about it.

          I do not use QML. You will have to wait to see whether anybody else picks this up and suggests something to you....

          H 2 Replies Last reply 30 Sept 2024, 17:49
          0
          • J JonB
            30 Sept 2024, 12:50

            @HOUESSOU-Alexandre
            I don't think those environment variables will reveal much for this error. I did mean actually run under a debugger to see the stack trace when it asserts. But I don't know how much that would reveal/help.

            I don't have Qt/QML source, but in Qt5 at a slightly different line number but doubtless the same function I see at https://codebrowser.dev/qt5/qtdeclarative/src/qml/memory/qv4mm.cpp.html#318

                    quintptr toFree = objectBitmap[i] ^ blackBitmap[i];
                    Q_ASSERT((toFree & objectBitmap[i]) == toFree); // check all black objects are marked as being used
            

            So it is failing on you having "a black object which should be marked as being used/needing freeing", but it's not. Goodness knows how you get into this situation or what you are supposed to do about it.

            I do not use QML. You will have to wait to see whether anybody else picks this up and suggests something to you....

            H Offline
            H Offline
            HOUESSOU Alexandre
            wrote on 30 Sept 2024, 17:49 last edited by
            #5

            @JonB said in Getting error ASSERT: "(toFree & objectBitmap[i]) == toFree" in file C:\Users\qt\work\qt\qtdeclarative\src\qml\memory\qv4mm.cpp, line 275:

            Q_ASSERT((toFree & objectBitmap[i]) == toFree);

            Hello my dear!
            I'll look some more and come back with more details.
            Thank you very much

            1 Reply Last reply
            0
            • J JonB
              30 Sept 2024, 12:50

              @HOUESSOU-Alexandre
              I don't think those environment variables will reveal much for this error. I did mean actually run under a debugger to see the stack trace when it asserts. But I don't know how much that would reveal/help.

              I don't have Qt/QML source, but in Qt5 at a slightly different line number but doubtless the same function I see at https://codebrowser.dev/qt5/qtdeclarative/src/qml/memory/qv4mm.cpp.html#318

                      quintptr toFree = objectBitmap[i] ^ blackBitmap[i];
                      Q_ASSERT((toFree & objectBitmap[i]) == toFree); // check all black objects are marked as being used
              

              So it is failing on you having "a black object which should be marked as being used/needing freeing", but it's not. Goodness knows how you get into this situation or what you are supposed to do about it.

              I do not use QML. You will have to wait to see whether anybody else picks this up and suggests something to you....

              H Offline
              H Offline
              HOUESSOU Alexandre
              wrote on 30 Sept 2024, 20:45 last edited by
              #6

              @JonB

              Hello my dear!
              Using the QML profiler, I was able to identify the origin of the problem.

              I currently have 3 js files: app.js, main.js and countries.js. The main.js file contains my main js functions. The countries.js file should contain the list of countries in a constant and functions to manipulate them. I import all my js files into app.js. The countries.js file was recently added. While I was working there, I had an emergency. So I stopped the work by leaving in countries.js an empty array const and a function that does nothing.

              const list = [];
              function func() {
              
              }
              

              This is what was causing the problem. I just commented out the countries.js import statement in app.js and it fixed the problem.
              Thanks for the guidance.

              1 Reply Last reply
              0
              • H HOUESSOU Alexandre has marked this topic as solved on 1 Oct 2024, 16:12

              1/6

              30 Sept 2024, 12:12

              • Login

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