Closed palainp closed 1 year ago
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).
Thanks, the test is done by @hannesm, I will cut a release.
Previously we can get an infinite loop as
written
is the number of bytes written to the console returned byconsole_write_some
(from 0 to itslen
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 useconsole_write_some
more than one time (and it will return something in the interval[0,len-written[
which will never equalslen
(l126).The proposed patch
lower theincrease the written count until it reacheslen
which will stand for "how many bytes I still have to write", and stops the loop when it comes to 0len
. This fix https://github.com/Solo5/solo5/issues/537.