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

Crash when waking up with multiple displays in clamshell mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 5.14.0 RC1, 6.1.3
    • 5.13.0
    • GUI: Window management
    • None
    • MacBook Pro 13" 2018 4xTB
      macOS Catalina 10.15 Beta (19A526h)
      Displays: 2 x LG 24UD58-B (4K)
      Sonnet Thunderbolt 3 to Dual DisplayPort Adapter

      (sidenote: this setup is a little bit quirky, sometimes during waking up one of the displays wakes up as 1080p (or 4K@30Hz), requires turning it off/on and switching resolution. Still, none of these should cause crashes and assertions). 

      The problem seems to be new code in qcocoascreen.mm; The callback registered through CGDisplayRegisterReconfigurationCallback is fired with events in order Qt can't handle properly. 

      Also Qt makes assumptions that seems not to be true:

      For example the callback is invoked with displayId == 4128830 and flags == 4368 (kCGDisplayAddFlag, kCGDisplayEnabledFlag, kCGDisplayDesktopShapeChangedFlag), so Qt assumes CGDisplayCreateUUIDFromDisplayID will return valid value (to match displayId with NSScreen), but in my case CGDisplayCreateUUIDFromDisplayID(4128830) returns null despite callback being called with added/enabled flags. This causes assertion in QCocoaScreen::updateProperties()

      Also note that in this situation, there are two [NSScreen screens] present, but neither deviceDescription->NSScreenNumber matches the displayId; 

      Edit: Attached a workaround patch I'm testing right now that seems to solve the assertions and crashes in this case. While not a proper solution, It still might be helpful.

        1. 0001-Attempt-to-workaround-for-crash-when-waking-up.patch
          2 kB
          Matej Knopp
        2. 0001-Workaround-for-another-crash-when-waking-up.patch
          1 kB
          Matej Knopp
        3. log1.txt
          10 kB
          Bogdan Lazanu
        4. log2.txt
          11 kB
          Bogdan Lazanu
        5. log3.txt
          21 kB
          Bogdan Lazanu
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vestbo Tor Arne Vestbø
            knopp Matej Knopp
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: