Hi Daniel, On Wed, Oct 19, 2022 at 4:32 PM Daniel P. Berrangé <[email protected]> wrote: > > On Wed, Aug 24, 2022 at 04:52:30PM +0800, Bin Meng wrote: > > From: Bin Meng <[email protected]> > > > > Fix the logic in qemu_add_wait_object() to avoid adding the same > > HANDLE twice, as the behavior is undefined when passing an array > > that contains same HANDLEs to WaitForMultipleObjects() API. > > Have you encountered this problem in the real world, or is this > just a flaw you spotted through code inspection ?
No. This was noticed as part of debugging [1] and code inspection was done for all possible suspicious places. [1] https://lore.kernel.org/qemu-devel/[email protected]/ > > Essentially I'm wondering if there's any known caller that is > making this mistake of adding it twice ? No known caller at this call chain. But there is another in the QIO socket channel APIs that may add the same handle twice, fortunately that scenario is handled properly in the GLib internally. > > > > > Signed-off-by: Bin Meng <[email protected]> > > --- > > > > Changes in v3: > > - new patch: avoid adding the same HANDLE twice > > > > include/qemu/main-loop.h | 2 ++ > > util/main-loop.c | 10 ++++++++++ > > 2 files changed, 12 insertions(+) > > Regards, Bin
