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

Error reporting being sent to stdout rather than stderr #31905

Closed
CalebCarroll opened this issue Feb 21, 2020 · 3 comments
Closed

Error reporting being sent to stdout rather than stderr #31905

CalebCarroll opened this issue Feb 21, 2020 · 3 comments
Labels
v8 engine Issues and PRs related to the V8 dependency.

Comments

@CalebCarroll
Copy link

What steps will reproduce the bug?

node test.js >x 2>y

How often does it reproduce? Is there a required condition?

100%

What is the expected behavior?

redirected stdout to file "x" should not contain any error details while redirected stderr to file "y" should contain all error details.

What do you see instead?

Some error details are reported in file "x". Some error details are reported in file "y".

File "x" contains:
<--- Last few GCs --->

[26910:0x4cb3860] 66302 ms: Mark-sweep 241.0 (248.5) -> 241.0 (245.0) MB, 19.3 / 0.0 ms (average mu = 0.854, current mu = 0.007) last resort GC in old space requested
[26910:0x4cb3860] 66322 ms: Mark-sweep 241.0 (245.0) -> 241.0 (245.0) MB, 20.2 / 0.0 ms (average mu = 0.748, current mu = 0.005) last resort GC in old space requested

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0xea94e0]

Security context: 0x49935771
.
.

File "y" contains:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20200221.181406.26910.0.001.json
Node.js report completed

@bnoordhuis bnoordhuis added the v8 engine Issues and PRs related to the V8 dependency. label Feb 21, 2020
@bnoordhuis
Copy link
Member

That's not under node's control, those messages are printed by the V8 engine.

@joyeecheung
Copy link
Member

It seems reasonable to just print these to stderr unconditionally. Fix in https://chromium-review.googlesource.com/c/v8/v8/+/2069397

pull bot pushed a commit to p-g-krish/v8 that referenced this issue Feb 24, 2020
Fixes: nodejs/node#31905
Change-Id: Ie802e2592364640cc55555894e586ef33a2c8b6e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2069397
Commit-Queue: Toon Verwaest <[email protected]>
Reviewed-by: Toon Verwaest <[email protected]>
Cr-Commit-Position: refs/heads/master@{#66398}
@CalebCarroll
Copy link
Author

Looks like a good solution. Thanks joyeecheung!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

3 participants