php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29042 stream fails to close if malformed interface is used
Submitted: 2004-07-07 04:04 UTC Modified: 2005-02-15 01:15 UTC
From: tim at timcrider dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0RC3 OS: Fedora Core 2
Private report: No CVE-ID: None
 [2004-07-07 04:04 UTC] tim at timcrider dot com
Description:
------------
While playing around with interfaces I came across this error message.

/data/BUILD/php/main/streams/streams.c(374) : Stream of type 'STDIO' 0xf7085204 (path:permissionInterface.php) was not closed

If you do not include permissionInterface.php, and actually write out that code the error does not occur. The error does not occur also if the interface is properly formatted.

Here is some general info:

PHP 5.0.0RC3 on Fedora Core 2

Libs:
-lcrypt -lexslt -lcrypt -lpq -lpanel -lncurses -lmysqlclient -lming -lm -lmhash -lmcrypt -lltdl -lfreetype -lpng -lz -ljpeg -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl -lgcc -lxml2 -lz -lm -lxml2 -lz -lm -lodbc -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -lcrypt

Includes:
-I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM

LDFlags:
-rdynamic -rdynamic -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 -L/usr/local/libxml2-2.6.9/lib -L/usr/local/lib -L/usr/local/openssl-0.9.7d/lib -L/usr/local//lib -L/usr/local/lib/mysql -L/usr/local/pgsql/lib



Reproduce code:
---------------
#!/usr/local/bin/php -q
<?php

 require_once "permissionInterface.php";

/** BEGIN CONTENTS OF permissionInterface.php
 interface permissionInterface 
 {
    public function authenticate(){ }
    public function getUserProfile();
    public function getUserGroups();
    public function logout();

 }
END CONTENTS OF permisionInterface.php **/

 class bar implements permissionInterface
 {
   private function __construct() { }
   public function authenticate() {}
   public function getUserProfile() {}
   public function getUserGroups() {}
   public function logout(){}
 }

 $phoo = New bar;

 print_r($phoo);

?>

Expected result:
----------------
Fatal error: Interface function permissionInterface::authenticate() cannot contain body in /home/tim/projects/permissionWheel/permissionInterface.php on line 5


Actual result:
--------------
Fatal error: Interface function permissionInterface::authenticate() cannot contain body in /home/tim/projects/permissionWheel/permissionInterface.php on line 5
/data/BUILD/php/main/streams/streams.c(374) : Stream of type 'STDIO' 0xf7085204 (path:permissionInterface.php) was not closed

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-15 01:15 UTC] tony2001@php.net
The problem has nothing to do with interfaces and seems to appear on any parse error and only when PHP was compiled with --enable-debug.
See #30708 - it describes the same issue, but has a bit more correct example.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 22:01:26 2024 UTC