Qt World Summit: Register Today!

QDomDocument makes Ubuntu unresponsive -> had to reboot

  • In a case of a rather stupid error in looping over a childs of a QDomElement, I got the effect that Ubuntu become unresponsive due to accessing the harddisk like crazy. After I finally succeeded to kill my application by means of activating the closeEvent event of my main window, Ubuntu stayed unresponsive and the only solution was to reboot the system! Rebooting made Ubuntu do some clean or repair actions for the harddisk...

    Only after several occurrences I observed my mistake. I used the following code

    for (QDomElement ChildNode = ParentNode.firstChildElement("child"); !ChildNode.isNotation(); ChildNode = ChildNode.nextSiblingElement("child"))

    where the call to isNotation was probably a result of the autocompletion facility of Qt Creator. This however caused the issue as it should have been a call to toNull.

    The reason for putting this here is that I was rather surprised by the fact that the system remained unresponsive after exiting my application. Not sure whether Qt could have prevented that.

  • Lifetime Qt Champion


    Likely not.

    You probably have exhausted the RAM of your system that switched to SWAP which might also have been exhausted and IIRC it takes much time to recover from that.

    Out of curiosity, what kind of HDD do you have in your system ?

  • An ordinary mechanical SATA HDD

  • Lifetime Qt Champion

    Depending on the motor speed it is also to account on the recovery time.

Log in to reply