Skip to content

Conversation

@weissi
Copy link
Contributor

@weissi weissi commented May 3, 2019

this is a test that documents the problem seen in

@weissi weissi requested review from MadCoder and dgrove-oss May 3, 2019 13:10
@weissi
Copy link
Contributor Author

weissi commented May 3, 2019

@swift-ci test macOS

@weissi
Copy link
Contributor Author

weissi commented May 3, 2019

@swift-ci please test

@gottesmm
Copy link
Contributor

gottesmm commented May 3, 2019

@weissi can you provide a patch that fixes this as well?

@gottesmm
Copy link
Contributor

gottesmm commented May 3, 2019

@MadCoder @ktopley-apple this demonstrates a problem that we have been hitting on the linux pull request bots in c (so we can run it unconditionally in all the CI with/without swift). I don't know if it effects Darwin.

@weissi
Copy link
Contributor Author

weissi commented May 3, 2019

I don't know if it effects Darwin.

It does not affect Darwin because the bug is in the way Dispatch uses epoll. On Darwin it uses kqueue and on kqueue there are no un-maskable events.

@weissi
Copy link
Contributor Author

weissi commented May 3, 2019

@weissi can you provide a patch that fixes this as well?

Sorry, that fix isn't trivial and I really don't know enough about the dispatch implementation there.

@adierking
Copy link
Contributor

#477 is a tentative fix which makes this test pass. Thanks for providing this :)

@compnerd
Copy link
Member

compnerd commented May 5, 2019

Please test with following PRs:
#477

@swift-ci please test

@gottesmm
Copy link
Contributor

gottesmm commented May 6, 2019

@compnerd cross repo PR testing only works cross repo ; ).

gottesmm pushed a commit to gottesmm/swift-corelibs-libdispatch that referenced this pull request May 6, 2019
If epoll_wait() reports EPOLLHUP, we must respond immediately and
unregister the event or else Dispatch will go into a spinloop.

This makes dispatch_io_pipe_close (swiftlang#476) pass on Linux with identical
output to Darwin.
@gottesmm
Copy link
Contributor

gottesmm commented May 6, 2019

I created a combined PR for this with the fix. It is going through testing now. I am going to close this so there isn't confusion and we keep the record that it failed. The important part from the relevant log:

13:11:42 + /usr/bin/cmake --build /home/buildnode/jenkins/workspace/swift-corelibs-libdispatch-PR-Linux/buildbot_linux/libdispatch-linux-x86_64 -- -j16 test
13:11:42 [0/1][  0%][0.000s] Running tests...
13:11:42 Test project /home/buildnode/jenkins/workspace/swift-corelibs-libdispatch-PR-Linux/buildbot_linux/libdispatch-linux-x86_64
13:11:42       Start  1: dispatch_apply
13:11:43  1/22 Test  #1: dispatch_apply ...................   Passed    0.20 sec
13:11:43       Start  2: dispatch_api
13:11:43  2/22 Test  #2: dispatch_api .....................   Passed    0.10 sec
13:11:43       Start  3: dispatch_debug
13:11:43  3/22 Test  #3: dispatch_debug ...................   Passed    0.10 sec
13:11:43       Start  4: dispatch_queue_finalizer
13:11:44  4/22 Test  #4: dispatch_queue_finalizer .........   Passed    1.11 sec
13:11:44       Start  5: dispatch_group
13:12:06  5/22 Test  #5: dispatch_group ...................   Passed   21.80 sec
13:12:06       Start  6: dispatch_overcommit
13:12:06  6/22 Test  #6: dispatch_overcommit ..............   Passed    0.12 sec
13:12:06       Start  7: dispatch_context_for_key
13:12:06  7/22 Test  #7: dispatch_context_for_key .........   Passed    0.11 sec
13:12:06       Start  8: dispatch_after
13:12:15  8/22 Test  #8: dispatch_after ...................   Passed    9.11 sec
13:12:15       Start  9: dispatch_timer
13:12:17  9/22 Test  #9: dispatch_timer ...................   Passed    2.11 sec
13:12:17       Start 10: dispatch_timer_short
13:12:18 10/22 Test #10: dispatch_timer_short .............   Passed    1.20 sec
13:12:18       Start 11: dispatch_timer_timeout
13:12:25 11/22 Test #11: dispatch_timer_timeout ...........   Passed    6.11 sec
13:12:25       Start 12: dispatch_sema
13:12:25 12/22 Test #12: dispatch_sema ....................   Passed    0.11 sec
13:12:25       Start 13: dispatch_timer_bit31
13:12:27 13/22 Test #13: dispatch_timer_bit31 .............   Passed    2.25 sec
13:12:27       Start 14: dispatch_timer_bit63
13:12:28 14/22 Test #14: dispatch_timer_bit63 .............   Passed    1.11 sec
13:12:28       Start 15: dispatch_timer_set_time
13:12:30 15/22 Test #15: dispatch_timer_set_time ..........   Passed    2.41 sec
13:12:30       Start 16: dispatch_starfish
13:12:37 16/22 Test #16: dispatch_starfish ................   Passed    6.36 sec
13:12:37       Start 17: dispatch_data
13:12:37 17/22 Test #17: dispatch_data ....................   Passed    0.11 sec
13:12:37       Start 18: dispatch_io_net
13:12:37 18/22 Test #18: dispatch_io_net ..................   Passed    0.42 sec
13:12:37       Start 19: dispatch_io_pipe_close
13:12:42 19/22 Test #19: dispatch_io_pipe_close ...........***Timeout   5.01 sec
13:12:42       Start 20: dispatch_select
13:12:43 20/22 Test #20: dispatch_select ..................   Passed    0.31 sec
13:12:43       Start 21: dispatch_c99
13:12:43 21/22 Test #21: dispatch_c99 .....................   Passed    0.11 sec
13:12:43       Start 22: dispatch_plusplus
13:12:43 22/22 Test #22: dispatch_plusplus ................   Passed    0.11 sec
13:12:43 
13:12:43 95% tests passed, 1 tests failed out of 22
13:12:43 
13:12:43 Total Test time (real) =  60.40 sec
13:12:43 
13:12:43 The following tests FAILED:
13:12:43 	 19 - dispatch_io_pipe_close (Timeout)
13:12:43 Errors while running CTest

@gottesmm gottesmm closed this May 6, 2019
weissi pushed a commit to weissi/swift-corelibs-libdispatch that referenced this pull request May 14, 2019
If epoll_wait() reports EPOLLHUP, we must respond immediately and
unregister the event or else Dispatch will go into a spinloop.

This makes dispatch_io_pipe_close (swiftlang#476) pass on Linux with identical
output to Darwin.

(cherry picked from commit ffc7133)
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
If epoll_wait() reports EPOLLHUP, we must respond immediately and
unregister the event or else Dispatch will go into a spinloop.

This makes dispatch_io_pipe_close (#476) pass on Linux with identical
output to Darwin.

Signed-off-by: Kim Topley <ktopley@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants