Getting error ASSERT: "(toFree & objectBitmap[i]) == toFree" in file C:\Users\qt\work\qt\qtdeclarative\src\qml\memory\qv4mm.cpp, line 275
-
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
-
@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-errorYou 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.
-
@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.
-
@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....
-
@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 -
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. -