-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Missing or truncated error message #6867
Comments
So you're experiencing a dropped data to console with normal exiting JS? i.e., without calling On which platform are you experiencing this issue? |
That happens because of |
src/node.cc:
That's technically not correct without flushing libuv and node write queues to |
@kzc this is a separate issue, IMO |
It's a different take on the same issue actually.
Edit: the test run above was with node 6.0.0 on Mac. Issue was reproduced with node 5.10.1 on Linux - it outputs between 2400 and 2900 rows before showing the exception on my machine. |
Using a locally patched version of node with a flushSync method on stream it produces the expected result - outputting all rows prior to the exception.
Edit: code sample was edited to work with the patched version of node as well as unmodified node releases. Note: this is a different patch than seen in PR #6773 which does not have flushSync method on stream (Writable actually). This patch is for demonstrative purposes only. |
As noted above this issue is present in node 5.x on Linux (and presumably on node 4.x) so it's not a recent regression. Not sure what's the best way to fix this mixing of different stdio mechanisms. PR #6773 will not fix it alone. It's only similar to that issue in that the event loop has ceased and stdio is unflushed. In light of this exception/stdio issue, the documentation to
Instead of calling /cc @jasnell |
Another way: invoke |
Reproduced bug with node 4.x on Linux:
Number of lines outputted is variable on repeated runs - 2281 to 2407. Sometimes the uncaught exception is printed, and sometimes it is not (as seen above). |
Could someone please add a |
On v7.0.0-pre everything seems to work here, I'm just having this on my LTS version |
Works for me on v7.7.1 on 6.10.0. Not sure which specific commit fixed that, but both 7.x and 6.x currently work fine. For 6.x, 6.3.1 is the last version where the issue is reproducable, 6.4.0 is the first version that looks fixed. |
This looks close to #6456, and I thought it was just another case of that issue, but @indutny mentioned that the errors are printed from c++, so #6456 alone shouldn't have caused this, this is why I'm opening a separate issue.
A harder to reproduce example where the error is missing (it reproduces with about 10% chance for me):
A simplier to reproduce example (the error gets truncated here most of the times, and sometimes is missing as in the previous example):
The text was updated successfully, but these errors were encountered: