This queue is for tickets about the Danga-Socket CPAN distribution.

Report information
The Basics
Id:
129724
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
e [...] 80x24.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
1.62

Attachments
0001-set-close-on-exec-flag-on-epoll-descriptors.patch 0002-fixup-use-POSIX-close-on-KQueue-FD-if-IO-Handle-is-u.patch



MIME-Version: 1.0
X-Spam-Status: No, score=-2.233 tagged_above=-99.9 required=10 tests=[AWL=-1.127, BAYES_00=-1.9, RDNS_NONE=0.793, SPF_FAIL=0.001] autolearn=no
Content-Disposition: inline
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
Content-Type: multipart/mixed; boundary="2xs7siqtbreirvbk"
Message-ID: <20190601035624.py5qouupdj6l7xv6@dcvr>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.233
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D31542401B1 for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Fri, 31 May 2019 23:56:38 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Z2bT6tYXal6 for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Fri, 31 May 2019 23:56:37 -0400 (EDT)
Received: from xx1.develooper.com (unknown [147.75.38.233]) by hipster.bestpractical.com (Postfix) with ESMTPS id C3368240123 for <bug-Danga-Socket@rt.cpan.org>; Fri, 31 May 2019 23:56:37 -0400 (EDT)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id 793C97C100 for <bug-Danga-Socket@rt.cpan.org>; Fri, 31 May 2019 20:56:37 -0700 (PDT)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id AC1837CF51 for <bug-Danga-Socket@rt.cpan.org>; Fri, 31 May 2019 20:56:35 -0700 (PDT)
Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id B161F7C100 for <bug-Danga-Socket@rt.cpan.org>; Fri, 31 May 2019 20:56:26 -0700 (PDT)
Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C819B1F462; Sat, 1 Jun 2019 03:56:24 +0000 (UTC)
Delivered-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
Subject: [PATCH] set close-on-exec flag on epoll descriptors
Return-Path: <e@80x24.org>
X-RT-Mail-Extension: danga-socket
X-Original-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' FRAUD_ATTACH 0.05, HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODYTEXTP_SIZE_400_LESS 0, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_MALFORMED 0, INVALID_MSGID_NO_FQDN 0, NO_CTA_URI_FOUND 0, NO_URI_FOUND 0, NO_URI_HTTPS 0, SPF_PASS 0, __CD 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_ATTACHMENT 0, __HAS_ATTACHMENT1 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_TEXT_P2 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_SUBJ_PREDICATE 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __zen.spamhaus.org_ERROR '
Date: Sat, 1 Jun 2019 03:56:24 +0000
X-Spam-Level:
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2019.6.1.34217
To: bug-Danga-Socket@rt.cpan.org
From: Eric Wong <e@80x24.org>
X-RT-Interface: Email
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Disposition: inline
X-RT-Original-Encoding: utf-8
Content-Length: 146
We should not be leaking these FDs to spawned processes, in case those processes have a bug which cause it to access the wrong FD. See attached.
Content-Type: text/x-diff; charset="utf-8"
Content-Disposition: attachment; filename="0001-set-close-on-exec-flag-on-epoll-descriptors.patch"
X-RT-Original-Encoding: utf-8
Content-Length: 2657

Message body is not shown because sender requested not to inline it.

MIME-Version: 1.0
X-Spam-Status: No, score=-4.171 tagged_above=-99.9 required=10 tests=[AWL=0.935, BAYES_00=-1.9, FROM_OUR_RT=-4, RDNS_NONE=0.793, SPF_FAIL=0.001] autolearn=ham
In-Reply-To: <rt-4.0.18-12385-1559361399-840.129724-3-0@rt.cpan.org>
Content-Disposition: inline
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-129724@rt.cpan.org> <20190601035624.py5qouupdj6l7xv6@dcvr> <rt-4.0.18-12385-1559361399-840.129724-3-0@rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20190601190926.nrxn4gnufxp2z5fg@dcvr>
Content-Type: multipart/mixed; boundary="m6mazjyhy22a5ruc"
X-Spam-Score: -4.171
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 12E2F2401DA for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Sat, 1 Jun 2019 15:09:46 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yacbbzip9vnY for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Sat, 1 Jun 2019 15:09:44 -0400 (EDT)
Received: from xx1.develooper.com (unknown [147.75.38.233]) by hipster.bestpractical.com (Postfix) with ESMTPS id 84C842400D6 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 15:09:44 -0400 (EDT)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id 439BF7C1B3 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 12:09:44 -0700 (PDT)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 064F97C1C3 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 12:09:43 -0700 (PDT)
Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id C85527C1B2 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 12:09:28 -0700 (PDT)
Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 162E91F462; Sat, 1 Jun 2019 19:09:27 +0000 (UTC)
Delivered-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
Subject: [rt.cpan.org #129724] fixup: use POSIX::close on KQueue FD if IO::Handle is undef
Return-Path: <e@80x24.org>
X-Original-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
X-RT-Mail-Extension: danga-socket
Date: Sat, 1 Jun 2019 19:09:26 +0000
X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODYTEXTP_SIZE_400_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_MALFORMED 0, INVALID_MSGID_NO_FQDN 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_URI_HTTPS 0, REFERENCES 0, SPF_PASS 0, __ANY_URI 0, __CD 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_ATTACHMENT 0, __HAS_ATTACHMENT1 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_REFERENCES 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_TEXT_P2 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_SUBJ_PREDICATE 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS , __zen.spamhaus.org_ERROR '
X-Spam-Level:
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2019.6.1.185716
To: bug-Danga-Socket@rt.cpan.org
From: Eric Wong <e@80x24.org>
RT-Message-ID: <rt-4.0.18-19257-1559416186-1544.129724-0-0@rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Disposition: inline
X-RT-Original-Encoding: utf-8
Content-Length: 330
Attached a patch which can be squashed on top because kqueue is special: fixup: use POSIX::close on KQueue FD if IO::Handle is undef Note: this does not fix the case where Reset() is called across fork; we'd need to remember the creator PID of the kqueue descriptor and skip closing it if real kqueue is in use.
Content-Type: text/x-diff; charset="utf-8"
Content-Disposition: attachment; filename="0002-fixup-use-POSIX-close-on-KQueue-FD-if-IO-Handle-is-u.patch"
X-RT-Original-Encoding: utf-8
Content-Length: 947

Message body is not shown because sender requested not to inline it.

MIME-Version: 1.0
X-Spam-Status: No, score=-4.22 tagged_above=-99.9 required=10 tests=[AWL=0.886, BAYES_00=-1.9, FROM_OUR_RT=-4, RDNS_NONE=0.793, SPF_FAIL=0.001] autolearn=ham
In-Reply-To: <20190601190926.nrxn4gnufxp2z5fg@dcvr>
Content-Disposition: inline
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-129724@rt.cpan.org> <20190601035624.py5qouupdj6l7xv6@dcvr> <rt-4.0.18-12385-1559361399-840.129724-3-0@rt.cpan.org> <20190601190926.nrxn4gnufxp2z5fg@dcvr>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20190601205143.uxibjus23m3u2ndm@dcvr>
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -4.22
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 3294E2401DA for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Sat, 1 Jun 2019 16:51:54 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZWF8kh+tJmc3 for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Sat, 1 Jun 2019 16:51:52 -0400 (EDT)
Received: from xx1.develooper.com (unknown [147.75.38.233]) by hipster.bestpractical.com (Postfix) with ESMTPS id 526F82400D6 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 16:51:52 -0400 (EDT)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id DED0A7C1C3 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 13:51:51 -0700 (PDT)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 985AC7C1AE for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 13:51:50 -0700 (PDT)
Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id 821387C1A5 for <bug-Danga-Socket@rt.cpan.org>; Sat, 1 Jun 2019 13:51:45 -0700 (PDT)
Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7FFE81F462; Sat, 1 Jun 2019 20:51:43 +0000 (UTC)
Delivered-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #129724] fixup: use POSIX::close on KQueue FD if IO::Handle is undef
Return-Path: <e@80x24.org>
X-Original-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
X-RT-Mail-Extension: danga-socket
Date: Sat, 1 Jun 2019 20:51:43 +0000
X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1500_1599 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_MALFORMED 0, INVALID_MSGID_NO_FQDN 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_URI_HTTPS 0, REFERENCES 0, SPF_PASS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CT 0, __CT_TEXT_PLAIN 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_REFERENCES 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_SUBJ_PREDICATE 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __SUBJ_REPLY 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS , __zen.spamhaus.org_ERROR '
X-Spam-Level:
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2019.6.1.204216
To: bug-Danga-Socket@rt.cpan.org
From: Eric Wong <e@80x24.org>
RT-Message-ID: <rt-4.0.18-30464-1559422314-1090.129724-0-0@rt.cpan.org>
Content-Length: 1464
*sigh* our POSIX::close on $KQueue has always been totally broken for other reasons, too. For one, $KQueue is a scalar ref to an integer FD, so we would need use POSIX::close($$KQueue). POSIX::close($KQueue) (single '$') is closing the wrong thing, leading to EBADF in the best case. I'm inclined to only support IO::KQueue on systems with native kqueue, and not emulation layers like libkqueue; because fully emulating kqueue is tough w/o kernel support for close-on-fork. Background: Native kqueue implies both close-on-exec AND close-on-fork behavior. No other filetype I know of has close-on-fork behavior; but it sorta makes sense given kqueue is keyed exclusively by file descriptor, not the combination of [file descriptor AND file description] like epoll is. So yeah, it can be tough to future proof this in case Linux ever starts supporting close-on-fork and libkqueue uses it... Conclusion: ignore kqueue emulation layers like libkqueue and assume kqueue is always both close-on-exec and close-on-fork; like it is on FreeBSD. It's not like Danga::Socket is urgently awaiting another release given the lack of active maintainer or even ability to transfer maintainership. So I'll take a look at this another day... Anyone: Feel free to plain-text email me or Cc: me on a public list about epoll/kqueue/poll stuff any time in the future. Just don't expect me to use proprietary messaging systems or deal with JavaScript crap on the web.
MIME-Version: 1.0
In-Reply-To: <20190601035624.py5qouupdj6l7xv6@dcvr>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <20190601035624.py5qouupdj6l7xv6@dcvr>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-2567-1571955979-239.129724-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 452
The bug is fixed in https://cpan.metacpan.org/authors/id/N/NM/NML/Danga-Socket-1.62_03-TRIAL.tar.gz Please test and/or review the code. It's a preview version and I'll release normal 1.62 in a week or so if no new easy to fix problems are discovered. - CPAN Testers: http://matrix.cpantesters.org/?dist=Danga-Socket+1.62_03-TRIAL (all green at the time of the posting) - GitHub: https://github.com/nponeccop/libdanga-socket-perl/tree/windows-blocking


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.