On Mon, 11 May 2026 at 16:20, Peter Xu <[email protected]> wrote: > > Commit dd4fe8844b changed the reporting of expected downtime behavior, so > that the value will be calculated on-demand. One side effect on the change > is QEMU will allow the calculation to happen anytime even if there's no > transfer happening for a short while. > > PeterM reported an ubsan report from clang when running migration-test with > aarch64 binary on x86_64 hosts. I can also reproduce if I run the test > concurrently so some of the src QEMU may not get chance to push any data, > causing mbps to be 0: > > ../migration/migration.c:1051:12: runtime error: -nan is outside the range of > representable values of type 'long' > > Fix it by properly handle both Inf and Nan. One note is we can't use > ">"/">=" check here otherwise we cannot cover Nan.
I don't really understand how we can get a NaN here -- where is it coming from? The only case I can think of is if s->mbps is a NaN -- but in that case that probably is causing other problems elsewhere too, and it would likely be better to do something where the NaN is first entering the calculations. thanks -- PMM
