Opened 20 months ago

Last modified 9 months ago

#18327 closed bug

select() does not report disconnect events — at Version 1

Reported by: LekKit Owned by: axeld
Priority: normal Milestone: R1/beta5
Component: Network & Internet/TCP Version: R1/beta4
Keywords: select, tcp, network Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by LekKit)

When another end of the TCP socket is closed, select() should report that in rfds set. It doesn't as of hrev56862, and doesn't wake from blocking either. This prevents any software using select() from tracking disconnect events, and freeing clients appropriately. Will attach a tiny program that reproduces this. On systems susceptible to the bug it'd hang and never exit.

Update: The poll() facility is subject to this bug as well, i.e. listening for POLLIN | POLLERR | POLLHUP never notices a HUP event.

Change History (3)

by LekKit, 20 months ago

Attachment: haiku_select_repro.c added

Reproduces the issue

comment:1 by LekKit, 20 months ago

Description: modified (diff)

by LekKit, 20 months ago

Attachment: haiku_poll_repro.c added

Reproduction, poll() variant

Note: See TracTickets for help on using tickets.