Microsoft Remote Desktop + Azure Virtual Desktop usage with a clipboard manager causes multiple process hangs on macOS

Joshua Z 1 Reputation point
2022-05-23T17:41:25.317+00:00

While using a clipboard manager (CopyQ or CopyLess) and copying from an Azure Virtual Desktop app into any other app it will cause both applications to hang and it's not possible to recover without force quitting Microsoft Remote Desktop.

Relevant thread samples (regarding pasteboard):

Call graph:
    2378 Thread_4652551   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2378 start  (in dyld) + 520  [0x106f6d08c]
    +   2378 main  (in Microsoft Remote Desktop Beta) + 12  [0x102f62840]
    +     2378 NSApplicationMain  (in AppKit) + 1132  [0x1a9b2396c]
    +       2378 -[NSApplication run]  (in AppKit) + 596  [0x1a9b52250]
    +         2378 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]  (in AppKit) + 1328  [0x1a9b60084]
    +           2378 _DPSNextEvent  (in AppKit) + 860  [0x1a9b6178c]
    +             2378 _BlockUntilNextEventMatchingListInModeWithFilter  (in HIToolbox) + 72  [0x1afc32e68]
    +               2378 ReceiveNextEventCommon  (in HIToolbox) + 564  [0x1afc330b4]
    +                 2378 RunCurrentEventLoopInMode  (in HIToolbox) + 292  [0x1afc33338]
    +                   2378 CFRunLoopRunSpecific  (in CoreFoundation) + 600  [0x1a6ffab24]
    +                     2378 __CFRunLoopRun  (in CoreFoundation) + 1720  [0x1a6ffb97c]
    +                       2378 __CFRunLoopDoBlocks  (in CoreFoundation) + 412  [0x1a6ffc96c]
    +                         2378 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__  (in CoreFoundation) + 28  [0x1a6ffcaf4]
    +                           2378 ___CFPasteboardHandleFulfillMessage_block_invoke_2  (in CoreFoundation) + 88  [0x1a70d18a4]
    +                             2378 -[_CFPasteboardEntry resolveLocalPromisedData]  (in CoreFoundation) + 96  [0x1a70cf5a8]
    +                               2378 __68-[NSPasteboard _setOwner:forTypes:atIndex:selector:usesPboardTypes:]_block_invoke  (in AppKit) + 356  [0x1aa200cd0]
    +                                 2378 @objc SessionPasteboardItemTextDataProvider.pasteboard(_:item:provideDataForType:)  (in Microsoft Remote Desktop Beta) + 96  [0x103076948]
    +                                   2378 specialized SessionPasteboardItemTextDataProvider.pasteboard(_:item:provideDataForType:)  (in Microsoft Remote Desktop Beta) + 392  [0x103077040]
    +                                     2378 Promise.block(timeout:)  (in Microsoft Remote Desktop Beta) + 736  [0x102f4f648]
    +                                       2378 OS_dispatch_semaphore.wait(wallTimeout:)  (in libswiftDispatch.dylib) + 24  [0x1b96d07a4]
    +                                         2378 _dispatch_semaphore_wait_slow  (in libdispatch.dylib) + 132  [0x1a6d6cdf8]
    +                                           2378 _dispatch_sema4_wait  (in libdispatch.dylib) + 28  [0x1a6d6c750]
    +                                             2378 semaphore_wait_trap  (in libsystem_kernel.dylib) + 8  [0x1a6ef28ec]

    2378 Thread_4679931   DispatchQueue_209: com.microsoft.rdc.pasteboard  (serial)
    + 2378 start_wqthread  (in libsystem_pthread.dylib) + 8  [0x1a6f2b080]
    +   2378 _pthread_wqthread  (in libsystem_pthread.dylib) + 288  [0x1a6f2c360]
    +     2378 _dispatch_workloop_worker_thread  (in libdispatch.dylib) + 648  [0x1a6d7ec98]
    +       2378 _dispatch_lane_invoke  (in libdispatch.dylib) + 392  [0x1a6d74404]
    +         2378 _dispatch_lane_serial_drain  (in libdispatch.dylib) + 668  [0x1a6d738a8]
    +           2378 _dispatch_client_callout  (in libdispatch.dylib) + 20  [0x1a6d6c1b4]
    +             2378 _dispatch_call_block_and_release  (in libdispatch.dylib) + 32  [0x1a6d6a5f0]
    +               2378 thunk for @escaping @callee_guaranteed () -> ()  (in Microsoft Remote Desktop Beta) + 20  [0x102c3f284]
    +                 2378 -[RDCClipboard getRemoteClipboardDataWithCompletion:]  (in Microsoft Remote Desktop Beta) + 216  [0x103e86fb8]
    +                   2378 RdCore::Clipboard::A3::A3ClientClipboardController::GetRemoteClipboardData(std::__1::weak_ptr<RdCore::Clipboard::IFormatDataCompletion>)  (in Microsoft Remote Desktop Beta) + 116  [0x104127aa8]
    +                     2378 RdCore::Clipboard::A3::RdpPlatformClipboard::GetSharedClipboardData(std::__1::weak_ptr<RdCore::Clipboard::IFormatDataCompletion>)  (in Microsoft Remote Desktop Beta) + 860  [0x10414b8b0]
    +                       2378 RdCore::Clipboard::A3::RdpFormatDataByteBufferCompletion::GetStatus()  (in Microsoft Remote Desktop Beta) + 80  [0x104126e2c]
    +                         2378 std::__1::__assoc_state<RdCore::Clipboard::FormatDataRetrievalStatus>::move()  (in Microsoft Remote Desktop Beta) + 56  [0x10406c44c]
    +                           2378 std::__1::__assoc_sub_state::__sub_wait(std::__1::unique_lock<std::__1::mutex>&)  (in libc++.1.dylib) + 56  [0x1a6e7fe5c]
    +                             2378 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)  (in libc++.1.dylib) + 28  [0x1a6e7f284]
    +                               2378 _pthread_cond_wait  (in libsystem_pthread.dylib) + 1236  [0x1a6f3083c]
    +                                 2378 __psynch_cvwait  (in libsystem_kernel.dylib) + 8  [0x1a6ef6270]



Heaviest stack for the main thread of the target process:
  48  start + 520 (dyld + 20620) [0x106f6d08c]
  48  main + 12 (Microsoft Remote Desktop Beta + 3352640) [0x102f62840]
  48  NSApplicationMain + 1132 (AppKit + 14700) [0x1a9b2396c]
  48  -[NSApplication run] + 596 (AppKit + 205392) [0x1a9b52250]
  48  -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328 (AppKit + 262276) [0x1a9b60084]
  48  _DPSNextEvent + 860 (AppKit + 268172) [0x1a9b6178c]
  48  _BlockUntilNextEventMatchingListInModeWithFilter + 72 (HIToolbox + 204392) [0x1afc32e68]
  48  ReceiveNextEventCommon + 564 (HIToolbox + 204980) [0x1afc330b4]
  48  RunCurrentEventLoopInMode + 292 (HIToolbox + 205624) [0x1afc33338]
  48  CFRunLoopRunSpecific + 600 (CoreFoundation + 535332) [0x1a6ffab24]
  48  __CFRunLoopRun + 1720 (CoreFoundation + 539004) [0x1a6ffb97c]
  48  __CFRunLoopDoBlocks + 412 (CoreFoundation + 543084) [0x1a6ffc96c]
  48  __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 (CoreFoundation + 543476) [0x1a6ffcaf4]
  48  ___CFPasteboardHandleFulfillMessage_block_invoke_2 + 88 (CoreFoundation + 1415332) [0x1a70d18a4]
  48  -[_CFPasteboardEntry resolveLocalPromisedData] + 96 (CoreFoundation + 1406376) [0x1a70cf5a8]
  48  __68-[NSPasteboard _setOwner:forTypes:atIndex:selector:usesPboardTypes:]_block_invoke + 356 (AppKit + 7212240) [0x1aa200cd0]
  48  @objc SessionPasteboardItemTextDataProvider.pasteboard(_:item:provideDataForType:) + 96 (Microsoft Remote Desktop Beta + 4483400) [0x103076948]
  48  specialized SessionPasteboardItemTextDataProvider.pasteboard(_:item:provideDataForType:) + 392 (Microsoft Remote Desktop Beta + 4485184) [0x103077040]
  48  Promise.block(timeout:) + 736 (Microsoft Remote Desktop Beta + 3274312) [0x102f4f648]
  48  OS_dispatch_semaphore.wait(wallTimeout:) + 24 (libswiftDispatch.dylib + 67492) [0x1b96d07a4]
  48  _dispatch_semaphore_wait_slow + 132 (libdispatch.dylib + 19960) [0x1a6d6cdf8]
  48  semaphore_wait_trap + 8 (libsystem_kernel.dylib + 6380) [0x1a6ef28ec]
 *48  ??? (kernel.release.t6000 + 610572) [0xfffffe000793d10c]

Also it occurs on both the Beta and current Microsoft Remote Desktop versions.

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,820 questions
Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,783 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 8,315 Reputation points
    2025-05-26T13:51:55.7666667+00:00

    Hi Joshua,

    Thanks for posting your question on the Q&A portal and providing such detailed info about the issue )) It really helps to understand what's going on.

    I see you're experiencing hangs when using a clipboard manager (like CopyQ or CopyLess) with Microsoft Remote Desktop on macos, especially when copying from an Azure Virtual Desktop app to another app. This seems to be related to pasteboard (clipboard) synchronization between the local and remote sessions.

    From the stack traces, it looks like the main thread and the pasteboard thread are getting stuck waiting for each other, causing a deadlock. This is a known issue that can happen when third-party clipboard managers interfere with the remote desktop clipboard redirection.

    Disable the clipboard manager temporarily Since this seems to be triggered by CopyQ/CopyLess, try quitting the clipboard manager before using Microsoft Remote Desktop. You can check if the issue goes away when the manager isn't running. Use the built-in clipboard sync in Microsoft Remote Desktop Instead of relying on a third-party clipboard manager, you can enable clipboard redirection within the Remote Desktop client. Open Microsoft Remote Desktop. Go to Preferences > General

    Make sure Clipboard is checked under Redirected devices.

    Update Microsoft Remote Desktop. You mentioned this happens in both Beta and stable versions, but it's still worth checking for updates. Sometimes newer versions include fixes for clipboard-related issues.

    Try a different clipboard manager. Some users report that certain clipboard managers (like Paste or Maccy) work better with Remote Desktop. You could test alternatives to see if they cause the same problem. Restart the pasteboard service, if the issue persists, you can try resetting macos's pasteboard service by running this in Terminal

    killall pboard  
    
    

    (This will restart the system clipboard service and might resolve temporary freezes.)

    The problem occurs because the clipboard manager and Remote Desktop are both trying to access the pasteboard at the same time, leading to a deadlock. Microsoft Remote Desktop uses a separate thread (com.microsoft.rdc.pasteboard) to sync clipboard data between local and remote sessions, and if another app (like a clipboard manager) holds the pasteboard too long, it can cause the app to hang.

    If none of these steps help, you might want to report this directly to Microsoft through their feedback hub or support channels. They might have a more specific fix in the works ))

    Hope this help and let me know if you need more details.

    Best regards,
    Alex
    P.S. If my answer help to you, please Accept my answer
    PPS That is my Answer and not a Comment
    https://ctrlaltdel.blog/
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.