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. QT 5.15 Windows Crash on deallocation of QModelIndexList
Forum Updated to NodeBB v4.3 + New Features

QT 5.15 Windows Crash on deallocation of QModelIndexList

Scheduled Pinned Locked Moved Solved General and Desktop
windows5.15.2
4 Posts 3 Posters 1.3k 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.
  • T Offline
    T Offline
    The Force
    wrote last edited by
    #1

    I'm with the Freespace 2 SCP and we are getting a crash on deallocation of QModelndexList on debug. I know this is similar to several previous reports. I am on windows 11 and installed Qt Using the online installer. We are almost certainly linking to the correct libraries as the images below show.
    Can anybody help?

    The error message we are getting is this.
    30fdad8c-9097-4c0f-9463-46bf24305778-image.png
    The relevant section of code.

    	auto list = ui->shipCombo->model()->match(ui->shipCombo->model()->index(0, 0), Qt::UserRole, ship_class);
    	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
    		ui->shipCombo->setCurrentIndex(list.first().row());
    	} else {
                 //Show error message
    	}
    
    	list =
    		ui->variableCombo->model()->match(ui->variableCombo->model()->index(0, 0), Qt::UserRole, variable);
    	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
    		ui->variableCombo->setCurrentIndex(list.first().row());
    	} else {
    		//Show error message
    	}
    

    Here is the proof that we are linking to the right libraries given that that seems to be the most common solution provided.
    eecf00b8-f516-4853-9579-a1ca8f938976-image.png
    2eafccab-53e9-4d7f-8d30-cfec3b201c7e-image.png

    JonBJ Axel SpoerlA 2 Replies Last reply
    0
    • T The Force

      I'm with the Freespace 2 SCP and we are getting a crash on deallocation of QModelndexList on debug. I know this is similar to several previous reports. I am on windows 11 and installed Qt Using the online installer. We are almost certainly linking to the correct libraries as the images below show.
      Can anybody help?

      The error message we are getting is this.
      30fdad8c-9097-4c0f-9463-46bf24305778-image.png
      The relevant section of code.

      	auto list = ui->shipCombo->model()->match(ui->shipCombo->model()->index(0, 0), Qt::UserRole, ship_class);
      	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
      		ui->shipCombo->setCurrentIndex(list.first().row());
      	} else {
                   //Show error message
      	}
      
      	list =
      		ui->variableCombo->model()->match(ui->variableCombo->model()->index(0, 0), Qt::UserRole, variable);
      	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
      		ui->variableCombo->setCurrentIndex(list.first().row());
      	} else {
      		//Show error message
      	}
      

      Here is the proof that we are linking to the right libraries given that that seems to be the most common solution provided.
      eecf00b8-f516-4853-9579-a1ca8f938976-image.png
      2eafccab-53e9-4d7f-8d30-cfec3b201c7e-image.png

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote last edited by Axel Spoerl
      #4

      @The-Force said in QT 5.15 Windows Crash on deallocation of QModelIndexList:

      __acrt_first_block == header

      ...usually points at out-of-bounds access.

      if (!list.empty() || ui->classList->model()->rowCount() == 0)
           ui->shipCombo->setCurrentIndex(list.first().row());
      

      If list is empty and the model's row count is zero, list.first() causes a read out of bounds and is probably the reason for the crash.

      Something like

      if (!list.empty() && ui->classList->model()->rowCount() != 0)
           ui->shipCombo->setCurrentIndex(list.first().row());
      

      ...would make more sense to me.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      2
      • T The Force

        I'm with the Freespace 2 SCP and we are getting a crash on deallocation of QModelndexList on debug. I know this is similar to several previous reports. I am on windows 11 and installed Qt Using the online installer. We are almost certainly linking to the correct libraries as the images below show.
        Can anybody help?

        The error message we are getting is this.
        30fdad8c-9097-4c0f-9463-46bf24305778-image.png
        The relevant section of code.

        	auto list = ui->shipCombo->model()->match(ui->shipCombo->model()->index(0, 0), Qt::UserRole, ship_class);
        	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
        		ui->shipCombo->setCurrentIndex(list.first().row());
        	} else {
                     //Show error message
        	}
        
        	list =
        		ui->variableCombo->model()->match(ui->variableCombo->model()->index(0, 0), Qt::UserRole, variable);
        	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
        		ui->variableCombo->setCurrentIndex(list.first().row());
        	} else {
        		//Show error message
        	}
        

        Here is the proof that we are linking to the right libraries given that that seems to be the most common solution provided.
        eecf00b8-f516-4853-9579-a1ca8f938976-image.png
        2eafccab-53e9-4d7f-8d30-cfec3b201c7e-image.png

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote last edited by
        #2

        @The-Force said in QT 5.15 Windows Crash on deallocation of QModelIndexList:

        I know this is similar to several previous reports.

        Which reports? Can we have some links?

        1 Reply Last reply
        0
        • T Offline
          T Offline
          The Force
          wrote last edited by
          #3

          Actually I've just found our solution here

          https://forum.qt.io/topic/157255/getting-debug-heap-correction-from-destructor-of-qstringlist/19

          I seems that our camke config has not been linking msvcrtd.lib

          1 Reply Last reply
          0
          • T The Force

            I'm with the Freespace 2 SCP and we are getting a crash on deallocation of QModelndexList on debug. I know this is similar to several previous reports. I am on windows 11 and installed Qt Using the online installer. We are almost certainly linking to the correct libraries as the images below show.
            Can anybody help?

            The error message we are getting is this.
            30fdad8c-9097-4c0f-9463-46bf24305778-image.png
            The relevant section of code.

            	auto list = ui->shipCombo->model()->match(ui->shipCombo->model()->index(0, 0), Qt::UserRole, ship_class);
            	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
            		ui->shipCombo->setCurrentIndex(list.first().row());
            	} else {
                         //Show error message
            	}
            
            	list =
            		ui->variableCombo->model()->match(ui->variableCombo->model()->index(0, 0), Qt::UserRole, variable);
            	if (!list.empty() || ui->classList->model()->rowCount() == 0) {
            		ui->variableCombo->setCurrentIndex(list.first().row());
            	} else {
            		//Show error message
            	}
            

            Here is the proof that we are linking to the right libraries given that that seems to be the most common solution provided.
            eecf00b8-f516-4853-9579-a1ca8f938976-image.png
            2eafccab-53e9-4d7f-8d30-cfec3b201c7e-image.png

            Axel SpoerlA Offline
            Axel SpoerlA Offline
            Axel Spoerl
            Moderators
            wrote last edited by Axel Spoerl
            #4

            @The-Force said in QT 5.15 Windows Crash on deallocation of QModelIndexList:

            __acrt_first_block == header

            ...usually points at out-of-bounds access.

            if (!list.empty() || ui->classList->model()->rowCount() == 0)
                 ui->shipCombo->setCurrentIndex(list.first().row());
            

            If list is empty and the model's row count is zero, list.first() causes a read out of bounds and is probably the reason for the crash.

            Something like

            if (!list.empty() && ui->classList->model()->rowCount() != 0)
                 ui->shipCombo->setCurrentIndex(list.first().row());
            

            ...would make more sense to me.

            Software Engineer
            The Qt Company, Oslo

            1 Reply Last reply
            2
            • T The Force has marked this topic as solved

            • Login

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