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

DON'T sendmsg with udp closed #4321

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

gdestiny
Copy link
Contributor

Issue:

  1. uv__io_poll calls uv__udp_io with revents == POLLIN + POLLOUT
  2. uv__udp_io calls your recv_cb
  3. you close the handle in callback
  4. uv__udp_io calls uv__udp_sendmsg
  5. uv__udp_sendmsg calls uv__io_feed
  6. kaboom!

Issue:
1. uv__io_poll calls uv__udp_io with revents == POLLIN + POLLOUT
2. uv__udp_io calls your recv_cb
3. you close the handle in callback
4. uv__udp_io calls uv__udp_sendmsg
5. uv__udp_sendmsg calls uv__io_feed
6. kaboom!
@gdestiny
Copy link
Contributor Author

#4319

@gdestiny gdestiny mentioned this pull request Feb 20, 2024
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It could use a test, but I guess we decided it is pretty much impossible to get the kernel to get here unless the system is very busy?

@gdestiny gdestiny requested a review from vtjnash February 28, 2024 06:32
@vtjnash vtjnash merged commit a7c44d6 into libuv:v1.x Feb 28, 2024
26 checks passed
triplefault pushed a commit to discord/libuv that referenced this pull request Feb 29, 2024
Issue:
1. uv__io_poll calls uv__udp_io with revents == POLLIN + POLLOUT
2. uv__udp_io calls your recv_cb
3. you close the handle in callback
4. uv__udp_io calls uv__udp_sendmsg
5. uv__udp_sendmsg calls uv__io_feed
6. kaboom!
triplefault pushed a commit to discord/libuv that referenced this pull request Mar 5, 2024
Issue:
1. uv__io_poll calls uv__udp_io with revents == POLLIN + POLLOUT
2. uv__udp_io calls your recv_cb
3. you close the handle in callback
4. uv__udp_io calls uv__udp_sendmsg
5. uv__udp_sendmsg calls uv__io_feed
6. kaboom!
triplefault pushed a commit to discord/libuv that referenced this pull request Mar 6, 2024
Issue:
1. uv__io_poll calls uv__udp_io with revents == POLLIN + POLLOUT
2. uv__udp_io calls your recv_cb
3. you close the handle in callback
4. uv__udp_io calls uv__udp_sendmsg
5. uv__udp_sendmsg calls uv__io_feed
6. kaboom!
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.

2 participants