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

Portable select() implementation needs to check filehandle "selectable" flag #453

Closed
jphickey opened this issue May 13, 2020 · 2 comments · Fixed by #461
Closed

Portable select() implementation needs to check filehandle "selectable" flag #453

jphickey opened this issue May 13, 2020 · 2 comments · Fixed by #461
Assignees
Labels
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
Not all file handles support the select() API -- in particular on RTEMS it only works on sockets. The File implementation layer contains a boolean flag selectable for every file handle to indicate whether the file descriptor can be select'ed upon.

The implementation of this layer needs to confirm/check that the selectable flag is true before calling this API.

To Reproduce
Run the new select() API unit tests on an RTEMS platform, which call this API on regular files. When it does so, this actually causes an exception and results in kernel panic/abort.

Expected behavior
OSAL should return OS_ERR_NOT_IMPLEMENTED or otherwise avoid calling select() on filehandles which the kernel does not handle properly.

System observed on:
RTEMS 4.11.3 via QEMU/pc686 BSP.

Additional context
Kernel panic result here is rather extreme -- one would have expected that the select() call would simply return error and set an errno as usual. This probably also signifies an underlying bug in RTEMS.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this May 13, 2020
@jphickey jphickey added the bug label May 13, 2020
jphickey added a commit to jphickey/osal that referenced this issue May 14, 2020
Confirm that the "selectable" flag is set before
calling the underlying select() API.

Also update unit tests to match.
jphickey added a commit to jphickey/osal that referenced this issue May 15, 2020
Confirm that the "selectable" flag is set before
calling the underlying select() API.

Also update unit tests to match.
jphickey added a commit to jphickey/osal that referenced this issue May 15, 2020
Confirm that the "selectable" flag is set before
calling the underlying select() API.

Also update unit tests to match.
@jphickey
Copy link
Contributor Author

Closing this separate pull request because this fix is actually needed to make the unit tests pass in #461. The change is now part of that combined PR.

@jphickey
Copy link
Contributor Author

Closed by mistake, meant to close the PR not the issue.

@jphickey jphickey reopened this May 15, 2020
jphickey added a commit to jphickey/osal that referenced this issue May 15, 2020
Confirm that the "selectable" flag is set before
calling the underlying select() API.

Also update unit tests to match.
@skliper skliper added this to the 5.1.0 milestone Jun 18, 2020
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants