Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-455

APIs with function pointers as arguments crash shiboken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.0
    • None
    • Shiboken
    • None

    Description

      Tried to add QOpenGLContext to the QtGui typesystem which causes shiboken to crash.
      It's related to the function:

          void setQGLContextHandle(void *handle,void (*qGLContextDeleteFunction)(void *));
      

      specifically the parsing of the function pointer seems to be wrong, which happens somewhere in this code

      1  DeclaratorCompiler::visitParameterDeclaration(ParameterDeclarationAST *)                           declarator_compiler.cpp 123 0x1001f4227    
      2  Visitor::visit(AST *)                                                                              visitor.cpp             124 0x10020fb10    
      3  void visitNodes<ParameterDeclarationAST *>(Visitor *, ListNode<ParameterDeclarationAST *> const *) visitor.h               138 0x1001f6c0f    
      4  DefaultVisitor::visitParameterDeclarationClause(ParameterDeclarationClauseAST *)                   default_visitor.cpp     304 0x1001f5f1c    
      5  Visitor::visit(AST *)                                                                              visitor.cpp             124 0x10020fb10    
      6  DeclaratorCompiler::run(DeclaratorAST *)                                                           declarator_compiler.cpp 72  0x1001f3f20    
      7  Binder::declare_symbol(SimpleDeclarationAST *, InitDeclaratorAST *)                                binder.cpp              248 0x1001d53a4    
      8  Binder::visitSimpleDeclaration(SimpleDeclarationAST *)                                             binder.cpp              220 0x1001d5097    
      9  Visitor::visit(AST *)                                                                              visitor.cpp             124 0x10020fb10    
      10 Binder::visitClassSpecifier(ClassSpecifierAST *)                                                   binder.cpp              659 0x1001da5f1    
      11 Visitor::visit(AST *)                                                                              visitor.cpp             124 0x10020fb10    
      12 Binder::visitSimpleDeclaration(SimpleDeclarationAST *)                                             binder.cpp              213 0x1001d504f    
      13 Visitor::visit(AST *)                                                                              visitor.cpp             124 0x10020fb10    
      14 void visitNodes<DeclarationAST *>(Visitor *, ListNode<DeclarationAST *> const *)                   visitor.h               138 0x1001dc6bf    
      15 DefaultVisitor::visitTranslationUnit(TranslationUnitAST *)                                         default_visitor.cpp     398 0x1001f64bc    
      16 Visitor::visit(AST *)                                                                              visitor.cpp             124 0x10020fb10    
      17 Binder::run(AST *)                                                                                 binder.cpp              73  0x1001d48b4    
      18 AbstractMetaBuilder::build(QIODevice *)                                                            abstractmetabuilder.cpp 400 0x10012f48c    
      19 ApiExtractor::run()                                                                                apiextractor.cpp        261 0x1000f50a8    
      20 main                                                                                               main.cpp                489 0x1000c7117    
      21 start                                                                                                                          0x7fff965315ad 
      

      And the actual crash happens here

      1  AbstractMetaType::isConstant() const                                                              abstractmetalang.h      502  0x10000b60c    
      2  AbstractMetaType::minimalSignature() const                                                        abstractmetalang.cpp    2487 0x100167d26    
      3  AbstractMetaFunction::minimalSignature() const                                                    abstractmetalang.cpp    846  0x10016b862    
      4  AbstractMetaFunction::modifications(AbstractMetaClass const *) const                              abstractmetalang.cpp    868  0x1001649ac    
      5  AbstractMetaFunction::replacedDefaultExpression(AbstractMetaClass const *, int) const             abstractmetalang.cpp    587  0x100168ca2    
      6  AbstractMetaBuilder::traverseFunction(CodeModelPointer<_FunctionModelItem>)                       abstractmetabuilder.cpp 2054 0x10012d663    
      7  AbstractMetaBuilder::traverseFunctions(CodeModelPointer<_ScopeModelItem>, AbstractMetaClass *)    abstractmetabuilder.cpp 1500 0x1001438f2    
      8  AbstractMetaBuilder::traverseScopeMembers(CodeModelPointer<_ScopeModelItem>, AbstractMetaClass *) abstractmetabuilder.cpp 1243 0x1001432bd    
      9  AbstractMetaBuilder::traverseClassMembers(CodeModelPointer<_ClassModelItem>)                      abstractmetabuilder.cpp 1279 0x10013acd1    
      10 AbstractMetaBuilder::build(QIODevice *)                                                           abstractmetabuilder.cpp 463  0x1001309c8    
      11 ApiExtractor::run()                                                                               apiextractor.cpp        261  0x1000f55f8    
      12 main                                                                                              main.cpp                489  0x1000c7667    
      13 start                                                                                                                          0x7fff965315ad 
      
      

      Attachments

        For Gerrit Dashboard: PYSIDE-455
        # Subject Branch Project Status CR V

        Activity

          People

            alexandru.croitor Alexandru Croitor
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes