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. My Qt 6.6.0 code crashs in debug mode (~QArrayDataPointer()) and not on release on Windows

My Qt 6.6.0 code crashs in debug mode (~QArrayDataPointer()) and not on release on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
24 Posts 8 Posters 2.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.
  • W Offline
    W Offline
    WaldemarH
    wrote on last edited by
    #21

    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 );
    
    1 Reply Last reply
    1
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #22

      Don't mix debug and release libraries.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • S Offline
        S Offline
        snyang
        wrote on last edited by
        #23

        I found one of my debug dll was compiled by using runtime library MultiThreadedDLL.
        After change C/C++ -> runtime library as MultiThreadedDebugDLL in visual studio, the problem is gone.

        Use the tool Dependencies, I can see the bad dll is using:

        image.png

        And the good dll is using:
        f46e8deb-f487-4570-841d-ab9fbd8523d0-image.png

        1 Reply Last reply
        0
        • W Offline
          W Offline
          WaldemarH
          wrote on last edited by
          #24

          Created a new project, build it and all was fine (the same code). And as stated above the reason was mixing of debug/non-debug libraries.
          Now the whole issue as it looks occurred when that Project->Options->Advanced->Use Debug Libraries was set to No (in all VS versions I have never set this value to anything.. I assume it came with VS22). Which caused that Compiler->Code Generation->Runtime libraries switched to non-debug version in the background.

          image.png

          So the solution is to switch the 'Use Debug Libraries' to true and all will be ok.

          1 Reply Last reply
          1

          • Login

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