Custom QQuickWindow crashes when created from QML with PyQt 5.8/Qt 5.8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom QQuickWindow crashes when created from QML with PyQt 5.8/Qt 5.8

Arjen Hiemstra
Hi,

I have attached a minimal test case that crashes when run. The code exposes a
custom QQuickWindow subclass to QML, then uses QML to instantiate it. I have
also attached a C++ file which does the same thing as the Python code, but does
not crash. The same code also works fine when run with PyQt 5.7.1/Qt 5.7.

Additionally, changing all the property assignments to a Component.onCompleted
signal handler will not crash. But that means manually setting up connections
for signals, which gets ugly really fast.

This is the backtrace:

#0  0x00007ffff5b26594 in QWindow::screen() const () from /usr/lib/
libQt5Gui.so.5
#1  0x00007ffff5b28e8d in QWindowPrivate::applyCursor() () from /usr/lib/
libQt5Gui.so.5
#2  0x00007ffff5b2a7bb in QWindow::setVisible(bool) () from /usr/lib/
libQt5Gui.so.5
#3  0x00007ffff5b2c7a8 in ?? () from /usr/lib/libQt5Gui.so.5
#4  0x00007fffedb58aa8 in ?? () from /usr/lib/libQt5Qml.so.5
#5  0x00007fffedbd9d3a in ?? () from /usr/lib/libQt5Qml.so.5
#6  0x00007fffedbdd56c in ?? () from /usr/lib/libQt5Qml.so.5
#7  0x00007fffedbded6c in ?? () from /usr/lib/libQt5Qml.so.5
#8  0x00007fffedbdb392 in ?? () from /usr/lib/libQt5Qml.so.5
#9  0x00007fffedbdc104 in ?? () from /usr/lib/libQt5Qml.so.5
#10 0x00007fffedbdd18e in ?? () from /usr/lib/libQt5Qml.so.5
#11 0x00007fffedb5ca67 in QQmlComponentPrivate::beginCreate(QQmlContextData*)
() from /usr/lib/libQt5Qml.so.5
#12 0x00007fffedb59f69 in QQmlComponent::create(QQmlContext*) () from /usr/
lib/libQt5Qml.so.5
#13 0x00007fffedbd0c83 in QQmlApplicationEnginePrivate::_q_finishLoad(QObject*)
() from /usr/lib/libQt5Qml.so.5
#14 0x00007fffedbd0e92 in QQmlApplicationEnginePrivate::startLoad(QUrl const&,
QByteArray const&, bool) () from /usr/lib/libQt5Qml.so.5
#15 0x00007fffedbd0ff0 in QQmlApplicationEngine::load(QString const&) () from
/usr/lib/libQt5Qml.so.5
#16 0x00007fffedf64390 in meth_QQmlApplicationEngine_load
(sipSelf=0x7fffee2683a8, sipArgs=0x7fffee222828) at
sipQtQmlQQmlApplicationEngine.cpp:375
#17 0x00007ffff741891f in _PyCFunction_FastCallDict () from /usr/lib/
libpython3.6m.so.1.0
#18 0x00007ffff7427a0f in ?? () from /usr/lib/libpython3.6m.so.1.0
#19 0x00007ffff73e3d77 in _PyEval_EvalFrameDefault () from /usr/lib/
libpython3.6m.so.1.0
#20 0x00007ffff7427f47 in PyEval_EvalCodeEx () from /usr/lib/libpython3.6m.so.
1.0
#21 0x00007ffff73e3a5b in PyEval_EvalCode () from /usr/lib/libpython3.6m.so.
1.0
#22 0x00007ffff74acdc2 in ?? () from /usr/lib/libpython3.6m.so.1.0
#23 0x00007ffff74af62d in PyRun_FileExFlags () from /usr/lib/libpython3.6m.so.
1.0
#24 0x00007ffff74af817 in PyRun_SimpleFileExFlags () from /usr/lib/
libpython3.6m.so.1.0
#25 0x00007ffff74a46f1 in Py_Main () from /usr/lib/libpython3.6m.so.1.0
#26 0x0000000000400a5d in main ()

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

pyqt_bug.qml (133 bytes) Download Attachment
pyqt_bug.cpp (534 bytes) Download Attachment
pyqt_bug.py (485 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Custom QQuickWindow crashes when created from QML with PyQt 5.8/Qt 5.8

Cody Scott-2
This "stops working" on Windows 10 with PyQt5==5.8

Also thanks for the minimal C++ code!


On Mon, Feb 20, 2017 at 11:33 AM, Arjen Hiemstra <[hidden email]> wrote:
Hi,

I have attached a minimal test case that crashes when run. The code exposes a
custom QQuickWindow subclass to QML, then uses QML to instantiate it. I have
also attached a C++ file which does the same thing as the Python code, but does
not crash. The same code also works fine when run with PyQt 5.7.1/Qt 5.7.

Additionally, changing all the property assignments to a Component.onCompleted
signal handler will not crash. But that means manually setting up connections
for signals, which gets ugly really fast.

This is the backtrace:

#0  0x00007ffff5b26594 in QWindow::screen() const () from /usr/lib/
libQt5Gui.so.5
#1  0x00007ffff5b28e8d in QWindowPrivate::applyCursor() () from /usr/lib/
libQt5Gui.so.5
#2  0x00007ffff5b2a7bb in QWindow::setVisible(bool) () from /usr/lib/
libQt5Gui.so.5
#3  0x00007ffff5b2c7a8 in ?? () from /usr/lib/libQt5Gui.so.5
#4  0x00007fffedb58aa8 in ?? () from /usr/lib/libQt5Qml.so.5
#5  0x00007fffedbd9d3a in ?? () from /usr/lib/libQt5Qml.so.5
#6  0x00007fffedbdd56c in ?? () from /usr/lib/libQt5Qml.so.5
#7  0x00007fffedbded6c in ?? () from /usr/lib/libQt5Qml.so.5
#8  0x00007fffedbdb392 in ?? () from /usr/lib/libQt5Qml.so.5
#9  0x00007fffedbdc104 in ?? () from /usr/lib/libQt5Qml.so.5
#10 0x00007fffedbdd18e in ?? () from /usr/lib/libQt5Qml.so.5
#11 0x00007fffedb5ca67 in QQmlComponentPrivate::beginCreate(QQmlContextData*)
() from /usr/lib/libQt5Qml.so.5
#12 0x00007fffedb59f69 in QQmlComponent::create(QQmlContext*) () from /usr/
lib/libQt5Qml.so.5
#13 0x00007fffedbd0c83 in QQmlApplicationEnginePrivate::_q_finishLoad(QObject*)
() from /usr/lib/libQt5Qml.so.5
#14 0x00007fffedbd0e92 in QQmlApplicationEnginePrivate::startLoad(QUrl const&,
QByteArray const&, bool) () from /usr/lib/libQt5Qml.so.5
#15 0x00007fffedbd0ff0 in QQmlApplicationEngine::load(QString const&) () from
/usr/lib/libQt5Qml.so.5
#16 0x00007fffedf64390 in meth_QQmlApplicationEngine_load
(sipSelf=0x7fffee2683a8, sipArgs=0x7fffee222828) at
sipQtQmlQQmlApplicationEngine.cpp:375
#17 0x00007ffff741891f in _PyCFunction_FastCallDict () from /usr/lib/
libpython3.6m.so.1.0
#18 0x00007ffff7427a0f in ?? () from /usr/lib/libpython3.6m.so.1.0
#19 0x00007ffff73e3d77 in _PyEval_EvalFrameDefault () from /usr/lib/
libpython3.6m.so.1.0
#20 0x00007ffff7427f47 in PyEval_EvalCodeEx () from /usr/lib/libpython3.6m.so.
1.0
#21 0x00007ffff73e3a5b in PyEval_EvalCode () from /usr/lib/libpython3.6m.so.
1.0
#22 0x00007ffff74acdc2 in ?? () from /usr/lib/libpython3.6m.so.1.0
#23 0x00007ffff74af62d in PyRun_FileExFlags () from /usr/lib/libpython3.6m.so.
1.0
#24 0x00007ffff74af817 in PyRun_SimpleFileExFlags () from /usr/lib/
libpython3.6m.so.1.0
#25 0x00007ffff74a46f1 in Py_Main () from /usr/lib/libpython3.6m.so.1.0
#26 0x0000000000400a5d in main ()

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Custom QQuickWindow crashes when created from QML with PyQt 5.8/Qt 5.8

Phil Thompson-5
In reply to this post by Arjen Hiemstra
On 20 Feb 2017, at 4:33 pm, Arjen Hiemstra <[hidden email]> wrote:
>
> Hi,
>
> I have attached a minimal test case that crashes when run. The code exposes a
> custom QQuickWindow subclass to QML, then uses QML to instantiate it. I have
> also attached a C++ file which does the same thing as the Python code, but does
> not crash. The same code also works fine when run with PyQt 5.7.1/Qt 5.7.

Should be fixed in tonight's snapshot. The problem was caused by a change in the Qml internals in Qt v5.8.0. I'd recommend people test as much as possible in case there are other similar issues.

Thanks,
Phil
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Custom QQuickWindow crashes when created from QML with PyQt 5.8/Qt 5.8

Cody Scott-2
This works with PyQt5==5.10 but does not work with PyQt5==5.10.1
https://www.riverbankcomputing.com/pipermail/pyqt/2017-February/038875.html

I believe this fix may have been reverted to fix the QML examples.

https://www.riverbankcomputing.com/pipermail/pyqt/2018-January/039989.html



On Fri, Feb 24, 2017 at 11:27 AM, Phil Thompson <[hidden email]> wrote:
On 20 Feb 2017, at 4:33 pm, Arjen Hiemstra <[hidden email]> wrote:
>
> Hi,
>
> I have attached a minimal test case that crashes when run. The code exposes a
> custom QQuickWindow subclass to QML, then uses QML to instantiate it. I have
> also attached a C++ file which does the same thing as the Python code, but does
> not crash. The same code also works fine when run with PyQt 5.7.1/Qt 5.7.

Should be fixed in tonight's snapshot. The problem was caused by a change in the Qml internals in Qt v5.8.0. I'd recommend people test as much as possible in case there are other similar issues.

Thanks,
Phil
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Custom QQuickWindow crashes when created from QML with PyQt 5.8/Qt 5.8

Phil Thompson-5
On 28 Feb 2018, at 2:20 pm, Cody Scott <[hidden email]> wrote:
>
> This works with PyQt5==5.10 but does not work with PyQt5==5.10.1
> https://www.riverbankcomputing.com/pipermail/pyqt/2017-February/038875.html
>
> I believe this fix may have been reverted to fix the QML examples.
>
> https://www.riverbankcomputing.com/pipermail/pyqt/2018-January/039989.html

This should be fixed in tonight's snapshot.

*Please* test with a more realistic example.

Phil

> On Fri, Feb 24, 2017 at 11:27 AM, Phil Thompson <[hidden email]> wrote:
> On 20 Feb 2017, at 4:33 pm, Arjen Hiemstra <[hidden email]> wrote:
> >
> > Hi,
> >
> > I have attached a minimal test case that crashes when run. The code exposes a
> > custom QQuickWindow subclass to QML, then uses QML to instantiate it. I have
> > also attached a C++ file which does the same thing as the Python code, but does
> > not crash. The same code also works fine when run with PyQt 5.7.1/Qt 5.7.
>
> Should be fixed in tonight's snapshot. The problem was caused by a change in the Qml internals in Qt v5.8.0. I'd recommend people test as much as possible in case there are other similar issues.
>
> Thanks,
> Phil
> _______________________________________________
> PyQt mailing list    [hidden email]
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt