Skip to content

Deadlock in CFContentStream #25634

@rolfbjarne

Description

@rolfbjarne

Crash report:

crash-report.txt

Execution log: execute-MacCatalyst-20260603_055316.txt

Important parts:

(lldb) thread backtrace all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x000000019412e4f8 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000019416e108 libsystem_pthread.dylib`_pthread_cond_wait + 1028
    frame #2: 0x0000000104fad934 monotouchtest`_S_P_CoreLib_System_Threading_WaitSubsystem_ThreadWaitInfo__Wait(this=0x0000000116e55a78, timeoutMilliseconds=<unavailable>, interruptible=<unavailable>, isSleep=<unavailable>, lockHolder=<unavailable>) at WaitSubsystem.ThreadWaitInfo.Unix.cs:322
    frame #3: 0x0000000104fae404 monotouchtest`_S_P_CoreLib_System_Threading_WaitSubsystem_WaitableObject__Wait(this=<unavailable>, waitInfo=<unavailable>, timeoutMilliseconds=<unavailable>, interruptible=<unavailable>, prioritize=<unavailable>) at WaitSubsystem.WaitableObject.Unix.cs:320
    frame #4: 0x0000000104ef2d08 monotouchtest`_S_P_CoreLib_System_Threading_WaitHandle__WaitOneNoCheck(this=<unavailable>, millisecondsTimeout=<unavailable>, useTrivialWaits=<unavailable>, associatedObject=<unavailable>, waitSource=<unavailable>) at WaitHandle.cs:144
    frame #5: 0x0000000104c6cd6c monotouchtest`_Microsoft_MacCatalyst_System_Net_Http_CFContentStream__ReadStreamData(this=0x00000000ffffffff) at CFContentStream.cs:103
    frame #6: 0x0000000104c6dc58 monotouchtest`_Microsoft_MacCatalyst_System_Net_Http_CFNetworkHandler__HandleHasBytesAvailableEvent(this=<unavailable>, sender=<unavailable>, e=<unavailable>) at CFNetworkHandler.cs:355
    frame #7: 0x0000000104c6d828 monotouchtest`_Microsoft_MacCatalyst_System_Net_Http_CFNetworkHandler__HandleClosedEvent(this=0x0000000117feeb28, sender=<unavailable>, e=<unavailable>) at CFNetworkHandler.cs:328
    frame #8: 0x0000000104bd3ee8 monotouchtest`_Microsoft_MacCatalyst_CoreFoundation_CFStream__NativeCallback(s=<unavailable>, type=<unavailable>, info=<unavailable>) at CFStream.cs:701
    [...]
  thread #12, name = '.NET TP Worker'
    frame #0: 0x000000019412e4f8 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000019416e108 libsystem_pthread.dylib`_pthread_cond_wait + 1028
    frame #2: 0x0000000104fad934 monotouchtest`_S_P_CoreLib_System_Threading_WaitSubsystem_ThreadWaitInfo__Wait(this=0x000000011824d398, timeoutMilliseconds=<unavailable>, interruptible=<unavailable>, isSleep=<unavailable>, lockHolder=<unavailable>) at WaitSubsystem.ThreadWaitInfo.Unix.cs:322
    frame #3: 0x0000000104fae404 monotouchtest`_S_P_CoreLib_System_Threading_WaitSubsystem_WaitableObject__Wait(this=<unavailable>, waitInfo=<unavailable>, timeoutMilliseconds=<unavailable>, interruptible=<unavailable>, prioritize=<unavailable>) at WaitSubsystem.WaitableObject.Unix.cs:320
    frame #4: 0x0000000104ef2d08 monotouchtest`_S_P_CoreLib_System_Threading_WaitHandle__WaitOneNoCheck(this=<unavailable>, millisecondsTimeout=<unavailable>, useTrivialWaits=<unavailable>, associatedObject=<unavailable>, waitSource=<unavailable>) at WaitHandle.cs:144
    frame #5: 0x0000000104c6ce10 monotouchtest`_Microsoft_MacCatalyst_System_Net_Http_CFContentStream__Close(this=0x00000000ffffffff) at CFContentStream.cs:115
    frame #6: 0x0000000104c6d8b0 monotouchtest`_Microsoft_MacCatalyst_System_Net_Http_CFNetworkHandler__CloseStream(this=0x0000000117feeb28) at CFNetworkHandler.cs:337
    frame #7: 0x0000000104c6e3a4 monotouchtest`_Microsoft_MacCatalyst_System_Net_Http_CFNetworkHandler___c__DisplayClass20_0___SendAsync_b__0(this=<unavailable>) at CFNetworkHandler.cs:273
    frame #8: 0x0000000104ee7810 monotouchtest`_S_P_CoreLib_System_Threading_ExecutionContext__RunInternal(executionContext=<unavailable>, callback=<unavailable>, state=<unavailable>) at ExecutionContext.cs:179
    frame #9: 0x0000000104ee6be0 monotouchtest`_S_P_CoreLib_System_Threading_CancellationTokenSource__ExecuteCallbackHandlers(this=0x0000000117feeeb0, throwOnFirstException=false) at CancellationTokenSource.cs:814
    [...]

This caused a deadlock in monotouch-test when testing CFNetworkHandler.

CFNetworkHandler isn't supported, so instead of fixing the problem in CFNetworkHandler, I suggest we just disable any corresponding tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsAnything related to tests

    Type

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions