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

Possible infinite loop triggered by unmaximizing the window in 6.5.0+

    XMLWordPrintable

Details

    • Linux/X11, Windows
    • be6c651be (dev), 3576e6099 (6.7), 3d2d8c32c (6.6), c7142a40f (tqtc/lts-6.5)

    Description

      I am a collaborator of this open-source, note-taking app called Notes.

      We use GitHub Actions to build and distribute binaries, and after trying to update Qt from 6.4.2 to 6.5.0 as a part of a feature addition, I encountered what I assume to be a regression in Qt. Unfortunately, my C++ debugging skills is very limited, so please bear with me.

      Using gdb and valgrind/Kcachegrind, I came to the (very naïve) conclusion that our program is somehow stuck an infinite loop in QTextDocumentLayoutPrivate::layoutBlock(), more specifically in this block, causing the app to freeze and the memory to continuously grow. Keep in mind that I can be far off from the actual place, though.

      Based on my tests, this only reproduces in Qt versions 6.5.0, 6.5.1 and 6.5.2, meaning earlier ones are most likely fine.

      Unfortunately, I don't have minimal reproduction case, but if you're able to build Notes from source, here are some fairly easy steps to reproduce the problem:

      1. Clone & build the app:
      git clone https://github.com/nuttyartist/notes.git --recursive
      cd notes
      cmake -B build -S . -DUSE_QT_VERSION=6
      cmake --build build

      2. Run the app:
      ./build/notes

      3. Create a new note (using the '+' blue button, or just by typing anything into the rightmost panel)
      4. Type anything into that note (the issue doesn't reproduce for me when it's empty)
      5. Maximize the window
      6. Unmaximize the window

      Result:

      The app will freeze, while CPU and memory usage stay very high.

      Videos:

      Arch Linux (Qt 6.5.2): https://user-images.githubusercontent.com/626206/255402710-34b25f90-fd5a-4504-9d1d-87af4754c2ed.mp4
      Windows 10 (Qt 6.5.0): https://user-images.githubusercontent.com/626206/252715637-780e726b-9624-475f-8c2a-d717e58eadae.mp4

      Attachments

        1. log.txt
          193 kB
        2. repro.zip
          2 kB

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              guihkx Guilherme Silva
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes