Node: Process crashes when trying to log a large object

Created on 22 Nov 2016  路  9Comments  路  Source: nodejs/node

  • Version: 7.1.0
  • Platform: 64-bit Windows 10

The process consistently crashes (I assume, it simply doesn't log anything at all after running) when trying to run this:

const obj = {};
Array(607).fill('x').forEach((_, i) => obj[i] = i);
console.log(obj);

Changing the array's length to 606 or lower shows the correct output, anything higher produces the crash. Anything after the log doesn't run. Omitting just the console.log call makes the program run correctly.

confirmed-bug console duplicate libuv windows

All 9 comments

I can reproduce this.

Note that the console.log with an object is the problem. Works fine with an array.

It works for me on Linux.

This reproduces the issue without .log

const obj = {};
Array(607).fill('x').forEach((_, i) => obj[i] = i);
process.stdout.write(require("util").inspect(obj));

@addaleax where's the libuv dupe?

Is not this the same bug with Node.js 7.1.0 on Windows 10 that fixed in https://github.com/nodejs/node/commit/1fca11e114409b114dc1a0d675841fe59636a4f2? Could it be that the length of output string matters?

Let me check if this reproduces on master.

i got crash when print large string

@metropolian Could you try the 7.2.0 version? It should be fixed there.

@vsemozhetbyt oh thanks, its fixed. :)

Closing as this appears to have been fixed. If that is not the case, please let us know. Thanks!

Was this page helpful?
0 / 5 - 0 ratings