qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] linux-user: Don't assume 0 is not a valid host timer_t value


From: Laurent Vivier
Subject: Re: [PATCH] linux-user: Don't assume 0 is not a valid host timer_t value
Date: Wed, 10 Aug 2022 07:59:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

Le 09/08/2022 à 11:51, Peter Maydell a écrit :
Laurent, ping ?

Sorry, I didn't see your message. I'm going to apply it if it's ok to go into 
rc3?

Thanks,
Laurent


thanks
-- PMM

On Mon, 1 Aug 2022 at 12:43, Peter Maydell <peter.maydell@linaro.org> wrote:

On Mon, 25 Jul 2022 at 12:13, Daniel P. Berrangé <berrange@redhat.com> wrote:

On Mon, Jul 25, 2022 at 12:00:35PM +0100, Peter Maydell wrote:
For handling guest POSIX timers, we currently use an array
g_posix_timers[], whose entries are a host timer_t value, or 0 for
"this slot is unused".  When the guest calls the timer_create syscall
we look through the array for a slot containing 0, and use that for
the new timer.

This scheme assumes that host timer_t values can never be zero.  This
is unfortunately not a valid assumption -- for some host libc
versions, timer_t values are simply indexes starting at 0.  When
using this kind of host libc, the effect is that the first and second
timers end up sharing a slot, and so when the guest tries to operate
on the first timer it changes the second timer instead.

For sake of historical record, could you mention here which specific
libc impl / version highlights the problem.

How about:

"This can happen if you are using glibc's backwards-compatible
'timer_t is an integer' compat code for some reason. This happens
when a glibc newer than 2.3.3 is used for a program that was
linked to work with glibc 2.2 to 2.3.3."

Laurent, I'm going to assume you don't need a v2 sending just
for a commit message tweak, unless you'd like me to do that.

thanks
-- PMM





reply via email to

[Prev in Thread] Current Thread [Next in Thread]