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

The max length of console.log output is 8275 #9546

Closed
arthuroy opened this issue Nov 10, 2016 · 12 comments
Closed

The max length of console.log output is 8275 #9546

arthuroy opened this issue Nov 10, 2016 · 12 comments
Labels
confirmed-bug Issues with confirmed bugs. libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform.

Comments

@arthuroy
Copy link

arthuroy commented Nov 10, 2016

  • Version: 7.1.0
  • Platform: Windows 10 1607 (Redstone) 14393.447 x64
  • Subsystem: console

Using the following codes, the second console.log will be failed without any error message and the program exits; but it worked on 7.0.0.

"use strict";

// length = 8275, Array(8276) is max.
var testString = Array(8277).join('a');
console.log('length = ' + testString.length);
console.log(testString);

Reduce the array size to 8276, the program works as expected.

@vsemozhetbyt
Copy link
Contributor

Can't reproduce on Windows 7 x64 with cmd or Powershell.

@mscdex mscdex added windows Issues and PRs related to the Windows platform. v7.x labels Nov 11, 2016
@arthuroy
Copy link
Author

arthuroy commented Nov 11, 2016

var testString = Array(8276).join('a');
console.log('length = ' + testString.length);
console.log(testString);
console.log('finished');

Use the codes above, the second console.log works but the third fails without any error message and the program exits.

Change to Array(8192).join('a'), the third works.

@vsemozhetbyt
Copy link
Contributor

Can't reproduce as well.

@arthuroy
Copy link
Author

Start Node.js command prompt, and execute the following command:

D:\>node -p "process.stdout.write(util.format.apply(null, [Array(8278).join('a')]))"

Nothing output, but if you change the array size to Array(8277), it works.

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Nov 11, 2016

For me, it does print all the string even with 8278.

@sp90
Copy link

sp90 commented Nov 11, 2016

Irrelevant:
Just a shot in the Dark Can it be 32bit limit if your running on a 32bit system

@bricss
Copy link

bricss commented Nov 11, 2016

Can confirm the same blank output on my machine.

Windows 10 RS1 x64 + Node.js 7.1.0

@ChALkeR
Copy link
Member

ChALkeR commented Nov 11, 2016

Does anything change if you wait for some time before exiting? E.g. do a setTimeout(()=>{},5000) afterwards. Could be related to #6456.

@Fishrock123 Fishrock123 added the confirmed-bug Issues with confirmed bugs. label Nov 11, 2016
@Fishrock123
Copy link
Member

Fishrock123 commented Nov 11, 2016

Repro'd.

As the OP said this appears in 7.1.0. It is probably tangentially related to #6456 but something else must have changed here.

I bet it was the libuv 1.10.0 upgrade...

Unfortunately I am unable to bisect on Windows so... @saghul, @cjihrig, @bnoordhuis

Edit: Adding a timeout does not help, probably not related to #6456.

@killroy42
Copy link

Does it work with the patch from issue#9542?

@NijiharaTsubasa
Copy link

I'm having the same problem on both Windows 10 build 14965 and Windows Server 2016. My app suddenly exited without displaying any error message, at where a very long string should be console.log'd, after upgraded node to 7.1.0.

@Fishrock123 @killroy42 I took some time to do the bisect and tested out the patch, libuv 1.10.0 upgrade IS the cause of the problem and the patch FIXES it.

@Fishrock123 Fishrock123 added duplicate Issues and PRs that are duplicates of other issues or PRs. libuv Issues and PRs related to the libuv dependency or the uv binding. and removed duplicate Issues and PRs that are duplicates of other issues or PRs. labels Nov 13, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Nov 15, 2016

Closing. #9542 closed via libuv/libuv@d0c2641. Please reopen if that is not correct.

@cjihrig cjihrig closed this as completed Nov 15, 2016
cjihrig added a commit to cjihrig/node that referenced this issue Nov 17, 2016
Fixes: nodejs#9542
Fixes: nodejs#9546
PR-URL: nodejs#9647
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Fishrock123 pushed a commit that referenced this issue Nov 22, 2016
Fixes: #9542
Fixes: #9546
PR-URL: #9647
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
MylesBorins pushed a commit that referenced this issue May 16, 2017
Fixes: #9542
Fixes: #9546
PR-URL: #9647
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
MylesBorins pushed a commit that referenced this issue May 18, 2017
Fixes: #9542
Fixes: #9546
PR-URL: #9647
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
andrew749 pushed a commit to michielbaird/node that referenced this issue Jul 19, 2017
Fixes: nodejs/node#9542
Fixes: nodejs/node#9546
PR-URL: nodejs/node#9647
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

10 participants