My Qt 6.6.0 code crashs in debug mode (~QArrayDataPointer()) and not on release on Windows
-
QArrayDataPointer is a fundamental piece of a lot of basic qt classes. I doubt you found a bug in there. You do something wrong with your threading.
-
@Nelson-numerical-software said in My Qt 6.6.0 code crashs in debug mode (~QArrayDataPointer()) and not on release on Windows:
When you invest in Qt for a long time. You can also expect to no have some breaking change without visible warnings :p
That is true if your code is correct. However, if your code has some "fault" which has not shown up before and happens to go wrong now with a change of environment this happens. And it is the case that where a threading issue is involved you never know what changed circumstances may make it appear. It is the same with any code, nothing to do with Qt.
-
Thank you for these comprehensive comments. :)
Great work from the developers for this 6.6.0 with many new features.
I have my answer
-
-
Your pragma(lib) stuff in dllmain.cpp is wrong. You must not mix debug and release libraries on windows. I would remove this MSVC only stuff and let do cmake the correct things.
-
-
@Christian-Ehrlicher said in My Qt 6.6.0 code crashs in debug mode (~QArrayDataPointer()) and not on release on Windows:
Your pragma(lib) stuff in dllmain.cpp is wrong. You must not mix debug and release libraries on windows. I would remove this MSVC only stuff and let do cmake the correct things.
I confirm that it was the trouble
on windows debug build must be linked with Qt debug library
Thanks for your time and investigations
-
Can you explain what you changed to fix this issue ?
As I am also facing the similar problem. I am using already built MSVC 2019 64 bit compiled libraries from QT 6.6.3 with VS 2022 C++ 64 bit application. My application is wrote for Debug and Release configuration. In both modes the crash is happening. -
Thanks @Nelson-numerical-software I had the exact same problem too. Easy mistake to make in Visual C++ when updating Qt versions and modifying linker input file list.
-
@KeithS said in My Qt 6.6.0 code crashs in debug mode (~QArrayDataPointer()) and not on release on Windows:
and modifying linker input file list.
That's the reason to use a build system like e.g. CMake.
-
Hi guys. I just came to the same issue on 6.8.2 where even the code below crashes on exactly the same space as above where the code run perfect before. So what changed... the build was done on w10 (months ago) and then after a format w11 was installed with a clean VS2022 installation. Since this happened qt crashes all the time. Now project didn't change so w10->w11 transition has to be the culprit. I'll edit this post after I'll rebuild 6.8.2 on w11.
int main( int argc, char *argv[] )
{
QVector<JSON_Object> value_object_list;JSON_Object e1; JSON_Object e2; JSON_Object e3; JSON_Object e4; JSON_Object e5; value_object_list.append( e1 ); value_object_list.append( e2 ); value_object_list.append( e3 ); value_object_list.append( e4 ); value_object_list.append( e5 );
-
Don't mix debug and release libraries.