Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21999

ClangFormat plugin hangs/freezes QtCreator on saving file

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11

      Description

      How to reproduce:

      1. Open a C++ file
      2. Press Ctrl+S (Save action)

      What happens:
      QtCreator's GUI interface freezes for about half a minute, maybe slightly less.

      I have run QtCreator with clang debugging output (export QT_LOGGING_RULES=qtc.clang*=true export LIBCLANG_TIMING=1) - you can find its output here.
      Strings like qtc.clangbackend.timers: ParseSupportiveTranslationUnitJob needed 10747 ms look suspicious.

      Here you can find perf top output. And here are some interesting function from the perf top log:

      1. libClangFormat.so
        1. clang::SourceManager::getDecomposedLoc
        2. clang::SourceManager::isBeforeInTranslationUnit
        3. clang::format::FormatTokenLexer::getNextToken

      PS. Note that I DO use extensively clang-format as a part of the Beautifier plugin (I assign a shortcut to the action and invoke it manually before saving) and I do NOT have any problems (like hangs) and the code is formatted very quickly.

        Attachments

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

          Activity

            People

            Assignee:
            yvvan Ivan Donchevskii
            Reporter:
            dimanne DimanNe
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes