VTK rendering window inside a Qt application freezes the Operating System up when resized opaquely/continously.
Hello everyone,
In VTK 9.2.6 debug build, with Qt 5.12.8, when I try to resize the VTK window using the vertical Qt QSplitter widget "opaquely", I have observed that the VTK window freezes up, and the Operating System becomes unresponsive, and has to be hard reset (restarted after shutting off the power to the computer).
By "opaquely", I mean that it's the opaqueResize
feature of the QSplitter widget, and as the QSplitter is moved, the VTK window is resized continuously, and due to this continuous resizing, something goes wrong, and the VTK window freezes up, as described above.
Qt Documentation on opaqueResize
: https://doc.qt.io/qt-5/qsplitter.html#opaqueResize-prop
The VTK window being used here is a QVTKOpenGLNativeWidget
that has been promoted to be used in Qt.
The error is reduced and doesn't happen as often when we disable opaque resizing for the QSplitter, but still I have seen it happen once in a while, but the frequency is somewhat acceptable for now, though it would be good if it was fixed completely. The image below shows how it looks when opaque resizing is disabled. The resizing only happens when we let go off the mouse.
Since the VTK window no longer being continuously resized, the code is more stable, so by deduction, we can say that the continuous resizing is the cause of the bug.
I have a Proof of Concept (POC) code, but the bug is self descriptive and would probably not require a POC. But if you require a POC, I would be happy to submit it.
PS: Interestingly, I don't have a proof, but I was able to switch to a TTY terminal when a freeze up happened, and saw an error message that said that "The system was Out of Memory (OOM)." Meaning that something happens which probably causes VTK to use up a lot of memory. I don't have a proof that that's what happens, but maybe the continuous resizing causes too many buffers to be allocated or something internally.
System : Linux Ubuntu 20.04.01
VTK : 9.2.6 built from source in debug mode
Compiled with : g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0