-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
“TypeError: Cannot read properties of null (reading 'length')” with pipe + dup&dup2 #22030
Comments
Hi @sbc100, could you please take a look at this? It's quite weird. Thanks! |
It would not surprise me if combining BTW you can see the existing tests we have for pipe in |
Resolves emscripten-core#22030
Resolves emscripten-core#22030
Resolves emscripten-core#22030
Please include the following in your bug report:
Version of emscripten/emsdk:
3.1.54
Failing command line in full:
Hi, I was using
pipe
withdup
,dup2
for read/write redirection. And I found when doing something like the following programs, it will raise an exceptionTypeError: Cannot read properties of null (reading 'length')
.In brief, here I'm trying to redirect the
stderr
to the write end of the pipe, then things originally written to file descriptor 2(stderr
) could be read from the pipe. And it usesoriginal_fd
to restore the status ofstderr
.(Additionally, here I even tried to replace the
stderr
with some other regular file, liketemp.txt
, but the program still throws.)It seems to be an issue of pipe working with dup&dup2. It'd be great if you can check this. Thank you!
Code
Results
Here is the execution result. The wasm execution raised an exception of
Cannot read properties of null (reading 'length')
. And for the native execution, it runs successfully.Another pattern
I also found another similar pattern which seems to be the same issue, as shown here:
Compilation command are the same. And the results are also similar to the first code snippet
The text was updated successfully, but these errors were encountered: