Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15902 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83391 invoked by uid 1010); 8 Apr 2005 14:58:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 83376 invoked from network); 8 Apr 2005 14:58:49 -0000 Received: from unknown (HELO php.net) (127.0.0.1) by localhost with SMTP; 8 Apr 2005 14:58:49 -0000 X-Host-Fingerprint: 80.190.230.99 www.troja.net Linux 2.4/2.6 Received: from ([80.190.230.99:32769] helo=mail.troja.net) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 39/3B-19272-82C96524 for ; Fri, 08 Apr 2005 10:58:48 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 810CBD3CE; Fri, 8 Apr 2005 16:58:41 +0200 (CEST) Received: from mail.troja.net ([127.0.0.1]) by localhost (cyca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03967-08; Fri, 8 Apr 2005 16:58:39 +0200 (CEST) Received: from vega.php.net (port-212-202-182-143.dynamic.qsc.de [212.202.182.143]) (using SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTP id A8DB0D1AE; Fri, 8 Apr 2005 16:58:38 +0200 (CEST) Message-ID: <6.2.0.14.0.20050408165118.03859cd0@127.0.0.1> X-Mailer: QUALCOMM Windows Eudora Version 6.2.0.14 Date: Fri, 08 Apr 2005 16:58:39 +0200 To: internals@lists.php.net Cc: kingwez@gmail.com In-Reply-To: <6.2.0.14.0.20050407093245.0385c520@127.0.0.1> References: <6.2.0.14.0.20050407093245.0385c520@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at troja.net Subject: Re: [PHP-DEV] [PATCH] fix crash in solaris when fdopen() fails From: thetaphi@php.net (Uwe Schindler) OK - I found out that the fdopen() code is never called in the PHP environment, so patch is not needed (PHP sets zend_file_handle always to STREAM). But I still want to know for what extensions/functions the casts from posix to stdio are needed- Will casting appear somewhere when the user calls the userlevel-file-functions starting with fopen()?. It is hard work to find out with simple search through CVS. The only position I know is because of popen() etc. in the exec functions which are stdio (posix variants are more complicated), which is the cause for the bug report I mentioned. At 09:40 07.04.2005, Uwe Schindler wrote: >I am fixing bug #32614: Problem, on the solaris platform fdopen() can fail >even if fd is a correct file descriptor, when fd>255 (the well-known >solaris stdio problem). The webserver of the user crashes because the >return value of fdopen() is not checked for NULL when casting a stream >from posix to stdio. After this fd==-1 and fp==NULL ==> further calls to >fread/fwrite with this fp segfault. >I committed the patches for PHP but I have no karme for "ZendEngine2". Can >someone with karma submit this patch? > >According to this it would be interesting, WHEN some PHP/Zend code tries >to cast a POSIX stream to stdio? In which extension/functions? Can this be >fixed to only use posix IO? The zend engine itself should be safe since >4.3.3 and since PHP5. > >Does stream casts apply if a user uses the PHP user functions fopen, >fread, fwrite? Since Saschas fix in PHP4 there this does not happen. What >about PHP5? > >I would try to fix this everywhere in the future. > >----- >Uwe Schindler >thetaphi@php.net - http://www.php.net >NSAPI SAPI developer >Erlangen, Germany > > > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php ----- Uwe Schindler thetaphi@php.net - http://www.php.net NSAPI SAPI developer Bremen, Germany