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

Doing anything with a null stream crashes #2801

Open
bakaq opened this issue Jan 31, 2025 · 1 comment · May be fixed by #2802
Open

Doing anything with a null stream crashes #2801

bakaq opened this issue Jan 31, 2025 · 1 comment · May be fixed by #2802

Comments

@bakaq
Copy link
Contributor

bakaq commented Jan 31, 2025

Discovered in #2799 (comment). Currently reading, writing, or even getting a machine::streams::Stream::Null crashes the process with a SIGSEGV (invalid memory access, in this case dereferencing a null pointer). This is (caused by) UB, and it's worse than just panicking.

Ideally null streams would work like piping to and from /dev/null in UNIXes: writes are ignored and reads are always EOF.

@bakaq
Copy link
Contributor Author

bakaq commented Feb 1, 2025

Related PR: #2802

@adri326 adri326 linked a pull request Feb 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant