GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — net: fix crash if POLLHUP is received by santigimeno · Pull Request #32590 · nodejs/node

Conversation

@santigimeno

@santigimeno santigimeno commented Mar 31, 2020

Copy link
Copy Markdown
Member

If the onread socket option is used and a POLLHUP event is received,
libuv returns UV_EOF along with a NULL buffer in the read callback,
causing the crash. Deal with this case.
See: https://github.com/nodejs/node/blob/master/deps/uv/src/unix/stream.c#L1317-L1323

Fixes: #31823

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

himself65, bricss, and juanarbol reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
@santigimeno
net: fix crash if POLLHUP is received
00e04bc
If the `onread` socket option is used and a `POLLHUP` event is received,
libuv returns `UV_EOF` along with a `NULL` buffer in the read callback,
causing the crash. Deal with this case.

Fixes: nodejs#31823
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 31, 2020
addaleax
addaleax approved these changes Mar 31, 2020
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Apr 1, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30300/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis approved these changes Apr 1, 2020
View reviewed changes
jasnell
jasnell approved these changes Apr 1, 2020
View reviewed changes
juanarbol
juanarbol reviewed Apr 2, 2020
View reviewed changes
Comment thread src/stream_base.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@addaleax @juanarbol
fixup! net: fix crash if POLLHUP is received
fed0629
Co-Authored-By: Juan José <[email protected]>
@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 5, 2020
@nodejs-github-bot

nodejs-github-bot commented Apr 5, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30466/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Apr 5, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30486/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Apr 6, 2020

Copy link
Copy Markdown
Member

Landed in c7a235f

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax pushed a commit that referenced this pull request Apr 6, 2020
@santigimeno @addaleax
net: fix crash if POLLHUP is received
c7a235f
If the `onread` socket option is used and a `POLLHUP` event is received,
libuv returns `UV_EOF` along with a `NULL` buffer in the read callback,
causing the crash. Deal with this case.

Fixes: #31823

PR-URL: #32590
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@addaleax addaleax closed this Apr 6, 2020
BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
@santigimeno @BethGriggs
net: fix crash if POLLHUP is received
730acb5
If the `onread` socket option is used and a `POLLHUP` event is received,
libuv returns `UV_EOF` along with a `NULL` buffer in the read callback,
causing the crash. Deal with this case.

Fixes: #31823

PR-URL: #32590
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Apr 12, 2020
@santigimeno @targos
net: fix crash if POLLHUP is received
dd74601
If the `onread` socket option is used and a `POLLHUP` event is received,
libuv returns `UV_EOF` along with a `NULL` buffer in the read callback,
causing the crash. Deal with this case.

Fixes: #31823

PR-URL: #32590
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Apr 13, 2020
v13.13.0 release proposal #32813
Merged
targos pushed a commit that referenced this pull request Apr 22, 2020
@santigimeno @targos
net: fix crash if POLLHUP is received
ff5ab6f
If the `onread` socket option is used and a `POLLHUP` event is received,
libuv returns `UV_EOF` along with a `NULL` buffer in the read callback,
causing the crash. Deal with this case.

Fixes: #31823

PR-URL: #32590
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Apr 22, 2020
v12.16.3 release proposal #33009
Merged
animetosho added a commit to animetosho/Nyuu that referenced this pull request Dec 30, 2020
@animetosho
Work around nodejs bug with 'onread' handler
7a25aa7
nodejs/node#32590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@juanarbol juanarbol juanarbol left review comments
@bnoordhuis bnoordhuis bnoordhuis approved these changes
@jasnell jasnell jasnell approved these changes
@addaleax addaleax addaleax approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

net.connection.onread handler: may crash on socket end

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@santigimeno @nodejs-github-bot @addaleax @bnoordhuis @jasnell @juanarbol
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.