Skip to content

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

Merged
dinosaure merged 1 commit into
Solo5:masterfrom
palainp:xen-fix-console
Dec 7, 2022
Merged

xen console: update the "to be written" count#538
dinosaure merged 1 commit into
Solo5:masterfrom
palainp:xen-fix-console

Conversation

@palainp

@palainp palainp commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

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
Comment thread bindings/xen/console.c
@hannesm

hannesm commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

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).

@avsm avsm left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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