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

RTEMS: race between recvfrom()/accept() and close() results in stuck threads #150

Open
mdavidsaver opened this issue Jul 15, 2019 · 1 comment
Assignees

Comments

@mdavidsaver
Copy link
Member

Running testChannelAccess on RTEMS (for the first time?) leaves worker threads hung in recvfrom() and accept(). On investigation I find that this results if a socket is close()d while concurrent accept() or recvfrom() is in progress.

@mdavidsaver mdavidsaver self-assigned this Jul 15, 2019
@mdavidsaver
Copy link
Member Author

The current shutdown sequence:

shutdown(socket, SHUT_RDWR);
close(socket);
thread.exitWait()

The problem with RTEMS can be avoided with:

shutdown(socket, SHUT_RDWR);
thread.exitWait()
close(socket);

However, this presents problems on targets other than Linux and RTEMS where shutdown() doesn't interrupt either accept() or recvfrom().

cf. epics-base/epics-base#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant