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

Errors printed using OS_printf may never appear #203

Open
jphickey opened this issue Oct 5, 2020 · 0 comments
Open

Errors printed using OS_printf may never appear #203

jphickey opened this issue Oct 5, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@jphickey
Copy link
Contributor

jphickey commented Oct 5, 2020

Describe the bug
OS_printf uses an additional output buffer with a low priority task to move the data from the buffer to the console. In the case of fatal errors which cause the process to exit as a result, the output may not get transferred before the process exits and the task is killed.

To Reproduce
See #202 of a case where (for other reasons) shmget failed but no error message was shown.

Expected behavior
Error messages should be shown

Additional context
This is particularly an issue for errors which cause an immediate process exit. So long as the process keeps running and the output task isn't immediately cancelled, there should not be an issue.

Recommendation is to use fprintf(stderr, ...) for fatal error messages, as even the stdout stream might have some line buffering in the C library, but the stderr stream should be (relatively) unbuffered.

Reporter Info
Joseph Hickey, Vantage Systems, Inc. ( based on previous report in #202 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant