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

[NSGraphicsContext graphicsContextWithCGContext:flipped:]: unrecognized selector sent to class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.0 Beta 1
    • QPA
    • None
    • Mac OS X 10.9.5
    • macOS

    Description

      I've been able to reproduce an issue already reported on the development ML using the stock 5.9.0RC build and one of my demonstrators (https://github.com/RJVB/fontweightissue-qt5):

      2017-04-12 15:48:10.870 fontweightissue[34076:d07] +[NSGraphicsContext graphicsContextWithCGContext:flipped:]: unrecognized selector sent to class 0x7fff794b78f8
      Qt has caught an exception thrown from an event handler. Throwing
      exceptions from an event handler is not supported in Qt.
      You must not let any exception whatsoever propagate through Qt code.
      If that is not possible, in Qt 5 you must at least reimplement
      QCoreApplication::notify() and catch all exceptions there.
      
      2017-04-12 15:48:10.871 fontweightissue[34076:d07] +[NSGraphicsContext graphicsContextWithCGContext:flipped:]: unrecognized selector sent to class 0x7fff794b78f8
      2017-04-12 15:48:10.909 fontweightissue[34076:d07] (
              0   CoreFoundation                      0x00007fff8a11e25c __exceptionPreprocess + 172
              1   libobjc.A.dylib                     0x00007fff8af92e75 objc_exception_throw + 43
              2   CoreFoundation                      0x00007fff8a12102d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
              3   CoreFoundation                      0x00007fff8a07c272 ___forwarding___ + 1010
              4   CoreFoundation                      0x00007fff8a07bdf8 _CF_forwarding_prep_0 + 120
              5   QtWidgets                           0x000000010626c183 _ZN23QPixmapDropShadowFilter11qt_metacallEN11QMetaObject4CallEiPPv + 8531
              6   QtWidgets                           0x00000001062790e7 _ZN23QPixmapDropShadowFilter11qt_metacallEN11QMetaObject4CallEiPPv + 61623
              7   QtWidgets                           0x0000000106274450 _ZN23QPixmapDropShadowFilter11qt_metacallEN11QMetaObject4CallEiPPv + 42016
              8   QtWidgets                           0x0000000105f76489 _ZN11QProxyStyle11qt_metacallEN11QMetaObject4CallEiPPv + 111705
              9   QtWidgets                           0x000000010607bca4 _ZN20QWidgetResizeHandler11qt_metacallEN11QMetaObject4CallEiPPv + 676
              10  QtWidgets                           0x000000010607bab9 _ZN20QWidgetResizeHandler11qt_metacallEN11QMetaObject4CallEiPPv + 185
              11  QtWidgets                           0x0000000106285740 _ZN23QPixmapDropShadowFilter11qt_metacallEN11QMetaObject4CallEiPPv + 112400
              12  QtWidgets                           0x0000000105f7af06 _ZN11QProxyStyle11qt_metacallEN11QMetaObject4CallEiPPv + 130774
              13  QtWidgets                           0x0000000105ec158d _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 269
              14  QtWidgets                           0x0000000105ec3e5c _ZN12QApplication6notifyEP7QObjectP6QEvent + 5852
              15  QtCore                              0x0000000106b64314 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 164
              16  QtWidgets                           0x0000000105ebf457 _ZN19QApplicationPrivate14setFocusWidgetEP7QWidgetN2Qt11FocusReasonE + 471
              17  QtWidgets                           0x0000000105ef77ea _ZN7QWidget8setFocusEN2Qt11FocusReasonE + 618
              18  QtWidgets                           0x0000000105ec0478 _ZN12QApplication15setActiveWindowEP7QWidget + 1096
              19  QtWidgets                           0x0000000105ec0862 _ZN19QApplicationPrivate24notifyActiveWindowChangeEP7QWindow + 50
              20  QtGui                               0x00000001064a47e2 _ZN22QGuiApplicationPrivate21processActivatedEventEPN29QWindowSystemInterfacePrivate20ActivatedWindowEventE + 626
              21  QtGui                               0x000000010648938b _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 155
              22  libqcocoa.dylib                     0x0000000108fe1e81 qt_plugin_instance + 134657
              23  CoreFoundation                      0x00007fff8a04f5b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
              24  CoreFoundation                      0x00007fff8a040c62 __CFRunLoopDoSources0 + 242
              25  CoreFoundation                      0x00007fff8a0403ef __CFRunLoopRun + 831
              26  CoreFoundation                      0x00007fff8a03fe75 CFRunLoopRunSpecific + 309
              27  HIToolbox                           0x00007fff8e363a0d RunCurrentEventLoopInMode + 226
              28  HIToolbox                           0x00007fff8e363685 ReceiveNextEventCommon + 173
              29  HIToolbox                           0x00007fff8e3635bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
              30  AppKit                              0x00007fff921fb24e _DPSNextEvent + 1434
              31  AppKit                              0x00007fff921fa89b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
              32  AppKit                              0x00007fff92559e2e -[NSApplication _realDoModalLoop:peek:] + 642
              33  AppKit                              0x00007fff92590505 -[NSApplication runModalSession:] + 71
              34  libqcocoa.dylib                     0x0000000108fe0c4a qt_plugin_instance + 129994
              35  QtCore                              0x0000000106b600e1 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 401
              36  QtWidgets                           0x0000000106110459 _ZN7QDialog4execEv + 377
              37  QtWidgets                           0x00000001060e46bc _ZN12QInputDialog7getTextEP7QWidgetRK7QStringS4_N9QLineEdit8EchoModeES4_Pb6QFlagsIN2Qt10WindowTypeEES8_INS9_15InputMethodHintEE + 748
              38  fontweightissue                     0x0000000105e97177 _ZN6Dialog17getFontFromFamilyEv + 151
              39  QtCore                              0x0000000106b94be1 _ZN11QMetaObject8activateEP7QObjectiiPPv + 913
              40  QtWidgets                           0x00000001060980b0 _ZNK15QAbstractButton11isCheckableEv + 848
              41  QtWidgets                           0x0000000106097f34 _ZNK15QAbstractButton11isCheckableEv + 468
              42  QtWidgets                           0x0000000106098fee _ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 270
              43  QtWidgets                           0x0000000105efb8c6 _ZN7QWidget5eventEP6QEvent + 1670
              44  QtWidgets                           0x0000000106098d3f _ZN15QAbstractButton5eventEP6QEvent + 175
              45  QtWidgets                           0x0000000105ec158d _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 269
              46  QtWidgets                           0x0000000105ec4b23 _ZN12QApplication6notifyEP7QObjectP6QEvent + 9123
              47  QtCore                              0x0000000106b64314 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 164
              48  QtWidgets                           0x0000000105ec1eb7 _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb + 871
              49  QtWidgets                           0x0000000105f1c1cb _ZN14QDesktopWidget11qt_metacallEN11QMetaObject4CallEiPPv + 10411
              50  QtWidgets                           0x0000000105f1b20f _ZN14QDesktopWidget11qt_metacallEN11QMetaObject4CallEiPPv + 6383
              51  QtWidgets                           0x0000000105ec158d _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 269
              52  QtWidgets                           0x0000000105ec3e5c _ZN12QApplication6notifyEP7QObjectP6QEvent + 5852
              53  QtCore                              0x0000000106b64314 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 164
              54  QtGui                               0x00000001064a1b77 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 2855
              55  QtGui                               0x000000010648938b _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 155
              56  libqcocoa.dylib                     0x0000000108fe1e81 qt_plugin_instance + 134657
              57  CoreFoundation                      0x00007fff8a04f5b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
              58  CoreFoundation                      0x00007fff8a040c62 __CFRunLoopDoSources0 + 242
              59  CoreFoundation                      0x00007fff8a0403ef __CFRunLoopRun + 831
              60  CoreFoundation                      0x00007fff8a03fe75 CFRunLoopRunSpecific + 309
              61  HIToolbox                           0x00007fff8e363a0d RunCurrentEventLoopInMode + 226
              62  HIToolbox                           0x00007fff8e363685 ReceiveNextEventCommon + 173
              63  HIToolbox                           0x00007fff8e3635bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
              64  AppKit                              0x00007fff921fb24e _DPSNextEvent + 1434
              65  AppKit                              0x00007fff921fa89b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
              66  AppKit                              0x00007fff921ee99c -[NSApplication run] + 553
              67  libqcocoa.dylib                     0x0000000108fe0d1f qt_plugin_instance + 130207
              68  QtCore                              0x0000000106b600e1 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 401
              69  QtCore                              0x0000000106b64985 _ZN16QCoreApplication4execEv + 341
              70  fontweightissue                     0x0000000105e99fde main + 4222
              71  libdyld.dylib                       0x00007fff915c95fd start + 1
              72  ???                                 0x0000000000000001 0x0 + 1
      )
      

      The backtrace is printed each time certain events are handled, and I notice that the "QFontDialog::getFont()" button is inoperable when built against Qt 5.9.0RC . In addition I can get a crash on exit with the following backtrace:

      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0   org.qt-project.QtCore         	0x0000000106b602fc QEventLoop::exit(int) + 12
      1   org.qt-project.QtWidgets      	0x0000000106110e2e QDialog::setVisible(bool) + 446
      2   org.qt-project.QtWidgets      	0x00000001061105b6 QDialog::done(int) + 54
      3   org.qt-project.QtWidgets      	0x00000001060e40dc QInputDialog::done(int) + 44
      4   org.qt-project.QtCore         	0x0000000106b94be1 QMetaObject::activate(QObject*, int, int, void**) + 913
      5   org.qt-project.QtWidgets      	0x00000001060a7f85 0x105eb0000 + 2064261
      6   org.qt-project.QtCore         	0x0000000106b94be1 QMetaObject::activate(QObject*, int, int, void**) + 913
      7   org.qt-project.QtWidgets      	0x00000001060980b0 0x105eb0000 + 1999024
      8   org.qt-project.QtWidgets      	0x0000000106097f34 0x105eb0000 + 1998644
      9   org.qt-project.QtWidgets      	0x0000000106098fee QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 270
      10  org.qt-project.QtWidgets      	0x0000000105efb8c6 QWidget::event(QEvent*) + 1670
      11  org.qt-project.QtWidgets      	0x0000000106098d3f QAbstractButton::event(QEvent*) + 175
      12  org.qt-project.QtWidgets      	0x0000000105ec158d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
      13  org.qt-project.QtWidgets      	0x0000000105ec4b23 QApplication::notify(QObject*, QEvent*) + 9123
      14  org.qt-project.QtCore         	0x0000000106b64314 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 164
      15  org.qt-project.QtWidgets      	0x0000000105ec1eb7 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 871
      16  org.qt-project.QtWidgets      	0x0000000105f1c1cb 0x105eb0000 + 442827
      17  org.qt-project.QtWidgets      	0x0000000105f1b20f 0x105eb0000 + 438799
      18  org.qt-project.QtWidgets      	0x0000000105ec158d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
      19  org.qt-project.QtWidgets      	0x0000000105ec3e5c QApplication::notify(QObject*, QEvent*) + 5852
      20  org.qt-project.QtCore         	0x0000000106b64314 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 164
      21  org.qt-project.QtGui          	0x00000001064a1b77 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 2855
      22  org.qt-project.QtGui          	0x000000010648938b QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 155
      23  libqcocoa.dylib               	0x0000000108fe1e81 QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void*) + 33
      24  com.apple.CoreFoundation      	0x00007fff8a04f5b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
      25  com.apple.CoreFoundation      	0x00007fff8a040c62 __CFRunLoopDoSources0 + 242
      26  com.apple.CoreFoundation      	0x00007fff8a0403ef __CFRunLoopRun + 831
      27  com.apple.CoreFoundation      	0x00007fff8a03fe75 CFRunLoopRunSpecific + 309
      28  com.apple.HIToolbox           	0x00007fff8e363a0d RunCurrentEventLoopInMode + 226
      29  com.apple.HIToolbox           	0x00007fff8e363685 ReceiveNextEventCommon + 173
      30  com.apple.HIToolbox           	0x00007fff8e3635bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
      31  com.apple.AppKit              	0x00007fff921fb24e _DPSNextEvent + 1434
      32  com.apple.AppKit              	0x00007fff921fa89b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
      33  com.apple.AppKit              	0x00007fff92559e2e -[NSApplication _realDoModalLoop:peek:] + 642
      34  com.apple.AppKit              	0x00007fff92590505 -[NSApplication runModalSession:] + 71
      35  libqcocoa.dylib               	0x0000000108fe0c4a QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1930
      36  org.qt-project.QtCore         	0x0000000106b600e1 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 401
      37  org.qt-project.QtCore         	0x0000000106b64985 QCoreApplication::exec() + 341
      38  com.yourcompany.fontweightissue	0x0000000105e99fde main + 4222 (main.cpp:193)
      39  libdyld.dylib                 	0x00007fff915c95fd start + 1
      

      On 10.9 the `graphicsContextWithGraphicsPort` selector can be used instead.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              rjvbertin René Bertin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes