Segfault when constructing QImage in PyQt6
phil at riverbankcomputing.com
Fri Oct 15 11:41:35 BST 2021
On 15/10/2021 07:14, RoadrunnerWMC wrote:
> Hi Phil,
> I believe I found a bug in PyQt6. Test case is very simple:
> from PyQt6 import QtCore, QtGui, QtWidgets
> app = QtWidgets.QApplication()
> img = QtGui.QImage(b'\xff' * (256 * 256 * 4), 256, 256,
> In PyQt5 5.15.4 (adjust the import line to test it), this correctly
> saves a
> white 256x256 png in the current directory.
> In PyQt6 6.2.0 on Ubuntu 20.04, this segfaults on the last line.
> In PyQt6 6.2.0 on Windows 10, it doesn't crash, but the output is a
> image (example attached). I can also make it sometimes do the same on
> Ubuntu by playing with the QImage constructor arguments.
> Let me know if you need any more info.
I can reproduce this on Linux but it works on macOS. The core dump is
within the Qt code so I suspect it's a Qt bug.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 61333 bytes
Desc: not available
More information about the PyQt