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

QPixmap::defaultDepth() can crash during global destruction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.6, 5.11.0 RC 1
    • 5.9.4
    • GUI: Painting
    • None

    Description

      Consider the backtrace below. It is caused by calling `QPixmap:defaultDepth()` which in turn dereferences a null pointer returned by `QGuiApplication::PrimaryScreen()`.

      I think the crash could simply be avoided by returning 0, which should be safe (or 1 otherwise).

      (lldb) bt all
      * thread #1: tid = 0x751e71, 0x00007fff8f762e20 libsystem_kernel.dylib`__wait4 + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
      * frame #0: 0x00007fff8f762e20 libsystem_kernel.dylib`__wait4 + 8
      frame #1: 0x0000000111dacd1e libKF5Crash.5.dylib`KCrash::startProcess(int, char const**, bool) [inlined] startProcessInternal(argc=<unavailable>, directly=<unavailable>) + 125 at kcrash.cpp:649
      frame #2: 0x0000000111dacca1 libKF5Crash.5.dylib`KCrash::startProcess(argc=<unavailable>, argv=<unavailable>, waitAndExit=<unavailable>) + 17 at kcrash.cpp:631
      frame #3: 0x0000000111dacae5 libKF5Crash.5.dylib`KCrash::defaultCrashHandler(sig=11) + 1061 at kcrash.cpp:528
      frame #4: 0x00007fff9252a5aa libsystem_platform.dylib`_sigtramp + 26
      frame #5: 0x000000011768d955 QtGui`QScreen::depth(this=0x0000000000000000) const + 5 at qscreen.cpp:204
      frame #6: 0x000000010ff9858f libdigikamcore.5.8.0.dylib`Digikam::LoadingCache::setThumbnailCacheSize(int, int) + 223
      [...]
      frame #10: 0x000000010ff90d68 libdigikamcore.5.8.0.dylib`Digikam::ManagedLoadSaveThread::shutDown() + 440
      [...]
      frame #14: 0x00007fff998467ad libsystem_c.dylib`__cxa_finalize + 177
      frame #15: 0x00007fff99846a58 libsystem_c.dylib`exit + 22
      frame #16: 0x00007fff902cc604 libdyld.dylib`start + 8
      

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            rjvbertin René Bertin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes