You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason why the error is not propagated is because of this function here. When sending data to the fd port, any error when trying to write is delivered by exit signal to the calling process. So a potentially correct fix could be to make put_port like this:
I had a look at trying to implement this and I don't think it is possible while still using the fd driver (that is a port started using {fd,0,1}) for stdin/stdout. This is because any error reporting is asynchronous and we do not know that the exit signal is in the mailbox of the calling process when the port_command returns. So the after in the code above would need to have some timeout value. It is impossible to know which value is short enough to work, and we do not want to have too long a value as any write would be delayed by that value.
So in conclusion, this bug cannot be fixed without taking a serious look at how the internals of the stdin/stdout handling works. It so happens that this is something that we are doing, so I'm leaving this issue to be fixed as part of that work.
garazdawi
changed the title
writing to a full device works
Writing to a stdout pointing to /dev/full does not fail
Apr 6, 2022
Describe the bug
OTP allows writing to full device, but it shouldn't.
To Reproduce
Reproduce it on Linux:
Expected behavior
OTP can handle this condition as expected.
Affected versions
OTP 24, but other versions should be affected, too.
Additional context
The text was updated successfully, but these errors were encountered: