Description
- Version: 14.16.0
- Platform: Ubuntu 20.04
- Subsystem: Stream?
/node_modules/electron/dist/electron[56003]: ../../third_party/electron_node/src/stream_base.cc:351:MaybeLocal<v8::Value> node::StreamBase::CallJSOnreadMethod(ssize_t, Local<v8::ArrayBuffer>, size_t, node::StreamBase::StreamBaseJSChecks): Assertion `onread->IsFunction()' failed.
/node_modules/electron/dist/electron exited with signal SIGABRT
I'm sorry for not following the issue template. This just happened locally during development of an Electron 12.0.1 app which comes with Node 14.16.0. As far as I can tell Electron does not patch stream_base.cc so I assume this was a Node thing. Maybe this has already been fixed in a more recent Node release (edit: looks like 14.16.1 was only a security release), but I couldn't find anything.
Unfortunately I haven't been able to reproduce it again. I assume I ran into a race condition. I will try to track this down, but it's hard.
Here's what I do know:
- I'm running a worker thread
- Inside the worker thread I'm starting fastify and fastify-websocket
- The SIGABRT happened exactly the moment I hit enter in the UI, which triggered both an HTTP POST and a
new WebSocket
to said local server, but I don't know if any of these cause the issue with the stream. But I also don't think this was a coincidence.
I will try to put my race-condition helmet on and get on my Fuzzer and see if I can trigger this again. But maybe someone can point in a direction if this assertion should ever be able to fail due to a user error (e.g. a bug in http
or fastify
)? I'm not even sure what the onread
is in this case but I think forgetting to set it in user land should not take down the whole process, should it?