Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58973 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15224 invoked from network); 15 Mar 2012 22:02:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2012 22:02:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:39392] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/05-16214-8F6626F4 for ; Thu, 15 Mar 2012 17:02:34 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id EECFB70003ED; Thu, 15 Mar 2012 22:02:29 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id wtvpVrsrhkDk; Thu, 15 Mar 2012 22:02:29 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 9FB2270003DC; Thu, 15 Mar 2012 22:02:29 +0000 (WET) Received: from damnation.mshome.net (damnation-air.nl.lo.geleia.net [IPv6:2001:470:94a2:4:7d06:1af1:ea64:2d52]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id ECBEF20071AF; Thu, 15 Mar 2012 22:02:27 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net, ericsten@microsoft.com References: <3ADF645454450443973DDB04FC00A0E525885F35@TK5EX14MBXC296.redmond.corp.microsoft.com> Date: Thu, 15 Mar 2012 23:02:26 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: <3ADF645454450443973DDB04FC00A0E525885F35@TK5EX14MBXC296.redmond.corp.microsoft.com> User-Agent: Opera Mail/11.61 (Win32) Subject: Re: [PHP-DEV] Q: ZEND_HANDLE_STREAM and wincache extension on PHP 5.4 From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Thu, 15 Mar 2012 19:56:11 +0100, Eric Stenson wrote: > > The problem I'm running into is the php_cgi!main() on PHP5.4 has changed > behavior. The php_cgi!main() function is seeing us return a > ZEND_HANDLE_STREAM, > and it's assuming that the zend_file_handle.handle.stream.handle (void *) > is a (php_stream*), when in fact it's php_wincache's (fcache_handle *). > It then attempts to access the php_stream.ops (a v-table-ish struct), > which is not in the fcache_handle, and it jumps off into an invalid > address and > promptly AV's. > > [...] I think you should contact Dmitry, as he was the one that committed r301058. That code looks very strange. It seems to want to break the abstraction of zend_stream and assume that handle stores a php_stream (to use e.g. zend_stream_getc instead of php_stream_getc). But I don't think the assumption done to break the abstraction is correct. For instance, see http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/phar/phar.c#3364 which has: file_handle->handle.stream.handle = phar; and *phar is of type phar_archive_data, which is not a php_stream (or an augmentation thereof). -- Gustavo Lopes