Re: select(2) regression?

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Mon, 22 Sep 2025 22:58:13 UTC
On Mon, Sep 22, 2025 at 01:13:48PM +0200, Paul Floyd wrote:
> Hi
> 
> I'm testing Valgrind to try to get it ready for 15.0-RELEASE. I've seeing
> several new issues. Here is the first one.
> 
> In one testcase this code
> 
>    for (i = 0; i < loops; i++) {
>       if (sleepms > 0 && s->sleep) {
>          t[s->t].tv_sec = sleepms / 1000;
>          t[s->t].tv_usec = (sleepms % 1000) * 1000;
>          ret = select (0, NULL, NULL, NULL, &t[s->t]);
>          /* We only expect a timeout result or EINTR from the above. */
>          if (ret != 0 && errno != EINTR)
>             perror("unexpected result from select");
>       }
>       if (burn > 0 && s->burn)
>          do_burn();
>    }
> 
> is failing with the select call returning 93. I don't see how that is
What do you mean by 'returning 93'?  Is it errno?

> possible with 0 nfds and empty fd sets. Note that the problem is in vgdb
> which is a plain C exe not running under Valgrind. I'll see if I can make a
> smaller reproducer. This is on amd64. It looks like a regression to me -
> select worked as expected as far as I can remember going back to FreeBSD 10.

Yes please show the minimal complete reproducer.