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

shiboken2 exits with "return code '0xc00000fd'" (STACK_OVERFLOW)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.12.0
    • Shiboken
    • None
    • Windows

    Description

      Qt5.12.0 from qt installer MSVC2017 command Line tools

      python3.7.2, libclang7.0.1  compiled from sources

       

      compiling with :

      python setup.py build --qmake=C:\Qt\5.12.0\msvc2017_64\bin\qmake.exe  --build-tests --ignore-git --verbose-build --relwithdebinfo --reuse-build
      

       

      *bails out when generating QtGui

       

      This occurs due to CXCursor travers visits itself 

      Suggested fix: (works for me)

       

      diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp
      index e116f8b8..3300b6dd 100644
      --- a/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp
      +++ b/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp
      @@ -117,7 +117,7 @@ QString BaseVisitor::getCodeSnippetString(const CXCursor &cursor)
       } static CXChildVisitResult
      -    visitorCallback(CXCursor cursor, CXCursor /* parent */, CXClientData clientData)
      +    visitorCallback(CXCursor cursor, CXCursor parent, CXClientData clientData)
       {
           BaseVisitor *bv = reinterpret_cast<BaseVisitor *>(clientData);@@ -125,6 +125,10 @@ static CXChildVisitResult
           if (!bv->visitLocation(location))
               return CXChildVisit_Continue;
      
      +    // guard against recursive invokations
      +    if (clang_equalLocations(location , clang_getCursorLocation(parent)))
      +        return CXChildVisit_Continue;
      +
           const BaseVisitor::StartTokenResult startResult = bv->cbHandleStartToken(cursor);
           switch (startResult) {
           case clang::BaseVisitor::Error:
      

       

      Might be what is related to PYSIDE-739

       

      Attachments

        1. shiboken2_tests_libsample_abstract_h.log
          1.92 MB
        2. recursive2.txt
          3.02 MB
        3. recursive.txt
          25 kB
        4. build2.log
          3.17 MB
        5. build.log
          306 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              mumme Fredrik Johansson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes