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

xen console: update the "to be written" count #538

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

palainp
Copy link
Contributor

@palainp palainp commented Dec 5, 2022

Previously we can get an infinite loop as written is the number of bytes written to the console returned by console_write_some (from 0 to its len argument) (l111), then it's compared against len for teminating the loop (l126).

The issue is that if len is greater than the Xen buffer size (2048B), we have to loop over the buffer and use console_write_some more than one time (and it will return something in the interval [0,len-written[ which will never equals len (l126).

The proposed patch lower the len which will stand for "how many bytes I still have to write", and stops the loop when it comes to 0 increase the written count until it reaches len. This fix #537.

@palainp palainp mentioned this pull request Dec 5, 2022
@hannesm
Copy link
Contributor

hannesm commented Dec 5, 2022

looks fine to me, a regression test could be added here in the solo5 test suite (the behaviour should be reproducible without any mirageos / ocaml involved).

Copy link
Collaborator

@avsm avsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks right to me. If anyone has some time, a 'console stress test' would be a useful regression test to have for all the backends.

hannesm added a commit to hannesm/solo5 that referenced this pull request Dec 6, 2022
hannesm added a commit to hannesm/solo5 that referenced this pull request Dec 6, 2022
hannesm added a commit to hannesm/solo5 that referenced this pull request Dec 6, 2022
@dinosaure dinosaure merged commit 498d6ca into Solo5:master Dec 7, 2022
@dinosaure
Copy link
Collaborator

Thanks, the test is done by @hannesm, I will cut a release.

dinosaure added a commit that referenced this pull request Dec 7, 2022
Test over 4k bytes of output (to reproduce #537 #538
@palainp palainp deleted the xen-fix-console branch December 8, 2022 21:55
palainp pushed a commit to palainp/solo5 that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xen console overload
5 participants