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

QGuiApplicationPrivate::instance() is nullptr and being dereferenced.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.6.0
    • QPA
    • None

    Description

      Context is audio plugin running within a Host/DAW.

      We have several different plugin targets which a user can switch between e.g. VST3, AU.

       

      Reproduction steps:

      • Loading one of the targets inside a Host, say VST3, execute the `popup()` method on a `QMenu`.
      • Replace this target with another, say AU, and open a `QFileDialog`. i.e. call getOpenFileName() method.
      • Crash.

       

      For now, we protect against this crash by null checking `QGuiApplicationPrivate::instance()` in 2 places inside`qcocoawindow.mm` before it is deferenced, (QCocoaWindow::setupPopupMonitor() and QCocoaWindow::closeAllPopups()).

       

      2 different crash logs:

      Thread 0 Crashed:: reaper Dispatch queue: com.apple.main-thread
      0   Guitar Rig 7D                            0x30f4694a8 invocation function for block in NI_6_5_3::QCocoaWindow::setupPopupMonitor() + 28 (qcocoawindow.mm:1610)
      1   AppKit                                   0x189114930 GlobalObserverHandler + 92
      2   HIToolbox                                0x18f2531fc DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1092
      3   HIToolbox                                0x18f252680 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 356
      4   HIToolbox                                0x18f252510 SendEventToEventTargetWithOptions + 44
      5   HIToolbox                                0x18f29100c ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 468
      6   HIToolbox                                0x18f2536a4 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2284
      7   HIToolbox                                0x18f252680 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 356
      8   HIToolbox                                0x18f268898 SendEventToEventTarget + 40
      9   AppKit                                   0x188c51e9c _DPSNextEvent + 980
      10  AppKit                                   0x188c50ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
      11  AppKit                                   0x188c45344 -[NSApplication run] + 464
      12  AppKit                                   0x188c1c794 NSApplicationMain + 880
      13  dyld                                     0x1855fbf28 start + 2236 
      Thread 0 Crashed:: reaper Dispatch queue: com.apple.main-thread
      0   Guitar Rig 7D                            0x30d803060 NI_6_5_3::QCocoaWindow::closeAllPopups() + 12 (qcocoawindow.mm:1579)
      1   Guitar Rig 7D                            0x30d805620 invocation function for block in NI_6_5_3::QCocoaWindow::setupPopupMonitor() + 28 (qcocoawindow.mm:1638)
      2   CoreFoundation                           0x185a2716c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
      3   CoreFoundation                           0x185ac2eec ___CFXRegistrationPost_block_invoke + 88
      4   CoreFoundation                           0x185ac2e34 _CFXRegistrationPost + 440
      5   CoreFoundation                           0x1859f84cc _CFXNotificationPost + 704
      6   Foundation                               0x1869568f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
      7   AppKit                                   0x188df25e8 applicationStatusSubsystemCallback + 676
      8   LaunchServices                           0x185eb3e30 ___LSScheduleNotificationFunction_block_invoke_2 + 52
      9   CoreFoundation                           0x185a321d4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
      10  CoreFoundation                           0x185a320e8 __CFRunLoopDoBlocks + 364
      11  CoreFoundation                           0x185a3158c __CFRunLoopRun + 2432
      12  CoreFoundation                           0x185a304b8 CFRunLoopRunSpecific + 612
      13  HIToolbox                                0x18f27ac40 RunCurrentEventLoopInMode + 292
      14  HIToolbox                                0x18f27aa7c ReceiveNextEventCommon + 648
      15  HIToolbox                                0x18f27a7d4 _BlockUntilNextEventMatchingListInModeWithFilter + 76
      16  AppKit                                   0x188c51d44 _DPSNextEvent + 636
      17  AppKit                                   0x188c50ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
      18  AppKit                                   0x188c45344 -[NSApplication run] + 464
      19  AppKit                                   0x188c1c794 NSApplicationMain + 880
      20  dyld                                     0x1855fbf28 start + 2236 

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            erik.eviston Erik Eviston
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes