ID:               32742
 User updated by:  public at grik dot net
 Reported By:      public at grik dot net
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: Linux (RH7,RH9,Gentoo)
 PHP Version:      5.0.4
 New Comment:

The "reproduce code" disappeared (it was in the form, I checked). Here
it is:

class Wrapper{
    function stream_open($path, $path, $options, &$opened_path){return
true;}
}

stream_wrapper_register("wr", 'Wrapper')
or die("Failed to register protocol");

$fp = fopen ('wr://example', 'w');

//fclose ($fp);
echo microtime();


Previous Comments:
------------------------------------------------------------------------

[2005-04-18 14:44:29] public at grik dot net

Description:
------------
There is a problem with stream_wrapper_register() that appears on Linux
and not on the FreeBSD.
I open a stream with the registered wrapper and assing a handler to the
resource variable.
If a variable stays alive when the execution of the script reaches the
end, PHP gives the segmentation fault.
Attempt to close the resource from an object destructor does not help.

Platforms tested: 5 servers with Red Hat 7, 9 and gentoo 5.03 (kernels
2.4, 2.6, 2.6 hardened), PHP 5.03, 5.04, 4.3.7

In FreeBSD 5.3 there is no problem executing the script.

Reproduce code:
---------------
<?php
class Wrapper{
    function stream_open($path, $path, $options, &$opened_path){return
true;}
//... other methods do not matter for this bug
}

stream_wrapper_register("wr", 'Wrapper')
or die("Failed to register protocol");

$fp = fopen ('wr://example', 'w');

//fclose ($fp);
echo microtime();
?> 

Expected result:
----------------
time with microseconds

Actual result:
--------------
When run from the command line - time with microseconds and words
"Segmentation fault",
when called from browser - no output.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32742&edit=1

Reply via email to