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

reproducable out-of-memory errors using 'array' #79

Open
ollixx opened this issue Aug 20, 2022 · 0 comments
Open

reproducable out-of-memory errors using 'array' #79

ollixx opened this issue Aug 20, 2022 · 0 comments

Comments

@ollixx
Copy link

ollixx commented Aug 20, 2022

hi there,

the following code snippets result in a hard crash and should probably be hardened to throw an error instead:

let jBinary = require("jbinary");
let buf = [0x00, 0x03, 0x04, 0x05, 0x06, 0x07];
let b = new jBinary(buf);
// works:
console.log(b.read(['array', 2]));
// crash:
console.log(b.read(['array', undefined]));
let jBinary = require("jbinary");
let buf = [0x00, 0x03, 0x04, 0x05, 0x06, 0x07];
let b = new jBinary(buf);
// crash:
console.log(b.read('array', <any number here>));

on my system (node-red 2.2.3, node.js v14.18.2, in docker container), I see this error:

<--- Last few GCs --->

[17:0x564b6caeeaa0]  1558415 ms: Mark-sweep 1077.3 (1097.0) -> 837.9 (857.2) MB, 385.8 / 0.0 ms  (+ 1.8 ms in 2 steps since start of marking, biggest step 1.2 ms, walltime since start of marking 910 ms) (average mu = 0.999, current mu = 0.629) allocation [17:0x564b6caeeaa0]  1559490 ms: Mark-sweep 1411.7 (1431.0) -> 603.7 (621.5) MB, 747.3 / 0.0 ms  (average mu = 0.995, current mu = 0.305) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant