★ wanayoo — archive 1999 https://github.com/nodejs/node/pull/21871Nouvelle recherche | Portail wanayoo
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

n-api: guard against cond null dereference #21871

Conversation

Projects
None yet
6 participants
@gabrielschulhof
Copy link
Contributor

gabrielschulhof commented Jul 18, 2018

A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds tests for the
case where the queue size is zero.

Fixes: nodejs/help#1387

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

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 18, 2018

CI to flush out potential platform-dependent bugs: https://ci.nodejs.org/job/node-test-pull-request/15937/

@gabrielschulhof gabrielschulhof force-pushed the gabrielschulhof:help-1387-tsfn-zero-queue branch from bdc2b60 to 837e716 Jul 18, 2018

@gabrielschulhof

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 18, 2018

@mhdawson
Copy link
Member

mhdawson left a comment

LGTM

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387

@gabrielschulhof gabrielschulhof force-pushed the gabrielschulhof:help-1387-tsfn-zero-queue branch from 837e716 to 6f71428 Jul 19, 2018

@gabrielschulhof

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 19, 2018

Improved the commit message a bit.

@gabrielschulhof

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 20, 2018

@gabrielschulhof

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 20, 2018

@nodejs/collaborators may I please have another review before landing this?

@gabrielschulhof

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 24, 2018

@gabrielschulhof

This comment has been minimized.

Copy link
Contributor Author

gabrielschulhof commented Jul 24, 2018

Landed in 53296e8.

gabrielschulhof added a commit that referenced this pull request Jul 24, 2018

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387
PR-URL: #21871
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@gabrielschulhof gabrielschulhof deleted the gabrielschulhof:help-1387-tsfn-zero-queue branch Jul 24, 2018

targos added a commit that referenced this pull request Jul 24, 2018

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387
PR-URL: #21871
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@targos targos referenced this pull request Jul 31, 2018

Merged

v10.8.0 proposal #22040

gabrielschulhof added a commit to gabrielschulhof/node that referenced this pull request Dec 13, 2018

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387
PR-URL: nodejs#21871
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

gabrielschulhof added a commit to gabrielschulhof/node that referenced this pull request Dec 28, 2018

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387
PR-URL: nodejs#21871
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

MylesBorins added a commit that referenced this pull request Jan 18, 2019

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387
PR-URL: #21871
Backport-PR-URL: #25002
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

rvagg added a commit that referenced this pull request Feb 28, 2019

n-api: guard against cond null dereference
A condition variable is only created by the thread-safe function if the
queue size is set to something larger than zero. This adds null-checks
around the condition variable and tests for the case where the queue
size is zero.

Fixes: nodejs/help#1387
PR-URL: #21871
Backport-PR-URL: #25002
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@MylesBorins MylesBorins referenced this pull request Mar 26, 2019

Open

v8.16.0 proposal #26933

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.