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

src: fix crash on OnStreamRead on Windows #45878

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

santigimeno
Copy link
Member

@santigimeno santigimeno self-assigned this Dec 16, 2022
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Dec 16, 2022
@santigimeno santigimeno added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 16, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 16, 2022
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM, but is it possible to add a test?

On Windows it's perfectly possible that the `uv_tcp_t` `read_cb` is
called with an error and a null `uv_buf_t` if it corresponds to a
`UV_HANDLE_ZERO_READ` read. Handle this case without crashing.

Fixes: nodejs#40764
@santigimeno
Copy link
Member Author

but is it possible to add a test?

Test added. PTAL. Thanks!

@santigimeno santigimeno added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 20, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 20, 2022
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

Thanks for the test.

@santigimeno santigimeno added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 20, 2022
@nodejs-github-bot
Copy link
Collaborator

@santigimeno santigimeno added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 22, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 22, 2022
@nodejs-github-bot
Copy link
Collaborator

@santigimeno santigimeno added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 26, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 26, 2022
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 28, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 28, 2022
@nodejs-github-bot nodejs-github-bot merged commit 34af1f6 into nodejs:main Dec 28, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 34af1f6

targos pushed a commit that referenced this pull request Jan 1, 2023
On Windows it's perfectly possible that the `uv_tcp_t` `read_cb` is
called with an error and a null `uv_buf_t` if it corresponds to a
`UV_HANDLE_ZERO_READ` read. Handle this case without crashing.

Fixes: #40764
PR-URL: #45878
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Jan 2, 2023
RafaelGSS pushed a commit that referenced this pull request Jan 4, 2023
On Windows it's perfectly possible that the `uv_tcp_t` `read_cb` is
called with an error and a null `uv_buf_t` if it corresponds to a
`UV_HANDLE_ZERO_READ` read. Handle this case without crashing.

Fixes: #40764
PR-URL: #45878
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Jan 5, 2023
On Windows it's perfectly possible that the `uv_tcp_t` `read_cb` is
called with an error and a null `uv_buf_t` if it corresponds to a
`UV_HANDLE_ZERO_READ` read. Handle this case without crashing.

Fixes: #40764
PR-URL: #45878
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit that referenced this pull request Jan 26, 2023
On Windows it's perfectly possible that the `uv_tcp_t` `read_cb` is
called with an error and a null `uv_buf_t` if it corresponds to a
`UV_HANDLE_ZERO_READ` read. Handle this case without crashing.

Fixes: #40764
PR-URL: #45878
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@juanarbol juanarbol mentioned this pull request Jan 28, 2023
juanarbol pushed a commit that referenced this pull request Jan 31, 2023
On Windows it's perfectly possible that the `uv_tcp_t` `read_cb` is
called with an error and a null `uv_buf_t` if it corresponds to a
`UV_HANDLE_ZERO_READ` read. Handle this case without crashing.

Fixes: #40764
PR-URL: #45878
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

c:\ws\src\stream_base.cc:567: Assertion `(buf.base) == (buffer_.base)' failed.
6 participants