qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jon Alduan <jon.alduan@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [PATCH] linux-user: Don't assume 0 is not a valid host timer_t value
Date: Wed, 27 Jul 2022 00:13:27 +0200	[thread overview]
Message-ID: <CAL7npF_fpy2NzBqRZzEYyHQpNfEXgd7OedJDZX4pN48eUF76Pw@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA8d5J-WBp6Z=ECiUtP8wCfjv_XZo5GfYAr+x+mH3GpQww@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1907 bytes --]

Hello Peter,

I can say so far, your patch solved the issue! Great thanks for that!

Regarding the libc version:
From my WSL2 Ubuntu 21.04 x86_64:
$ ls -l /lib32/libc*
-rwxr-xr-x 1 root root 2042632 Mar 31  2021 /lib32/libc-2.33.so

My gcc version 10 does use the same libc version.
As already mentioned, I can also reproduce this on a VM with Ubuntu 20.04
and libc-2.31.
In addition, originally, this issue was first reproduced with an own
buildroot RootFS and containing libc-2.28.

As you see, the libcs are not that old. What about the virtual environment?
I could not check this hypothesis, but I hope to do so soon.

Thank you again and best regards
Jon

El lun, 25 jul 2022 a las 14:45, Peter Maydell (<peter.maydell@linaro.org>)
escribió:

> 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.
>
> Jon, which host libc are you seeing this with?
>
> thanks
> -- PMM
>


-- 
j.A

[-- Attachment #2: Type: text/html, Size: 2671 bytes --]

  reply	other threads:[~2022-07-27  1:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 11:00 [PATCH] linux-user: Don't assume 0 is not a valid host timer_t value Peter Maydell
2022-07-25 11:13 ` Daniel P. Berrangé
2022-07-25 12:45   ` Peter Maydell
2022-07-26 22:13     ` Jon Alduan [this message]
2022-07-29 11:06       ` Peter Maydell
2022-08-01 11:43   ` Peter Maydell
2022-08-09  9:51     ` Peter Maydell
2022-08-10  5:59       ` Laurent Vivier
2022-08-10 12:24         ` Peter Maydell
2022-09-27  9:18 ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL7npF_fpy2NzBqRZzEYyHQpNfEXgd7OedJDZX4pN48eUF76Pw@mail.gmail.com \
    --to=jon.alduan@gmail.com \
    --cc=berrange@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).