[DragonFlyBSD - Bug #3268] (Resolved) parent process does not receive POLLHUP events
bugtracker-admin at leaf.dragonflybsd.org
bugtracker-admin at leaf.dragonflybsd.org
Wed May 12 15:06:00 PDT 2021
Issue #3268 has been updated by dillon.
Status changed from In Progress to Resolved
Ok, excellent. I have pushed the patch to 6.0-release and master. Going to close the bug. Thanks!
-Matt
----------------------------------------
Bug #3268: parent process does not receive POLLHUP events
http://bugs.dragonflybsd.org/issues/3268#change-14079
* Author: mikdusan
* Status: Resolved
* Priority: High
* Assignee: dillon
* Category: Userland
* Target version: 6.2
----------------------------------------
The attached `main.c` code is a reduction which takes as args, a command (absolute path) to fork/exec and poll stdout/stderr. POLLHUP events should be issued for both pipes when the child is finished.
For the Zig project we have this implemented in the zig language but I've provided a similar .c implementation since it was already done during my triage. For both .zig and .c code, linux, macos, freebsd, netbsd, openbsd work as expected and dragonfly manifests this unexpected behaviour of not receiving POLLHUP.
In the provided reduction, the bug manifests as an infinite loop after reading the bytes from child stdout/stderr. The parent keeps getting POLLIN events, and the read keeps returning 0 nbytes read which indicate the pipe has been closed. In the interim I will likely workaround this bug with conditional code for dragonfly to key off nbytes=0.
I have reproduced the bug on dragonfly 5.8, 6.0 and 5.0.0 (the oldest .iso I could find).
---Files--------------------------------
main.c (3.2 KB)
pollhup01.patch (357 Bytes)
pollhup02.patch (1.86 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs
mailing list