Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-4647] foundation: TestFoundation/TestNSURLSession.swift test sometimes fails with a timeout #693

Open
eeckstein opened this issue Apr 20, 2017 · 8 comments

Comments

@eeckstein
Copy link
Member

Previous ID SR-4647
Radar None
Original Reporter @eeckstein
Type Bug
Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee None
Priority Medium

md5: 4a1394511243d61e45bb58adf2ad7e6d

Issue Description:

TestFoundation/TestNSURLSession.swift:254: error: TestURLSession.test_downloadTaskWithURLAndHandler : Asynchronous wait failed - Exceeded timeout of 12.0 seconds, with unfulfilled expectations: download task with handler

@pushkarnk
Copy link

Reproduced a similar hang locally after a lot of patience. These are the threads:

* thread #&#8203;1: tid = 8106, 0x00007ffff5d08c21 libc.so.6`__GI_ppoll(fds=0x00007fffffffcf48, nfds=1, timeout=<unavailable>, sigmask=0x0000000000000000) + 145 at ppoll.c:50, name = 'TestFoundation', stop reason = signal SIGSTOP
  * frame #&#8203;0: 0x00007ffff5d08c21 libc.so.6`__GI_ppoll(fds=0x00007fffffffcf48, nfds=1, timeout=<unavailable>, sigmask=0x0000000000000000) + 145 at ppoll.c:50
    frame #&#8203;1: 0x00007ffff713aa31 libFoundation.so`__CFRunLoopServiceFileDescriptors + 225
    frame #&#8203;2: 0x00007ffff7136807 libFoundation.so`__CFRunLoopRun + 1095
    frame #&#8203;3: 0x00007ffff7136179 libFoundation.so`CFRunLoopRunSpecific + 489
    frame #&#8203;4: 0x00007ffff74046ce libFoundation.so`_T010Foundation7RunLoopC3runyAA4DateV5until_tF + 382
    frame #&#8203;5: 0x00007ffff7f46956 libXCTest.so`_T06XCTest0A4CaseC19waitForExpectationsySd7timeout_s12StaticStringV4fileSu4liney10Foundation7NSErrorCSgcSg7handlertF + 502
    frame #&#8203;6: 0x00000000006cb5f6 TestFoundation`_T014TestFoundation0A10URLSessionC37test_dataTaskWithURLCompletionHandleryyF + 1510
    frame #&#8203;7: 0x00000000006dd318 TestFoundation`_T0TA.391 + 24
    frame #&#8203;8: 0x0000000000444b26 TestFoundation`_T0s5Error_pIxzo_ytytsAA_pIxirzo_TR + 22
    frame #&#8203;9: 0x00000000006dd43b TestFoundation`_T0s5Error_pIxzo_ytytsAA_pIxirzo_TRTA + 91
    frame #&#8203;10: 0x00007ffff7f663bf libXCTest.so`_T0ytyts5Error_pIxirzo_sAA_pIxzo_TRTA + 47
    frame #&#8203;11: 0x00007ffff7f5a0d1 libXCTest.so`_T06XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_Tf4gg_n + 81
    frame #&#8203;12: 0x00007ffff7f662df libXCTest.so`_T06XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA + 79
    frame #&#8203;13: 0x00007ffff7f66f89 libXCTest.so`_T06XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA.190 + 9
    frame #&#8203;14: 0x00007ffff7f6623b libXCTest.so`_T06XCTest0A4CaseCs5Error_pIxxzo_ACytsAD_pIxirzo_TRTA + 59
    frame #&#8203;15: 0x00007ffff7f67019 libXCTest.so`_T06XCTest0A4CaseCs5Error_pIxxzo_ACytsAD_pIxirzo_TRTA.183 + 9
    frame #&#8203;16: 0x00007ffff7f5c110 libXCTest.so`_T06XCTest0A4CaseCyts5Error_pIxirzo_ACsAD_pIxxzo_TRTA + 64
    frame #&#8203;17: 0x00007ffff7f40956 libXCTest.so`_T06XCTest0A4CaseC10invokeTestyyF + 102
    frame #&#8203;18: 0x00007ffff7f58285 libXCTest.so`_T06XCTest0A4CaseC7performyAA0A3RunCFTf4gn_n + 309
    frame #&#8203;19: 0x00007ffff7f4083e libXCTest.so`_T06XCTest0A4CaseC7performyAA0A3RunCF + 14
    frame #&#8203;20: 0x00007ffff7f3ea55 libXCTest.so`_T06XCTestAAC3runyyF + 549
    frame #&#8203;21: 0x00007ffff7f586ce libXCTest.so`_T06XCTest0A5SuiteC7performyAA0A3RunCFTf4gn_n + 766
    frame #&#8203;22: 0x00007ffff7f58aa1 libXCTest.so`_T06XCTest0A5SuiteC7performyAA0A3RunCFTf4gn_n + 1745
    frame #&#8203;23: 0x00007ffff7f58aa1 libXCTest.so`_T06XCTest0A5SuiteC7performyAA0A3RunCFTf4gn_n + 1745
    frame #&#8203;24: 0x00007ffff7f42e2c libXCTest.so`_T06XCTest7XCTMains5NeverOSayAA0A4CaseCm04testD5Class_SaySS_yAFKctG8allTeststGF + 4556
    frame #&#8203;25: 0x0000000000435955 TestFoundation`main + 7349
    frame #&#8203;26: 0x00007ffff5c2e830 libc.so.6`__libc_start_main(main=(TestFoundation`main), argc=1, argv=0x00007fffffffe468, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffe458) + 240 at libc-start.c:291
    frame #&#8203;27: 0x0000000000433bb9 TestFoundation`_start + 41

  thread #&#8203;2: tid = 8155, 0x00007ffff6c8ea15 libpthread.so.0`do_futex_wait + 69, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff6c8ea15 libpthread.so.0`do_futex_wait + 69
    frame #&#8203;1: 0x00007ffff6c8eadf libpthread.so.0`__new_sem_wait_slow + 95
    frame #&#8203;2: 0x00007ffff6c8eb92 libpthread.so.0`sem_timedwait + 66
    frame #&#8203;3: 0x00007ffff7ef6afb libdispatch.so`manager_main(unused=<unavailable>) + 2283 at manager.c:620
    frame #&#8203;4: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;5: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;3: tid = 8156, 0x00007ffff6c8f76d libpthread.so.0`__GI_accept + 45, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff6c8f76d libpthread.so.0`__GI_accept + 45
    frame #&#8203;1: 0x0000000000437c2b TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_s5Int32VyXKfu_ + 123
    frame #&#8203;2: 0x0000000000441839 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_s5Int32VyXKfu_TA + 73
    frame #&#8203;3: 0x00000000004361a0 TestFoundation`_T014TestFoundation10_TCPSocketC7attempt33_AC276A005C0DEB782845E1C79EF92149LLs5Int32VSS_SS4fileSu4lineSbAGc5validAGyXKtKF + 144
    frame #&#8203;4: 0x0000000000437999 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_ + 409
    frame #&#8203;5: 0x0000000000437aef TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_TA + 95
    frame #&#8203;6: 0x0000000000437186 TestFoundation`_T0SpySC8sockaddrVGs5Error_pIxyzo_ACytsAD_pIxyrzo_TR + 22
    frame #&#8203;7: 0x0000000000437b9b TestFoundation`_T0SpySC8sockaddrVGs5Error_pIxyzo_ACytsAD_pIxyrzo_TRTA.13 + 91
    frame #&#8203;8: 0x00007ffff7aae937 libswiftCore.so`_T0SP17withMemoryReboundqd_0_qd__m2to_Si8capacityqd_0_SPyqd__GKctKr0_lF + 55
    frame #&#8203;9: 0x00007ffff7c7692f libswiftCore.so`_T0Sp17withMemoryReboundqd_0_qd__m2to_Si8capacityqd_0_Spyqd__GKctKr0_lF + 15
    frame #&#8203;10: 0x00000000004376c0 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKF + 512
    frame #&#8203;11: 0x000000000043ab07 TestFoundation`_T014TestFoundation11_HTTPServerC6listenyAA15ServerSemaphoreC6notify_tKF + 71
    frame #&#8203;12: 0x000000000043d63e TestFoundation`_T014TestFoundation0A16URLSessionServerC5startyAA0D9SemaphoreC7started_tKF + 94
    frame #&#8203;13: 0x00000000006c9f5d TestFoundation`_T014TestFoundation0A10URLSessionC9runServer33_F3FECA45EA2EBA0C2372DABFC6747FB7LLyAA0E9SemaphoreC4with_SdSg10startDelayAI04sendP0SiSg10bodyChunkstKF + 605
    frame #&#8203;14: 0x00000000006cb6f5 TestFoundation`_T014TestFoundation0A10URLSessionC37test_dataTaskWithURLCompletionHandleryyFyycfU_ + 133
    frame #&#8203;15: 0x00000000006d5a03 TestFoundation`_T014TestFoundation0A10URLSessionC37test_dataTaskWithURLCompletionHandleryyFyycfU_TA + 67
    frame #&#8203;16: 0x000000000043c1e9 TestFoundation`_T0Ix_IyB_TR + 41
    frame #&#8203;17: 0x00007ffff7ec8f37 libdispatch.so`_dispatch_call_block_and_release + 7
    frame #&#8203;18: 0x00007ffff7ed7455 libdispatch.so`_dispatch_root_queue_drain + 533
    frame #&#8203;19: 0x00007ffff7ef6f0f libdispatch.so`worker_main(unused=<unavailable>) + 207 at manager.c:506
    frame #&#8203;20: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;21: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;4: tid = 8157, 0x00007ffff5d0e8e9 libc.so.6`syscall + 25 at syscall.S:38, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff5d0e8e9 libc.so.6`syscall + 25 at syscall.S:38
    frame #&#8203;1: 0x00007ffff7edfa09 libdispatch.so`_dispatch_thread_event_wait_slow + 57
    frame #&#8203;2: 0x00007ffff7ed6a38 libdispatch.so`_dispatch_sync_wait + 264
    frame #&#8203;3: 0x00007ffff7ee85ad libdispatch.so`_T08Dispatch0A5QueueC4syncxxyKc7execute_tKlF + 301
    frame #&#8203;4: 0x00007ffff74c30cb libFoundation.so`_T010Foundation14URLSessionTaskC19configureEasyHandle33_655ABFF49E18DABF12076554C1107FC4LLyAA10URLRequestV3for_tFTf4gn_n + 3931
    frame #&#8203;5: 0x00007ffff74c524d libFoundation.so`_T010Foundation14URLSessionTaskC16startNewTransfer33_655ABFF49E18DABF12076554C1107FC4LLyAA10URLRequestV4with_tFTf4gn_n + 2237
    frame #&#8203;6: 0x00007ffff74b56c8 libFoundation.so`_T010Foundation14URLSessionTaskC13performResume33_655ABFF49E18DABF12076554C1107FC4LLyyF + 104
    frame #&#8203;7: 0x00007ffff74cc009 libFoundation.so`_T010Foundation14URLSessionTaskC6resumeyyFyycfU_yycfU_TA + 9
    frame #&#8203;8: 0x00007ffff73b1d40 libFoundation.so`_T0Ix_IyB_TR + 32
    frame #&#8203;9: 0x00007ffff7ec8f37 libdispatch.so`_dispatch_call_block_and_release + 7
    frame #&#8203;10: 0x00007ffff7ed4c9d libdispatch.so`_dispatch_queue_serial_drain + 493
    frame #&#8203;11: 0x00007ffff7ed5650 libdispatch.so`_dispatch_queue_invoke + 976
    frame #&#8203;12: 0x00007ffff7ed73b4 libdispatch.so`_dispatch_root_queue_drain + 372
    frame #&#8203;13: 0x00007ffff7ef5f68 libdispatch.so`overcommit_worker_main(unused=<unavailable>) + 264 at manager.c:315
    frame #&#8203;14: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;15: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;5: tid = 8158, 0x00007ffff6c8f76d libpthread.so.0`__GI_accept + 45, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff6c8f76d libpthread.so.0`__GI_accept + 45
    frame #&#8203;1: 0x0000000000437c2b TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_s5Int32VyXKfu_ + 123
    frame #&#8203;2: 0x0000000000441839 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_s5Int32VyXKfu_TA + 73
    frame #&#8203;3: 0x00000000004361a0 TestFoundation`_T014TestFoundation10_TCPSocketC7attempt33_AC276A005C0DEB782845E1C79EF92149LLs5Int32VSS_SS4fileSu4lineSbAGc5validAGyXKtKF + 144
    frame #&#8203;4: 0x0000000000437999 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_ + 409
    frame #&#8203;5: 0x0000000000437aef TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_TA + 95
    frame #&#8203;6: 0x0000000000437186 TestFoundation`_T0SpySC8sockaddrVGs5Error_pIxyzo_ACytsAD_pIxyrzo_TR + 22
    frame #&#8203;7: 0x0000000000437b9b TestFoundation`_T0SpySC8sockaddrVGs5Error_pIxyzo_ACytsAD_pIxyrzo_TRTA.13 + 91
    frame #&#8203;8: 0x00007ffff7aae937 libswiftCore.so`_T0SP17withMemoryReboundqd_0_qd__m2to_Si8capacityqd_0_SPyqd__GKctKr0_lF + 55
    frame #&#8203;9: 0x00007ffff7c7692f libswiftCore.so`_T0Sp17withMemoryReboundqd_0_qd__m2to_Si8capacityqd_0_Spyqd__GKctKr0_lF + 15
    frame #&#8203;10: 0x00000000004376c0 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKF + 512
    frame #&#8203;11: 0x000000000043ab07 TestFoundation`_T014TestFoundation11_HTTPServerC6listenyAA15ServerSemaphoreC6notify_tKF + 71
    frame #&#8203;12: 0x000000000043d63e TestFoundation`_T014TestFoundation0A16URLSessionServerC5startyAA0D9SemaphoreC7started_tKF + 94
    frame #&#8203;13: 0x00000000006c9f5d TestFoundation`_T014TestFoundation0A10URLSessionC9runServer33_F3FECA45EA2EBA0C2372DABFC6747FB7LLyAA0E9SemaphoreC4with_SdSg10startDelayAI04sendP0SiSg10bodyChunkstKF + 605
    frame #&#8203;14: 0x00000000006cca85 TestFoundation`_T014TestFoundation0A10URLSessionC27test_dataTaskWithURLRequestyyFyycfU_ + 133
    frame #&#8203;15: 0x00000000006d5c43 TestFoundation`_T014TestFoundation0A10URLSessionC27test_dataTaskWithURLRequestyyFyycfU_TA + 67
    frame #&#8203;16: 0x000000000043c1e9 TestFoundation`_T0Ix_IyB_TR + 41
    frame #&#8203;17: 0x00007ffff7ec8f37 libdispatch.so`_dispatch_call_block_and_release + 7
    frame #&#8203;18: 0x00007ffff7ed7455 libdispatch.so`_dispatch_root_queue_drain + 533
    frame #&#8203;19: 0x00007ffff7ef6f0f libdispatch.so`worker_main(unused=<unavailable>) + 207 at manager.c:506
    frame #&#8203;20: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;21: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;6: tid = 8159, 0x00007ffff6c8f76d libpthread.so.0`__GI_accept + 45, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff6c8f76d libpthread.so.0`__GI_accept + 45
    frame #&#8203;1: 0x0000000000437c2b TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_s5Int32VyXKfu_ + 123
    frame #&#8203;2: 0x0000000000441839 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_s5Int32VyXKfu_TA + 73
    frame #&#8203;3: 0x00000000004361a0 TestFoundation`_T014TestFoundation10_TCPSocketC7attempt33_AC276A005C0DEB782845E1C79EF92149LLs5Int32VSS_SS4fileSu4lineSbAGc5validAGyXKtKF + 144
    frame #&#8203;4: 0x0000000000437999 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_ + 409
    frame #&#8203;5: 0x0000000000437aef TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKFySpySC8sockaddrVGKcfU_TA + 95
    frame #&#8203;6: 0x0000000000437186 TestFoundation`_T0SpySC8sockaddrVGs5Error_pIxyzo_ACytsAD_pIxyrzo_TR + 22
    frame #&#8203;7: 0x0000000000437b9b TestFoundation`_T0SpySC8sockaddrVGs5Error_pIxyzo_ACytsAD_pIxyrzo_TRTA.13 + 91
    frame #&#8203;8: 0x00007ffff7aae937 libswiftCore.so`_T0SP17withMemoryReboundqd_0_qd__m2to_Si8capacityqd_0_SPyqd__GKctKr0_lF + 55
    frame #&#8203;9: 0x00007ffff7c7692f libswiftCore.so`_T0Sp17withMemoryReboundqd_0_qd__m2to_Si8capacityqd_0_Spyqd__GKctKr0_lF + 15
    frame #&#8203;10: 0x00000000004376c0 TestFoundation`_T014TestFoundation10_TCPSocketC16acceptConnectionyAA15ServerSemaphoreC6notify_tKF + 512
    frame #&#8203;11: 0x000000000043ab07 TestFoundation`_T014TestFoundation11_HTTPServerC6listenyAA15ServerSemaphoreC6notify_tKF + 71
    frame #&#8203;12: 0x000000000043d63e TestFoundation`_T014TestFoundation0A16URLSessionServerC5startyAA0D9SemaphoreC7started_tKF + 94
    frame #&#8203;13: 0x00000000006c9f5d TestFoundation`_T014TestFoundation0A10URLSessionC9runServer33_F3FECA45EA2EBA0C2372DABFC6747FB7LLyAA0E9SemaphoreC4with_SdSg10startDelayAI04sendP0SiSg10bodyChunkstKF + 605
    frame #&#8203;14: 0x00000000006caa25 TestFoundation`_T014TestFoundation0A10URLSessionC20test_dataTaskWithURLyyFyycfU_ + 133
    frame #&#8203;15: 0x00000000006cab93 TestFoundation`_T014TestFoundation0A10URLSessionC20test_dataTaskWithURLyyFyycfU_TA + 67
    frame #&#8203;16: 0x000000000043c1e9 TestFoundation`_T0Ix_IyB_TR + 41
    frame #&#8203;17: 0x00007ffff7ec8f37 libdispatch.so`_dispatch_call_block_and_release + 7
    frame #&#8203;18: 0x00007ffff7ed7455 libdispatch.so`_dispatch_root_queue_drain + 533
    frame #&#8203;19: 0x00007ffff7ef6f0f libdispatch.so`worker_main(unused=<unavailable>) + 207 at manager.c:506
    frame #&#8203;20: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;21: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;8: tid = 8275, 0x00007ffff5d08c21 libc.so.6`__GI_ppoll(fds=0x00007fffe5ffaa88, nfds=1, timeout=<unavailable>, sigmask=0x0000000000000000) + 145 at ppoll.c:50, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff5d08c21 libc.so.6`__GI_ppoll(fds=0x00007fffe5ffaa88, nfds=1, timeout=<unavailable>, sigmask=0x0000000000000000) + 145 at ppoll.c:50
    frame #&#8203;1: 0x00007ffff713aa31 libFoundation.so`__CFRunLoopServiceFileDescriptors + 225
    frame #&#8203;2: 0x00007ffff7136807 libFoundation.so`__CFRunLoopRun + 1095
    frame #&#8203;3: 0x00007ffff7136179 libFoundation.so`CFRunLoopRunSpecific + 489
    frame #&#8203;4: 0x00007ffff740427e libFoundation.so`_T010Foundation7RunLoopC3runyyF + 110
    frame #&#8203;5: 0x00007ffff745775d libFoundation.so`_T010Foundation7ProcessC5setup33_05FBE738056ADAC488E6D2B534411459LLyyFZyycfU_yycfU_ + 701
    frame #&#8203;6: 0x00007ffff7460877 libFoundation.so`_T010Foundation13NSThreadStart33_513815EE0AA0753AFF631398622CF939LLSvSgADF + 311
    frame #&#8203;7: 0x00007ffff7461859 libFoundation.so`_T010Foundation13NSThreadStart33_513815EE0AA0753AFF631398622CF939LLSvSgADFTo + 9
    frame #&#8203;8: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;9: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;9: tid = 8276, 0x00007ffff5d0a9e3 libc.so.6`__GI_select + 51 at syscall-template.S:84, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff5d0a9e3 libc.so.6`__GI_select + 51 at syscall-template.S:84
    frame #&#8203;1: 0x00007ffff713ed0c libFoundation.so`__CFSocketManager + 652
    frame #&#8203;2: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;3: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;10: tid = 8278, 0x00007ffff5d14e23 libc.so.6`__GI_epoll_wait + 51 at syscall-template.S:84, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff5d14e23 libc.so.6`__GI_epoll_wait + 51 at syscall-template.S:84
    frame #&#8203;1: 0x00007ffff7edf525 libdispatch.so`_dispatch_event_loop_drain + 53
    frame #&#8203;2: 0x00007ffff7edb2c8 libdispatch.so`_dispatch_mgr_invoke + 136
    frame #&#8203;3: 0x00007ffff7edb08b libdispatch.so`_dispatch_mgr_thread + 11
    frame #&#8203;4: 0x00007ffff7ed73b4 libdispatch.so`_dispatch_root_queue_drain + 372
    frame #&#8203;5: 0x00007ffff7ed71b8 libdispatch.so`_dispatch_worker_thread + 440
    frame #&#8203;6: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;7: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

  thread #&#8203;11: tid = 9095, 0x00007ffff6c8c709 libpthread.so.0`__pthread_cond_timedwait + 297, name = 'TestFoundation'
    frame #&#8203;0: 0x00007ffff6c8c709 libpthread.so.0`__pthread_cond_timedwait + 297
    frame #&#8203;1: 0x00007ffff7ef5fb4 libdispatch.so`overcommit_worker_main(unused=<unavailable>) + 340 at manager.c:326
    frame #&#8203;2: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #&#8203;3: 0x00007ffff5d1482d libc.so.6`__clone + 109 at clone.S:109

@pushkarnk
Copy link

thread #4 is of particular interest - it seems to be blocked on a Dispatch.sync call, the problem is that the stacks don't reveal any other task running on that queue

@eeckstein
Copy link
Member Author

BTW, the same problem show up in other tests, like TestURLSession.test_taskTimeout:

https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/850/consoleFull#1369603219ee1a197b-acac-4b17-83cf-a53b95139a76

@swift-ci
Copy link

Comment by W S (JIRA)

FWIW, I believe I had timeout problems with (this?) URL test on AWS Linux since it was added. Unfortunately, I only ran the tests manually, and I believe the URLSession tests always failed, so I disabled them.
Maybe a change to dispatch is increasing occurrences of deadlock/whatever the underlying issue is?

@pushkarnk
Copy link

Two more failures in TestFoundation/TestNSURLSession:
https://bugs.swift.org/browse/SR-4655
https://bugs.swift.org/browse/SR-4677

@pushkarnk
Copy link

Came across the same failure with the `TestURLSession.test_verifyHttpAdditionalHeaders` test case

@pushkarnk
Copy link

The async barrier task is not executing at all, blocking all the subsequently dispatched task. Though we have a PR to work around this apparent issue, I'm going to assign this to Dispatch.

@swift-ci
Copy link

Comment by Mamatha Busi (JIRA)

Foundation PR for a workaround to this issue: apple/swift-corelibs-foundation#982

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants