[PyQt] Basic QML test seg faults in PyQT but not QT on Linux

Louis Simons lousimons at gmail.com
Sat Sep 17 22:04:33 BST 2016


>
> On 17 Sep 2016, at 2:39 am, Louis Simons <lousimons at gmail.com> wrote:
> >
> >
> > Ok.  I'm hoping someone on Linux will chime in for confirmation.  This
> seg. fault doesn't make sense as there's definitely people using QML in
> PyQT in recent versions.  Is there anyway to identify the source of the
> seg. fault?
> >
> > I added the backtrace to
> http://stackoverflow.com/questions/39381009/simple-pyqt5-qml-application-causes-segmentation-fault.
> It all seems to be a result of __strstr_sse2 receiveing a null pointer from
> haystack_start.  While this seems like a graphics driver bug (
> https://bugs.kde.org/show_bug.cgi?id=348812), it works in the C++
> version, so is it possible there's a problem in a PyQT binding?
>
> Unlikely.
>

I agree it's unlikely, but if the exact same C++ program works without a
seg. fault, and the PyQT version crashes, what else could it be?  The C++
is the following:

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>

    int main(int argc, char *argv[]) {
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("simple.qml")));
        return app.exec();
    }

The Python is the following:

    from sys import argv, exit
    from PyQt5.QtGui import QGuiApplication
    from PyQt5.QtQml import QQmlApplicationEngine

    def main():
        app = QGuiApplication(argv)
        engine = QQmlApplicationEngine()
        engine.load('simple.qml')
        exit(app.exec_())

    if __name__ == '__main__':
        main()

Thanks,
Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160917/15e13ccd/attachment.html>


More information about the PyQt mailing list