Hi,

When I'm checking curl test 546. I found that it went into a situation
that:

```
Thread 4 hit Breakpoint 1, __GI___select (nfds=0, readfds=0x103cc20, 
writefds=0x103cc40, exceptfds=0x103cc60, timeout=0x103cc84)
    at ../sysdeps/mach/hurd/select.c:31
```

When I continue, it hangs at mach_msg[0]:

gdb backtrace:
```
#0  0x011a206c in __GI___mach_msg_trap () at 
./build-tree/hurd-i386-libc/mach/mach_msg_trap.S:2
#1  0x011a2800 in __GI___mach_msg (msg=0x103cad4, option=1282, send_size=0, 
rcv_size=40, rcv_name=13, timeout=50000, notify=0)
    at ./mach/msg.c:111
#2  0x011cb633 in _hurd_select (nfds=<optimized out>, pollfds=<optimized out>, 
readfds=<optimized out>, writefds=<optimized out>,
    exceptfds=<optimized out>, timeout=<optimized out>, sigmask=<optimized 
out>) at ./hurd/hurdselect.c:423
```

If my comprehension is correct, nfds == 0 means that no descriptor needs
to be tested:

>From POSIX:
```
The nfds argument specifies the range of descriptors to be tested. The first 
nfds descriptors shall be checked in each set; that is, the descriptors from 
zero through nfds-1 in the descriptor sets shall be examined.
```

So probably we should directly return from hurd_select when nfds == 0?

Best,
Zhaoming

[0]:https://sourceware.org/git/?p=glibc.git;a=blob;f=hurd/hurdselect.c;h=7ece4aa371e2da050a17230e2398a730448aaaa8;hb=HEAD#l423


Reply via email to