Skip to content

Mail redirection causes crash #163

Description

@joelshaf

We’re seeing a reproducible crash in Notate for Citrix when mail redirection is enabled.

Crash summary:
• Citrix MAM is calling UIPasteboard from a background queue (com.citrix.openURLQueue).
• This triggers a pasteboard notification on that same queue.
• NSNotificationCenter then invokes observers (including our PDF UI code) on that background queue.
• UIKit is touched off the main thread → _dispatch_assert_queue_fail → crash.

Relevant stack frames:

dispatch_assert_queue_fail
-[UIImageView _mainQ_beginLoadingIfApplicable]
-[UIButton layoutSubviews]
-[PDFToolbarButton layoutSubviews]
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
_sendPasteboardChangedNotification
-[_UIConcretePasteboard setData:forPasteboardType:]
ctxSetData_forPasteboardType  (CTXMAMContainment)
__45-[UIViewController(ctx) ctxSendMailProcedure]_block_invoke
Queue: com.citrix.openURLQueue

Root cause: ctxSetData_forPasteboardType in CTXMAMContainment performs pasteboard writes on a background Citrix queue. This causes UI-related observers to fire on that queue, violating UIKit’s main-thread requirement.

Fix needed:
Pasteboard operations inside CTXMAMContainment must be marshalled to the main queue before posting notifications or performing any work that results in UI updates.

This crash does not occur in the non-MAM build or when mail redirection is disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions