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

Update comment with node issue in streams.cpp #15631

Merged
merged 1 commit into from
Nov 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions system/lib/wasmfs/streams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ std::shared_ptr<StdinFile> StdinFile::getSingleton() {
}

__wasi_errno_t StdoutFile::write(const uint8_t* buf, size_t len, off_t offset) {
// Due to this issue with node and worker threads:
// https://github.com/emscripten-core/emscripten/issues/14804. This function
// will write to out(), which will write directly to stdout in node.
// Node and worker threads issue in Emscripten:
// https://github.com/emscripten-core/emscripten/issues/14804.
// Issue filed in Node: https://github.com/nodejs/node/issues/40961
// This is confirmed to occur when running with EXIT_RUNTIME and
// PROXY_TO_PTHREAD. This results in only a single console.log statement being
// outputted. The solution for now is to use out() and err() instead.
return writeStdBuffer(buf, len, &_emscripten_out, writeBuffer);
}

Expand All @@ -47,7 +50,7 @@ std::shared_ptr<StdoutFile> StdoutFile::getSingleton() {
}

__wasi_errno_t StderrFile::write(const uint8_t* buf, size_t len, off_t offset) {
// Similar issue with node and worker threads as emscripten_out.
// Similar issue with Node and worker threads as emscripten_out.
return writeStdBuffer(buf, len, &_emscripten_err, writeBuffer);
}

Expand Down