Segfault when constructing QImage in PyQt6

RoadrunnerWMC roadrunnerwmc at gmail.com
Fri Oct 15 22:19:16 BST 2021


Hm, equivalent programs in Qt 6.2.0 (C++) and PySide6 6.2.0 both work fine,
and I'm not familiar enough with PyQt's code to try to debug it there.
Guess there's not much I can do, then :/

Thanks for looking into it.

On Fri, Oct 15, 2021 at 6:41 AM Phil Thompson <phil at riverbankcomputing.com>
wrote:

> 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,
> >> QtGui.QImage.Format.Format_ARGB32)
> >
> > img.save('test.png')
> >
> >
> > 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
> > corrupt
> > 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.
> >
> > Thanks,
> > RoadrunnerWMC
>
> 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.
>
> Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20211015/ffd2b00f/attachment.htm>


More information about the PyQt mailing list