GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — test: test buffer behavior when zeroFill undefined by Trott · Pull Request #11706 · nodejs/node Conversation
|
|
I don't know. This is brittle both in how it monkey-patches the bindings and how it expects buffers to contain random garbage. If in an individual run the buffers all come from freshly mmap-ed memory (not inconceivable with a loop like that) the test will fail. You could ameliorate it somewhat by filling the buffer with non-zero data so that it's not all zeroes when its memory is reused for another buffer but that's still no guarantee. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yes, indeed. Best what can be said for it is that it's probably better than no test at all (our current situation). Would happily close this in favor of a C++ addon that did the testing instead. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, and I don’t think it hurts to have this
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // `process.binding('buffer').setupBufferJS` be monkey-patched before this runs. | ||
| const monkeyPatchedBuffer = require('../../lib/buffer'); | ||
|
|
||
| // On unpatched buffer. allocUnsafe() should not zero fill memory. It's always |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
typo: , after buffer?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks, landed with fixed typo in 9ee58c0. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When ArrayBufferAllocator has an undefined zeroFill property, Buffer.allocUnsafe() should zero fill. Refs: 27e84ddd4e1#commitcomment-19182129 PR-URL: #11706 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
|
(Looks like this may have landed without a CI run. :-O ) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When ArrayBufferAllocator has an undefined zeroFill property, Buffer.allocUnsafe() should zero fill. Refs: nodejs@27e84ddd4e1#commitcomment-19182129 PR-URL: nodejs#11706 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
When ArrayBufferAllocator has an undefined zeroFill property, Buffer.allocUnsafe() should zero fill. Refs: nodejs@27e84ddd4e1#commitcomment-19182129 PR-URL: nodejs#11706 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Fixes parallel/test-buffer-bindingobj-no-zerofill to properly check that buffers created with `Buffer.allocUnsafe()` are not zero-filled. The test introduced in nodejs#11706 passes even if the buffer has been zero-filled and fails if none of the buffer values are zero. Signed-off-by: Karl Cheng <[email protected]> Refs: nodejs#11706
Fixes parallel/test-buffer-bindingobj-no-zerofill to properly check that buffers created with `Buffer.allocUnsafe()` are not zero-filled. The test introduced in #11706 passes even if the buffer has been zero-filled and fails if none of the buffer values are zero. Refs: #11706 PR-URL: #12290 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
|
looks like this has failures. Please manually backport (and include #12290 ) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fixes parallel/test-buffer-bindingobj-no-zerofill to properly check that buffers created with `Buffer.allocUnsafe()` are not zero-filled. The test introduced in #11706 passes even if the buffer has been zero-filled and fails if none of the buffer values are zero. Refs: #11706 PR-URL: #12290 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
Fixes parallel/test-buffer-bindingobj-no-zerofill to properly check that buffers created with `Buffer.allocUnsafe()` are not zero-filled. The test introduced in #11706 passes even if the buffer has been zero-filled and fails if none of the buffer values are zero. Refs: #11706 PR-URL: #12290 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
Fixes parallel/test-buffer-bindingobj-no-zerofill to properly check that buffers created with `Buffer.allocUnsafe()` are not zero-filled. The test introduced in #11706 passes even if the buffer has been zero-filled and fails if none of the buffer values are zero. Refs: #11706 PR-URL: #12290 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.