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

Windows serial port hangs on write #1051

jasonatball opened this issue Sep 30, 2019 · 1 comment · Fixed by #1053

Windows serial port hangs on write #1051

jasonatball opened this issue Sep 30, 2019 · 1 comment · Fixed by #1053


Copy link

@jasonatball jasonatball commented Sep 30, 2019

Describe the bug
The win32 serial driver does not set a write timeout in the underlying Win32 API. If you have a misbehaving target and call WriteFile it can hang and never return.

To Reproduce
This was difficult to reproduce and took hours to present itself.

Expected behavior
Expected the timeout to be respected in the interface parameters.

Environment (please complete the following information):

  • OS: Windows 10
  • COSMOS Version 4.1.0
@jasonatball jasonatball added the bug label Sep 30, 2019

This comment has been minimized.

Copy link
Collaborator Author

@jasonatball jasonatball commented Sep 30, 2019

The interface in question was using a polled interface to request data. Not sure if this is relevant but the MSDN page says this;

If one thread is blocked waiting for its I/O operation to complete, all other threads that subsequently call a communications API will be blocked until the original operation completes. For instance, if one thread were waiting for a ReadFile function to return, any other thread that issued a WriteFile function would be blocked.

@jasonatball jasonatball self-assigned this Oct 2, 2019
@ryanmelt ryanmelt added this to the v4.4.1 milestone Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.