[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
select()
From: |
Marcus Brinkmann |
Subject: |
select() |
Date: |
Thu, 30 Aug 2001 19:32:17 +0200 |
User-agent: |
Mutt/1.3.18i |
Hi,
I tried to debug the apt-get/select() situation, but I have to admit
I am totally and completely confused. What happens doesn't make any sense
to me.
I set a break point at hurdselect.c:320, where an EINTR response from pfinet
is handled. At this point:
Breakpoint 1, _hurd_select (nfds=5, pollfds=0x0, readfds=0x1025a9c,
writefds=0x1025a7c, exceptfds=0x0, timeout=0x1025a24, sigmask=0x0)
at hurdselect.c:320
320 err = EINTR;
(gdb) print msgerr
$5 = EINTR
(gdb) print msg
$6 = {head = {msgh_bits = 4352, msgh_size = 32, msgh_remote_port = 0,
msgh_local_port = 51, msgh_seqno = 0, msgh_id = 21112}, error = {head = {
msgh_bits = 4352, msgh_size = 32, msgh_remote_port = 0,
msgh_local_port = 51, msgh_seqno = 0, msgh_id = 21112}, err_type = {
msgt_name = 2, msgt_size = 32, msgt_number = 1, msgt_inline = 1,
msgt_longform = 0, msgt_deallocate = 0, msgt_unused = 0}, err = EINTR},
success = {head = {msgh_bits = 4352, msgh_size = 32, msgh_remote_port = 0,
msgh_local_port = 51, msgh_seqno = 0, msgh_id = 21112}, err_type = {
msgt_name = 2, msgt_size = 32, msgt_number = 1, msgt_inline = 1,
msgt_longform = 0, msgt_deallocate = 0, msgt_unused = 0}, err = EINTR,
result_type = {msgt_name = 197, msgt_size = 196, msgt_number = 2861,
msgt_inline = 0,, msgt_longform = 0, msgt_deallocate = 0,
msgt_unused = 1}, result = -983697778}}
(gdb)
This is not possible!!! msgerr can not be EINTR at this point, otherwise
the while() loop should have been terminated!
(gdb) print *timeout
$7 = {tv_sec = 120, tv_nsec = 0}
(gdb) print options
$8 = 256
The rest is only consequent breakage:
(gdb) n
321 goto poll;
(gdb)
358 to = 0;
(gdb)
359 options |= MACH_RCV_TIMEOUT;
(gdb)
361 }
(gdb)
363 if (err == MACH_RCV_TIMED_OUT)
(gdb)
>From there, it returns EINTR to the caller.
Another question is why pfinet returns EINTR. It seems to happen if I have two
connections, eg, I am downloading with apt-get, and then start lynx with a
page. This quickly and reproducably leads to an EINTR from pfinet. Is
this correct behaviour? What does interrupting mean for pfinet?
Oh, and a timeout of 0 doesn't work anyway, as we found out earlier. Should
this code be changed to use the minimal timeout?
Thanks,
Marcus
- select(),
Marcus Brinkmann <=