emscripten-core / emscripten-core/emscripten

Bad file descriptor errors -- How are file descriptors stored in WASM module?

Open
#13,491 4 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I've started getting `write error: Bad file descriptor` and `standard output: Bad file descriptor` (e.g. output of busybox's echo and base64).

I'm saving/resetting memory of WASM module to speed up launch time. Before it has worked like a charm. I'm also overriding `Module.stdout` to capture the module output.

What could be the reason? Thanks!

It's as if standard output file descriptor became "closed" somehow. How is the state of stdout stored?

Here is my code: https://github.com/busytex/busyide/blob/main/busybox.js

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.