Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109618

QtAttributionsScanner crashes frequently

    XMLWordPrintable

Details

    • All
    • f645125b0 (dev), b0f384ca7 (6.4), b2f8190d4 (tqtc/lts-5.15), 4d8246c7b (6.5)
    • DaVinci 70

    Description

      Trying to `make docs` resulted in QtAttributionsScanner crashing frequently with e.g.:

      /usr/local/Trolltech/Qt-5.15.11-universal/bin/qtattributionsscanner ./Qt-5.15.11_build/qtbase --filter QDocModule=qtcore -o ./Qt-5.15.11_build/qtbase/src/corelib/codeattributions.qdoc
      libc++abi: Pure virtual function called!
      Abort trap: 6
      

      Other times it wouldn't crash and just show a "QIODevice::write: ReadOnly device" or "QIODevice::write: device not open" debug output.

      It seems like the destruction order of a QTextStream operating on a QFile is wrong. As the QFile is declared after the QTextStream, the QFile is destroyed first before the QTextStream is destroyed and tries to flush the (previously closed and destroyed) QFile in its destructor (see https://codereview.qt-project.org/gitweb?p=qt/qttools.git;a=blob;f=src/qtattributionsscanner/main.cpp;h=79cb67f55b3cad3b1a809a4c98666f6531e3daf1;hb=HEAD#l132).

      The attached patch fixes the issue.

      I encountered the issues with Qt 5.15.11 building on macOS Monterey with XCode 13.4.1 (SDK 12.3), but I think this affects all Qt versions and all platforms.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            treinio Topi Reiniö
            simon.geisseler Simon Geisseler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews