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
{{ message }}
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
There is also another problem: these fd specific polls should be only called on fds which have non-blocking polls (only I can think of is a regular file), otherwise we can block there even if other fd would report some conditions. For some reason fd0 which is actually a "dev:tty" is handled by chroot fs code (tho it's considered a FILE_TTY)
Steps to reproduce
Just try POLLIN on fd 0.
The text was updated successfully, but these errors were encountered:
@boryspoplawski Do you want to fix it? The first bug is simple (checking return value of poll()), but the second problem seems more complex. I will assign a low priority for it now.
@pwmarcz is reworking fs stuff, so I didn't want to get in his way...
I did not submit a PR on the first bug since it wouldn't solve the original issue (polling on 0), so this can be fixed all at once.
Description of the problem
Doing
poll
orselect
(or any of their variants) on fd0
returns immediately and indicates the fd is ready for reading even if there is no data available.There is a bug here:
https://github.com/oscarlab/graphene/blob/df5882b02b8e59b7d3827842dd9f10c903492032/LibOS/shim/src/sys/shim_poll.c#L117
there is no error checking,
hdl->fs->fs_ops->poll
returns-EAGAIN
which is interpreted as a bitmap of events.There is also another problem: these fd specific polls should be only called on fds which have non-blocking polls (only I can think of is a regular file), otherwise we can block there even if other fd would report some conditions. For some reason fd
0
which is actually a "dev:tty" is handled by chroot fs code (tho it's considered aFILE_TTY
)Steps to reproduce
Just try
POLLIN
on fd0
.The text was updated successfully, but these errors were encountered: