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

Qt 5.5.0 - null pointer dereference in QPlatformScreen::screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.0
    • GUI: Workspace
    • None

    Description

      I am seeing this issue in the wild, but I'm unable to repoduce it myself. It seems to only be happening on OS X.

      The application is crashing with EXC_BAD_ACCESS at 0x00000000. Here is the stack trace:

      0x000000010e64e4f4	(libQt5Gui.5.dylib + 0x000124f4 )	__ZNK15QPlatformScreen6screenEv
      0x000000010e68b666	(libQt5Gui.5.dylib + 0x0004f666 )	__ZNK7QScreen15virtualSiblingsEv
      0x000000010e66c6f4	(libQt5Gui.5.dylib + 0x000306f4 )	__ZNK14QWindowPrivate24windowRecreationRequiredEP7QScreen
      0x000000010e6676a6	(libQt5Gui.5.dylib + 0x0002b6a6 )	__ZN14QWindowPrivate17setTopLevelScreenEP7QScreenb
      0x000000010e68b217	(libQt5Gui.5.dylib + 0x0004f217 )	__ZN7QScreenD2Ev
      0x000000010e68af6d	(libQt5Gui.5.dylib + 0x0004ef6d )	__ZN7QScreenD0Ev
      0x000000010e64db40	(libQt5Gui.5.dylib + 0x00011b40 )	__ZN20QPlatformIntegration13destroyScreenEP15QPlatformScreen
      0x000000011564100e	(libqcocoa.dylib + 0x0000400e )	__ZN17QCocoaIntegration13updateScreensEv
      0x00007fff8c0dc70b	(CoreFoundation + 0x0012870b )	__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
      0x00007fff8c0dc67e	(CoreFoundation + 0x0012867e )	___CFXRegistrationPost_block_invoke
      0x00007fff8c0dbd46	(CoreFoundation + 0x00127d46 )	_CFXRegistrationPost
      0x00007fff8c0dbab1	(CoreFoundation + 0x00127ab1 )	___CFXNotificationPost_block_invoke
      0x00007fff8c0d5d41	(CoreFoundation + 0x00121d41 )	-[_CFXNotificationRegistrar find:object:observer:enumerator:]
      0x00007fff8bfc4144	(CoreFoundation + 0x00010144 )	_CFXNotificationPost
      0x00007fff8e0d3920	(Foundation + 0x00007920 )	-[NSNotificationCenter postNotificationName:object:userInfo:]
      0x00007fff9fc4dca7	(AppKit + 0x003d9ca7 )	-[NSApplication _reactToScreenInvalidationImmediately:]
      0x00007fff9fc4daf8	(AppKit + 0x003d9af8 )	__44-[NSApplication _reactToScreenInvalidation:]_block_invoke
      0x00007fff8c0324ab	(CoreFoundation + 0x0007e4ab )	__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
      0x00007fff8c024164	(CoreFoundation + 0x00070164 )	__CFRunLoopDoBlocks
      0x00007fff8c023eca	(CoreFoundation + 0x0006feca )	__CFRunLoopRun
      0x00007fff8c023337	(CoreFoundation + 0x0006f337 )	CFRunLoopRunSpecific
      0x00007fff94c9b934	(HIToolbox + 0x00030934 )	RunCurrentEventLoopInMode
      0x00007fff94c9b76e	(HIToolbox + 0x0003076e )	ReceiveNextEventCommon
      0x00007fff94c9b5ae	(HIToolbox + 0x000305ae )	_BlockUntilNextEventMatchingListInModeWithFilter
      0x00007fff9f8fe0ed	(AppKit + 0x0008a0ed )	_DPSNextEvent
      0x00007fff9fcca942	(AppKit + 0x00456942 )	-[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
      0x00007fff9f8f3fc7	(AppKit + 0x0007ffc7 )	-[NSApplication run]
      0x0000000115658c64	(libqcocoa.dylib + 0x0001bc64 )	__ZN21QCocoaEventDispatcher13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE
      0x000000010edc365c	(libQt5Core.5.dylib + 0x001e765c )	__ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE
      0x000000010edc6af9	(libQt5Core.5.dylib + 0x001eaaf9 )	__ZN16QCoreApplication4execEv}}
      

      Here is where the crash is happening:

      QScreen *QPlatformScreen::screen() const
      {
          Q_D(const QPlatformScreen);
          return d->screen; // crash here
      }
      

      Based on the above, I am assuming that the d-pointer in QPlatformScreen is 0. I suppose this shouldn't normally happen? This issue resembles QTBUG-33806 (which was claimed as fixed).

      Attachments

        Activity

          People

            Unassigned Unassigned
            gridz Grigory
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: