Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83291 invoked from network); 30 Jun 2015 19:44:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2015 19:44:50 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.175 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.175 mail-ig0-f175.google.com Received: from [209.85.213.175] ([209.85.213.175:34784] helo=mail-ig0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/B1-46577-0B1F2955 for ; Tue, 30 Jun 2015 15:44:49 -0400 Received: by igcsj18 with SMTP id sj18so116171270igc.1 for ; Tue, 30 Jun 2015 12:44:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=K0UUqr8vwmf+FOrtxfu3H9b8hjN4q/Zmggr7UlO78qY=; b=UmggBiCaDbkGbx0ZW6NIe4T4gHYCJjPSgmawRyv6QtzwXO6so2AYPMLDlHFqvg69fN 4525yU7nWIQPleTbdcbQ9oiHGSVSAZ+VWOyVJSChp8jyBvoo1Jwigy9E0MBwh3D7z5Z7 JmonSGGjw/boSBB4m17Qhppbgb1pLWRuKKl6XKw8yyCJdN9apmmPbslIdozMYl4xpybv 6qNa5lX8ZaivxmVAHMZAcKOvo9Wzmi6uIPxDmExl0wU3bnAIodNilMU2JsM38h9TNKF7 ePlUUFtdjfkoVtiNog3kztXYCjXy/CmKc2Kvn3rLKnSAkMjNmCsUtmaCyKb4DFc1s3yj YbPw== X-Gm-Message-State: ALoCoQn4BhmN6/rh9sd3Hu3Sr1nYSbKQO1Op06wLiyhJMvmf/WmLqs/SlZ0sTyvzAdR39hElX5qQrXtjoy3hvn3XVJbKYsaM6zEZ1DHKnxqdTwvLANt2z6XSO3EDKuTcIVLY++pcxdrtCcorGHbBimWRNd/noGkF6olG7PUaSXUreXRhTFtxEbc= MIME-Version: 1.0 X-Received: by 10.50.132.70 with SMTP id os6mr27877386igb.27.1435693484863; Tue, 30 Jun 2015 12:44:44 -0700 (PDT) Received: by 10.50.241.50 with HTTP; Tue, 30 Jun 2015 12:44:44 -0700 (PDT) In-Reply-To: <055b01d0b364$5414b890$fc3e29b0$@belski.net> References: <055b01d0b364$5414b890$fc3e29b0$@belski.net> Date: Tue, 30 Jun 2015 22:44:44 +0300 Message-ID: To: Anatol Belski Cc: PHP Internals , Pierre Joye , Kalle Sommer Nielsen , Xinchen Hui , Nikita Popov Content-Type: multipart/alternative; boundary=047d7b2e42f22c11e80519c1708d Subject: Re: Fixes for #69900 and #69963 From: dmitry@zend.com (Dmitry Stogov) --047d7b2e42f22c11e80519c1708d Content-Type: text/plain; charset=UTF-8 Hi Anatol, I don't see any problems committing this. Thanks. Dmitry. On Tue, Jun 30, 2015 at 9:41 PM, Anatol Belski wrote: > Hi, > > regarding the mentioned tickets I've prepared a patch > https://github.com/php/php-src/compare/master...weltling:pipe_blocking_win > . > Anonymous pipes on Windows > > - don't support asynchronous IO > - don't support select() > - have buffer size of 4096 bytes (or even less) which is much easier > overflown that a buffer of 64kb often to be seen on Unix > > These issues was addressed last year, but the tickets mentioned report > about > the issues still persisting in PHP5/7. While it's likely a no go for PHP5, > I > would like to push this patch into PHP7. Particularly what it does is > allowing the blocking read() again for the edge cases reported in the > listed > tickets. It is done adding a context option and a new win only option for > proc_open. Just to illustrate a few - > > ==== SNIPPET ==== > /* here proc_open() will do a blocking read on the child process*/ > $process = proc_open(PHP_BINARY.' -f ' . $fl, $descriptorspec, $pipes, > NULL, > NULL, array("blocking_pipes" => true)); > ==== END SNIPPET ==== > > ==== SNIPPET ==== > $in = fopen("php://stdin", "rb", false, stream_context_create(array("pipe" > => array("blocking" => true)))); > +while(!feof($in)){ /* here feof() will do a blocking read on the pipe */ > ........................ > ==== END SNIPPET ==== > > The only drawback on this is that blocking reads on pipes are likely to > cause pipe buffer overflows and thus deadlock, like it was before. Though, > when working with them carefully, this could be avoided and would bring > improvements with several edge cases, almost when working on CLI. Anyway > this patch brings no difference to PHP5 while addressing those edge cases. > > I would like to ask for review here. I've also made a minimal build with > this patch http://windows.php.net/downloads/snaps/ostc/69900/ for those > interested to test. If there are no strong objections, it should be merged > soon. > > Thanks > > Anatol > > --047d7b2e42f22c11e80519c1708d--