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

bug: v16.14.2 node::ResetStdio(): Assertion `!(err != 0) || (err == -1 && (*__errno_location ()) == 1)' failed. #42433

Closed
fzn0x opened this issue Mar 22, 2022 · 15 comments

Comments

@fzn0x
Copy link

fzn0x commented Mar 22, 2022

Version

v16.14.2

Platform

ubuntu 20.04

Subsystem

No response

What steps will reproduce the bug?

writing log to file from node

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

No response

What is the expected behavior?

Fixed

What do you see instead?

core bug

Additional information

Capture

@fzn0x fzn0x changed the title v16.14.2 node::ResetStdio(): Assertion `!(err != 0) || (err == -1 && (*__errno_location ()) == 1)' failed. bug: v16.14.2 node::ResetStdio(): Assertion `!(err != 0) || (err == -1 && (*__errno_location ()) == 1)' failed. Mar 22, 2022
@fzn0x
Copy link
Author

fzn0x commented Mar 22, 2022

node problem.js > /root/problem.log 2>&1 &

@mscdex
Copy link
Contributor

mscdex commented Mar 22, 2022

and what is in problem.js that will reproduce this?

@fzn0x
Copy link
Author

fzn0x commented Mar 22, 2022

and what is in problem.js that will reproduce this?

Just throw some errors you will get that error in your log and the program stopped.

@fzn0x
Copy link
Author

fzn0x commented Mar 23, 2022

Temporary solution

node problem.js > /root/problem.log &
ps aux | grep problem

@bnoordhuis
Copy link
Member

Can you post the output of strace -fe ioctl node ...? I'd like to know what the actual error is and for what file descriptor.

@DaBigBlob
Copy link

and what is in problem.js that will reproduce this?

guys I've got update

@DaBigBlob
Copy link

DaBigBlob commented Feb 9, 2023

@mscdex

today morning I got this:

/usr/bin/node[3271]: ../src/node.cc:648:void node::ResetStdio(): Assertion `!(err != 0) || (err == -1 && (*__errno_location ()) == 1)' failed.

here is the file:
https://github.com/DaBigBlob/temp-node-problem/blob/main/raw_ws.js
(possible culprit: line 164 to 169)
here is the output log:
Screenshot 2023-02-09 at 6 32 21 AM

@bnoordhuis
Copy link
Member

@DaBigBlob
Copy link

@bnoordhuis
Screenshot 2023-02-09 at 3 55 09 PM
this is at the start

i'll send the logs when the error happens again (within 6 hours)

@bnoordhuis
Copy link
Member

Thanks. ENOTTY is not out of the ordinary. You can add -o trace.log to have strace write it to file instead of the tty.

@bnoordhuis
Copy link
Member

@DaBigBlob did you have any luck capturing the error?

@ywave620
Copy link
Contributor

ywave620 commented Mar 21, 2023

same issuse here,I run node through the command ./node-v14.17.6 proxy.js > ./log.out 2>&1 &

Node.js[9305]: ../src/node.cc:742:void node::ResetStdio(): Assertion `!(err != 0) || (err == -1 && (*__errno_location ()) == 1)' failed.
 1: 0xa25510 node::Abort() [./node-v14.17.6]
 2: 0xa2558e  [./node-v14.17.6]
 3: 0x9effd4 node::ResetStdio() [./node-v14.17.6]
 4: 0x7fde67d9ea69  [/lib64/libc.so.6]
 5: 0x7fde67d9eab5  [/lib64/libc.so.6]
 6: 0x988d6c  [./node-v14.17.6]
 7: 0x9c6bd3 node::Environment::Exit(int) [./node-v14.17.6]
 8: 0xa26e7a node::errors::TriggerUncaughtException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>, bool) [./node-v14.17.6]
 9: 0xa27400 node::errors::PerIsolateMessageListener(v8::Local<v8::Message>, v8::Local<v8::Value>) [./node-v14.17.6]
10: 0xd08095 v8::internal::MessageHandler::ReportMessageNoExceptions(v8::internal::Isolate*, v8::internal::MessageLocation const*, v8::internal::Handle<v8::internal::Object>, v8::Local<v8::Value>) [./node-v14.17.6]
11: 0xd082ea v8::internal::MessageHandler::ReportMessage(v8::internal::Isolate*, v8::internal::MessageLocation const*, v8::internal::Handle<v8::internal::JSMessageObject>) [./node-v14.17.6]
12: 0xcfb20e v8::internal::Isolate::ReportPendingMessages() [./node-v14.17.6]
13: 0xce52b0  [./node-v14.17.6]
14: 0xce5c6f v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [./node-v14.17.6]
15: 0xbacb54 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [./node-v14.17.6]
16: 0x984d43 node::InternalCallbackScope::Close() [./node-v14.17.6]
17: 0x9853c7 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [./node-v14.17.6]
18: 0x9932c9 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [./node-v14.17.6]
19: 0xaf0068  [./node-v14.17.6]
20: 0xaf319f node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [./node-v14.17.6]
21: 0xafcf48 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [./node-v14.17.6]
22: 0x13ac4f0  [./node-v14.17.6]
23: 0x13acbf0  [./node-v14.17.6]
24: 0x13b36d5  [./node-v14.17.6]
25: 0x13a1278 uv_run [./node-v14.17.6]
26: 0xa659c4 node::NodeMainInstance::Run() [./node-v14.17.6]
27: 0x9f3d95 node::Start(int, char**) [./node-v14.17.6]
28: 0x7fde67d87c05 __libc_start_main [/lib64/libc.so.6]
29: 0x982c9c  [./node-v14.17.6]

proxy.js is a classic http server and it prints infomation of requests, which is a lot! At the time the process crashed, the log.out has a size of 39661357 byte

@ywave620
Copy link
Contributor

ywave620 commented Mar 24, 2023

Looks like the amount of what was being printed has nothing to do with this problem, I got it in another run, same complain but with a tiny log.out.

I guess running node as a background process and unhandled rejection are part of the required factors to trigger this bug. I'm unfamiliar with the TTY, could you PTAL @bnoordhuis

https://github.com/nodejs/node/blob/v14.x/src/node.cc#L738-L740

@bnoordhuis
Copy link
Member

I suggest trying with the latest v14.x but, cards on the table, v14.x is near its end of life and I don't plan on investing much time in that release line anymore. If it also happens with v16.x or newer, then it's a different story.

@bnoordhuis
Copy link
Member

v14.x is EOL now and since @DaBigBlob didn't follow up, I think the investigation here reached a dead end. Closing but can reopen when new information materializes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants