WasmFS NodeRawFS is not consistent with NodeRawFS (non-WasmFS version)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- cpp, node.js, wasm
- Domain
- operating-systems
Research direction
The relevant backend is system/lib/wasmfs/backends/noderawfs_root.cpp, specifically the root initialization referenced in the report. Reproduce test.cc with emcc and Node using both -sNODERAWFS and -sWASMFS; done means /proc/self/exe returns the same Node executable path in both cases.
Written by the indexing model from the issue text.
Description
Please include the following in your bug report:
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.11 (d3432e7a2a6585331c94b041973fb16c9f332ce4)
clang version 21.0.0git (https:/github.com/llvm/llvm-project 0f0079c29da4b4d5bbd43dced1db9ad6c6d11008)
Target: wasm32-unknown-emscripten
Thread model: posix
Consider this example:
/* test.cc */
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
int main(int argc, char** argv) {
char buf[PATH_MAX + 1];
ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf));
if (len > PATH_MAX) {
return 2;
}
printf("self exe: %s", buf);
fflush(stdout);
return 0;
}
% emcc -sEXIT_RUNTIME -sNODERAWFS test.cc && node a.out.js
self exe: /home/trybka/.nvm/versions/node/v22.13.1/bin/node
vs.
% emcc -sEXIT_RUNTIME -sNODERAWFS -sWASMFS test.cc && node a.out.js
self exe:
This is because the "root" of the VFS for NodeRawFS should be /, but when using WasmFS it is . (I assume, via https://github.com/emscripten-core/emscripten/blob/e5c41dbbc93b3a4ab3e0c30935223865facfdbcb/system/lib/wasmfs/backends/noderawfs_root.cpp#L11)
If I change the . to / then it works the same in both cases.
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 109
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emscripten-core/emscripten
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
emscripten-core/emscripten#27211 · 1 comment ·
-
emscripten_fetch_unpack_response_headers returns header values with leading and trailing whitespace Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
emscripten-core/emscripten#27114 · 4 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
emscripten-core/emscripten#27021 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
emscripten-core/emscripten#26628 · 11 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
emscripten-core/emscripten#26076 · 1 comment ·
All issues in emscripten-core/emscripten
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·