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

Assertion `(write_req_.result) >= (0)' failed #40345

Open
kyrylkov opened this issue Oct 6, 2021 · 5 comments
Open

Assertion `(write_req_.result) >= (0)' failed #40345

kyrylkov opened this issue Oct 6, 2021 · 5 comments
Labels
linux Issues and PRs related to the Linux platform.

Comments

@kyrylkov
Copy link

kyrylkov commented Oct 6, 2021

Version

v16.10.0

Platform

Linux af87af56-9877-4f08-60c5-f271 5.4.0-84-generic #94~18.04.1-Ubuntu SMP Thu Aug 26 23:17:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Running our server app with node --trace-event-categories v8,node,node.async_hooks,node.promises.rejections flags.

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

When node.promises.rejections enabled, server crashes at least once per hour with this error.

What is the expected behavior?

Printing promise rejection trace, when rejection occurs.

What do you see instead?

Node crashes

node[137]: ../src/tracing/node_trace_writer.cc:196:void node::tracing::NodeTraceWriter::AfterWrite(): Assertion `(write_req_.result) >= (0)' failed.
1: 0x5578c3cff280 node::Abort() [node]
2: 0x5578c3cff314  [node]
3: 0x5578c3e1a654  [node]
4: 0x5578c487db64  [node]
5: 0x5578c48834f6  [node]
6: 0x5578c489749d  [node]
7: 0x5578c4883e2a uv_run [node]
8: 0x7fe3b1e9f6db  [/lib/x86_64-linux-gnu/libpthread.so.0]
9: 0x7fe3b1bc871f clone [/lib/x86_64-linux-gnu/libc.so.6]
Aborted

Additional information

No response

@aduh95
Copy link
Contributor

aduh95 commented Oct 6, 2021

I'm not able to reproduce:

$ node --trace-event-categories v8,node,node.async_hooks,node.promises.rejections       
Welcome to Node.js v16.10.0.
Type ".help" for more information.
> 

The REPL opens as expected. Are you running some other code or some other options to get to the crash you described?

@kyrylkov
Copy link
Author

kyrylkov commented Oct 6, 2021

Sorry I wansn't clear enough. That's the crash we get when we running our server app that has uncaught promise rejections with node.promises.rejections. We've added --trace-event-categories flag to get more information, but Node started crashing. It didn't seem to crash before, without the flag, but we will double check.

@iam-frankqiu iam-frankqiu added the linux Issues and PRs related to the Linux platform. label Oct 6, 2021
@kyrylkov
Copy link
Author

kyrylkov commented Oct 8, 2021

Confirmed. Crash occurs only with --trace-event-categories node.promises.rejections

@aduh95
Copy link
Contributor

aduh95 commented Oct 8, 2021

Any chance you would be able to share a code snippet that reproduces the issue? It's almost impossible to reliably fix the issue without a repro case.

@kyrylkov
Copy link
Author

kyrylkov commented Oct 8, 2021

The issue is that we don't know ourselves what code is responsible. When we add unhandledRejection listener, we get these:

Unhandled rejection at: {}
Reason: Error: Client network socket disconnected before secure TLS connection was established

As you see reason comes as an empty object. We hoped to get more details with tracing, but it just crashes.

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

No branches or pull requests

3 participants