[PyQt] PyQt5 Segmentation Fault for QtQuick List Properties

Phil Thompson phil at riverbankcomputing.com
Fri Nov 11 13:12:15 GMT 2016


On 5 Nov 2016, at 12:58 pm, Louis Simons <lousimons at gmail.com> wrote:
> 
> I installed the latest SIP snapshot (4.19.dev1610281521), but when I try to compile the latest PyQt5 snapshot, I get the following compilation error.  I found a reference to it possibly (though unlikely) being related to building on an old GCC (4.5, https://sourceforge.net/p/kmymoney2/bugs/401/), but I'm currently on GCC 5.4.0.
> 
> In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qsurfaceformat.h:37:0,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtGui/QSurfaceFormat:1,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtGui/qopenglcontext.h:45,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtGui/QOpenGLContext:1,
>                  from ../qpy/QtGui/qpyopengl_api.h:31,
>                  from /home/lsimons/workspace/PyQt5_gpl-5.7.1.dev1611041415/sip/QtGui/qopenglshaderprogram.sip:332,
>                  from sipQtGuiQVector0600QPair24000100QColor.cpp:24:
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qpair.h: In instantiation of ‘struct QPair<double, QColor>’:
> sip/QtCore/qpycore_qvector.sip:304:48:   required from here
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qpair.h:85:8: error: ‘QPair<T1, T2>::second’ has incomplete type
>      T2 second;
>         ^
> In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMetaType:1:0,
>                  from sipAPIQtGui.h:33,
>                  from sipQtGuiQVector0600QPair24000100QColor.cpp:24:
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:1874:1: note: forward declaration of ‘class QColor’
>  QT_FOR_EACH_STATIC_GUI_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
>  ^
> sip/QtCore/qpycore_qvector.sip: In function ‘PyObject* convertFrom_QVector_0600QPair_2400_0100QColor(void*, PyObject*)’:
> sip/QtCore/qpycore_qvector.sip:151:41: error: invalid use of incomplete type ‘class QColor’
> In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMetaType:1:0,
>                  from sipAPIQtGui.h:33,
>                  from sipQtGuiQVector0600QPair24000100QColor.cpp:24:
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:1874:1: note: forward declaration of ‘class QColor’
>  QT_FOR_EACH_STATIC_GUI_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
>  ^
> sip/QtCore/qpycore_qvector.sip:157:20: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
> sip/QtCore/qpycore_qvector.sip:151:17: warning: ‘s2’ has incomplete type
> In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMetaType:1:0,
>                  from sipAPIQtGui.h:33,
>                  from sipQtGuiQVector0600QPair24000100QColor.cpp:24:
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:1874:1: note: forward declaration of ‘class QColor’
>  QT_FOR_EACH_STATIC_GUI_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
>  ^
> sip/QtCore/qpycore_qvector.sip:157:20: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
> In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1098:0,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:38,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMetaType:1,
>                  from sipAPIQtGui.h:33,
>                  from sipQtGuiQVector0600QPair24000100QColor.cpp:24:
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qtypeinfo.h: In instantiation of ‘class QTypeInfo<QColor>’:
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qtypeinfo.h:119:46:   required from ‘class QTypeInfoMerger<QPair<double, QColor>, double, QColor, double, double>’
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qpair.h:95:7:   required from ‘class QTypeInfo<QPair<double, QColor> >’
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h:609:9:   required from ‘void QVector<T>::append(const T&) [with T = QPair<double, QColor>]’
> sip/QtCore/qpycore_qvector.sip:304:49:   required from here
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qtypeinfo.h:58:26: error: invalid application of ‘sizeof’ to incomplete type ‘QColor’
>          isLarge = (sizeof(T)>sizeof(void*)),
>                           ^
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qtypeinfo.h:60:24: error: invalid application of ‘sizeof’ to incomplete type ‘QColor’
>          sizeOf = sizeof(T)
>                         ^
> Makefile:1379: recipe for target 'sipQtGuiQVector0600QPair24000100QColor.o' failed
> make[1]: *** [sipQtGuiQVector0600QPair24000100QColor.o] Error 1

It's a SIP regression - fixed in tonight's snapshot.

Thanks,
Phil


More information about the PyQt mailing list