Project

General

Profile

Actions

Bug #3307

closed

select() not working as expect when a pipe is closed

Added by tmunro over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
Start date:
11/19/2021
Due date:
% Done:

0%

Estimated time:

Description

When a the write end of a pipe is in the writefds set of a call to select(), and the read end is closed, I think select() should report the descriptor as writable (because writing would produce EPIPE or SIGPIPE), but it does not. We suspect this changed, and we noticed the change in the PostgreSQL build farm after upgrading an ancient Dragonfly build machine to the current release. In our real usage, this causes Perl IPC::Run in our test harness to hang, but here's a minimal repro in C:

https://www.postgresql.org/message-id/flat/CA%2BhUKG%2BUZi3tp%3De0ffO1R7eZ%3Dx8azSJDNzO0E2zOy9PhuyOpAQ%40mail.gmail.com#f90edeec19759a8b62ce98ea5a11cb6e

(Please disregard the discussion of kqueue problems on ancient macOS, which turned out to be a separate problem, completely unrelated).

Actions

Also available in: Atom PDF