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

EFAULT buf outside accessible address space in a write system call on Raspberry Pi 4 (running 64bit bookworm) #54921

Closed
paulober opened this issue Sep 13, 2024 · 8 comments
Labels
fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding.

Comments

@paulober
Copy link

Version

20.15.1

Platform

Linux myuser 6.6.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.47-1+rpt1 (2024-09-02) aarch64 GNU/Linux

Subsystem

I guess it's fs

What steps will reproduce the bug?

Execute the version v0.16.0 of the pico-vscode extension in vscode. The source of the bug seems to be the area around this line: https://github.com/raspberrypi/pico-vscode/blob/72a02fceb1608e3962caf46d9bb5aa7410ce5660/src/utils/download.mts#L233

(Sorry for not having a smaller reproducible example)

How often does it reproduce? Is there a required condition?

Every time running this code on Raspberry Pi 4

What is the expected behavior? Why is that the expected behavior?

Just open the stream and write the downloaded file like it works on Raspberry Pi 5, any Windows PC and macOS.

What do you see instead?

Failed to download toolchain:

EFAULT: bad address in systemcall argument, write

Additional information

The write syscall man specify:

EFAULT: buf is outside your accessible address space.

for

ssize_t write(int fd, const void buf[.count], size_t count);

@avivkeller
Copy link
Member

Can you create a reproduction without needing pico-VSCode?

@paulober
Copy link
Author

paulober commented Sep 13, 2024

Maybe in a few weeks (but it could also take longer, like a month or two) but at the moment I'm a bit time constraint. But i did want to report it, so it's at least noted somewhere and someone could potentially dig into it.

@avivkeller avivkeller added fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. labels Sep 13, 2024
@avivkeller
Copy link
Member

avivkeller commented Sep 13, 2024

@nodejs/libuv Based on a previously reported issue to yarn, yarnpkg/yarn#7152, it seems to be from an issue with the path to be written.

It looks like it could be do to the path being an external volume. @paulober is the path you are trying to write to mounted on an external volume?

@paulober
Copy link
Author

paulober commented Sep 13, 2024

@redyetidev Thanks for research. It seems like i can't get it fixed by just rewriting how we do the download so i'll have create a min rep. sample to findout if undici or the writestream is the problem.

The path we are writing to is /tmp/pico-sdk/13_2_Rel1.tar.xz which is on the internal volume (the SD card since the os is running from a micro SD).

@paulober
Copy link
Author

I now create an example but it works as expected....

@paulober
Copy link
Author

I now notified undici as i was able to resolve this issue by switching to got library with stream pipeline.

@avivkeller avivkeller closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
@avivkeller
Copy link
Member

avivkeller commented Sep 13, 2024

Closing in favor. Can you provide the minimal reproduction you created for future reference?

@paulober
Copy link
Author

I would but it works, it doesn't reproduce the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding.
Projects
None yet
Development

No branches or pull requests

2 participants