Skip to content

Conversation

@Fishrock123
Copy link
Contributor

@Fishrock123Fishrock123 commented Apr 25, 2016

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • documentation is changed or added
  • the commit message follows commit guidelines
Affected core subsystem(s)

timers

Description of change

See #6204 (comment) .. this patch crashes test-handle-wrap-close-abort.js with this error:

'./node test/parallel/test-handl…' terminated by signal SIGSEGV (Address boundary error) 

refs: 9bb5a5e

(How do I keep getting this so wrong?? 😞)

@Fishrock123Fishrock123 added confirmed-bug Issues with confirmed bugs. c++ Issues and PRs that require attention from people who are familiar with C++. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. labels Apr 25, 2016
@jasnell
Copy link
Member

Been there done that ;-) ... LGTM if CI is green.

@addaleax
Copy link
Member

addaleax commented Apr 25, 2016

diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 8421d694a991..bc02d7b8fdba 100644 --- a/src/handle_wrap.cc+++ b/src/handle_wrap.cc@@ -40,7 +40,7 @@ void HandleWrap::Unref(const FunctionCallbackInfo<Value>& args){void HandleWrap::Unrefed(const FunctionCallbackInfo<Value>& args){HandleWrap* wrap = Unwrap<HandleWrap>(args.Holder()); - bool unrefed = wrap->flags_ & kUnref == 1;+ bool unrefed = IsAlive(wrap) && ((wrap->flags_ & kUnref) == 1); args.GetReturnValue().Set(unrefed)}

fixes it (not sure if it’s semantically correct though).

@estliberitasestliberitasforce-pushed the master branch 2 times, most recently from 7da4fd4 to c7066fbCompareApril 26, 2016 05:23
This reverts commit 9bb5a5e. Refs: nodejs#6395 Refs: nodejs#6204 Refs: nodejs#6401 Refs: nodejs#6382Fixes: nodejs#6381 Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
@Fishrock123Fishrock123force-pushed the timers-use-handle-unrefed-check branch from 47343ef to 9b62ab0CompareMay 3, 2016 15:04
@Fishrock123
Copy link
ContributorAuthor

@Fishrock123Fishrock123 removed the confirmed-bug Issues with confirmed bugs. label May 3, 2016
Fishrock123 added a commit to Fishrock123/node that referenced this pull request May 11, 2016
This reverts commit 9bb5a5e. This API is not suitable because it depended on being able to potentially access the handle's flag after the handle was already cleaned up. Since this is not actually possible (obviously, oops) this newer API no longer makes much sense, and the older API is more suitable. API comparison: IsRefed -> Has a strong reference AND is alive. (Deterministic) Unrefed -> Has a weak reference OR is dead. (Less deterministic) Refs: nodejs#6395 Refs: nodejs#6204 Refs: nodejs#6401 Refs: nodejs#6382Fixes: nodejs#6381 PR-URL: nodejs#6546 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
Fishrock123 added a commit to Fishrock123/node that referenced this pull request May 11, 2016
Rename slightly to HasRef() at bnoordhuis’ request. Better reflects what we actually do for this check. Refs: nodejs#6395 Refs: nodejs#6204 Refs: nodejs#6401 Refs: nodejs#6382 Refs: nodejs#6381 PR-URL: nodejs#6546 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
evanlucas pushed a commit that referenced this pull request May 17, 2016
This reverts commit 9bb5a5e. This API is not suitable because it depended on being able to potentially access the handle's flag after the handle was already cleaned up. Since this is not actually possible (obviously, oops) this newer API no longer makes much sense, and the older API is more suitable. API comparison: IsRefed -> Has a strong reference AND is alive. (Deterministic) Unrefed -> Has a weak reference OR is dead. (Less deterministic) Refs: #6395 Refs: #6204 Refs: #6401 Refs: #6382Fixes: #6381 PR-URL: #6546 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
evanlucas pushed a commit that referenced this pull request May 17, 2016
Rename slightly to HasRef() at bnoordhuis’ request. Better reflects what we actually do for this check. Refs: #6395 Refs: #6204 Refs: #6401 Refs: #6382 Refs: #6381 PR-URL: #6546 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Fishrock123@jasnell@addaleax