buffer: fix assertion error in WeakCallback#3329
Closed
indutny wants to merge 2 commits intonodejs:masterfrom
Closed
buffer: fix assertion error in WeakCallback#3329indutny wants to merge 2 commits intonodejs:masterfrom
indutny wants to merge 2 commits intonodejs:masterfrom
Conversation
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`,
therefore `SPREAD_ARG` will abort with:
Assertion failed: ((object)->IsUint8Array())
Make changes necessary to migrate it to `ArrayBuffer`.
See: nodejs#3080 (comment)
Closed
Member
Author
src/node_buffer.cc
Outdated
Contributor
There was a problem hiding this comment.
@TooTallNate has mentioned how some use a zero-length buffer to keep track of things in their modules. A zero-length buffer would be nullptr. Instead should be like:
if (obj_c.Length() > 0) CHECK_NE(obj_data, nullptr);
Contributor
There was a problem hiding this comment.
might want to add a test for this case as well.
Contributor
|
Left 2 comments. Other than that, LGTM |
Member
Author
|
@trevnorris fixed! |
Contributor
|
LGTM |
Member
Author
|
@mikemorris may I ask you to give a try to this patch? Does it fix problem for you? |
Member
Author
|
Great, thank you for confirming this! cc @jasnell |
indutny
added a commit
that referenced
this pull request
Oct 13, 2015
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`,
therefore `SPREAD_ARG` will abort with:
Assertion failed: ((object)->IsUint8Array())
Make changes necessary to migrate it to `ArrayBuffer`.
See: #3080 (comment)
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: #3329
Member
|
Landed in 931118c |
indutny
added a commit
that referenced
this pull request
Oct 13, 2015
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`,
therefore `SPREAD_ARG` will abort with:
Assertion failed: ((object)->IsUint8Array())
Make changes necessary to migrate it to `ArrayBuffer`.
See: #3080 (comment)
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: #3329
Member
|
Landed in v4.x in b3cbd13 |
jasnell
added a commit
that referenced
this pull request
Oct 13, 2015
jasnell
added a commit
that referenced
this pull request
Oct 13, 2015
jasnell
added a commit
that referenced
this pull request
Oct 13, 2015
jasnell
added a commit
that referenced
this pull request
Oct 13, 2015
jasnell
added a commit
that referenced
this pull request
Oct 13, 2015
Trott
reviewed
Jan 4, 2019
| slice = null; | ||
| gc(); | ||
| gc(); | ||
| gc(); |
Member
There was a problem hiding this comment.
It's unclear to me why calling gc() three times is required here. @indutny Sorry to pull this up from more than 3 years ago, but do you remember why?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CallbackInfois now bound toArrayBufferinstance, notUint8Array,therefore
SPREAD_ARGwill abort with:Make changes necessary to migrate it to
ArrayBuffer.See: #3080 (comment)
R=@trevnorris