emscripten-core / emscripten-core/emscripten

MEMFS corrupts binary files when lazy loading in node.js

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

Description

The warning at https://github.com/emscripten-core/emscripten/blob/c38e6c8cfba28980aea8f895c71b376e8a5155d5/src/library_fs.js#L1662 is correct: when running under node.js on the command-line, all lazily loaded files will be parsed as UTF-8, leading to mysterious 0xefbfbd sequences everywhere in binary files (i.e. everywhere there is an invalid UTF-8 byte).

Unfortunately I don't know nearly enough about the runtime library to propose a solution :(

My emsdk version:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.8 (3ff7eff373d31d8c0179895165462019221f192e)
clang version 15.0.0 (https://github.com/llvm/llvm-project 80ec0ebfdc5692a58e0832125f2c6a991df9d63f)

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.