ID:               18590
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Verified
 Bug Type:         Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:      4.3.0-dev
 New Comment:

In latest version of ZendEngine 2 the last example results a core dump.
Here is the backtrace:
#0  0x80e42bc in _efree (ptr=0x401b4748, __zend_filename=0x813a0c0
"/home/rei/PHP_CVS/php4/Zend/zend_opcode.c", __zend_lineno=124,
    __zend_orig_filename=0x0, __zend_orig_lineno=0) at
/home/rei/PHP_CVS/php4/Zend/zend_alloc.c:238
#1  0x80f002d in destroy_zend_class (pce=0x8154e34) at
/home/rei/PHP_CVS/php4/Zend/zend_opcode.c:124
#2  0x80fd25a in zend_hash_destroy (ht=0x814b840) at
/home/rei/PHP_CVS/php4/Zend/zend_hash.c:541
#3  0x80f72a2 in zend_shutdown () at
/home/rei/PHP_CVS/php4/Zend/zend.c:539
#4  0x80c3d9f in php_module_shutdown () at
/home/rei/PHP_CVS/php4/main/main.c:1190
#5  0x8113004 in main (argc=2, argv=0xbffff7f4) at
/home/rei/PHP_CVS/php4/sapi/cli/php_cli.c:753
#6  0x400b4f5c in __libc_start_main (main=0x8112590 <main>, argc=2,
ubp_av=0xbffff7f4, init=0x8059b30 <_init>, fini=0x81135bc <_fini>,
    rtld_fini=0x4000ce30 <_dl_fini>, stack_end=0xbffff7ec) at
../sysdeps/generic/libc-start.c:129

ZE1 does not core however it does show 4 memory leaks:
/home/rei/PHP_CVS/php4/Zend/zend_API.c(597) :  Freeing 0x0836ED0C (44
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_API.c(585) : Actual location (location
was relayed)
/home/rei/PHP_CVS/php4/Zend/zend_hash.c(178) :  Freeing 0x083696F4 (32
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_execute.c(1956) :  Freeing 0x08368B3C
(12 bytes), script=z2.php


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

[2002-08-07 02:16:35] [EMAIL PROTECTED]

I have also been having problems with the "redeclare upon 
reload" bug for awhile, so I decided to see if I could 
isolate the code that was causing the problem. After a 
good deal of thinning down code, I believe I have figured 
it out (for my case, anyway). Observe the following 
script: 
 
<? 
class biff { 
        function __destruct() { 
                exit(); 
        } 
} 
 
new biff(); 
?> 
 
The first time I load it, everything is fine. The second 
time, it says "Fatal error: Cannot redeclare class biff in 
biff.php on line 2". I hit reload again, and everything is 
fine. Hit it again, fatal error. And so on..... 
 
It appears that putting exit() in the __destruct() method 
of an object causes this problem. 
 
Further testing revealed that the script will die upon the 
first declaration of any class or function. For example, 
you could declare a function called "foo" before the 
"biff" class, and it would be reported as redeclared, 
instead of "biff". 
 
On top of that, testing with a function also indicates 
"where" the function was redeclared from. This is not a 
bug, but it is useful information: especially since it 
tosses up garbage. For example, adding the "function foo() 
{}" at the beginning of the file causes this error: 
 
Cannot redeclare foo() (previously declared in I+V?:2) in 
biff.php on line 2 
 
Generally, it seems to say "previously declared in 
biff.php" once, then every time afterwards it will turn up 
garbage for the file name. This garbage changes for each 
reload. 
 
I am using cvs from August 5th, with Zend 2, as a module 
in Apache 1.3.23, Mandrake 8.2 (kernel 2.4.18), and glibc 
2.2.4.

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

[2002-07-27 05:54:33] [EMAIL PROTECTED]

Updated to Apache 1.3.26 but still the same problem...

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

[2002-07-27 05:16:39] [EMAIL PROTECTED]

You can safely upgrade from 1.3.24 to 1.3.26, but I doubt that will fix
things.

Derick

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

[2002-07-27 05:13:13] [EMAIL PROTECTED]

> 1. Update Apache

I'm unable to update Apache because PHP fails to load as a module with
Apache 2.0.39.

> Umm in php.ini see if theres an execution time limit, if so change it
to 0

It was intended that the script stops after 5 seconds (And that's not
my problem...)

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

[2002-07-26 22:25:50] [EMAIL PROTECTED]

1. Update Apache
2. Umm in php.ini see if theres an execution time limit, if so change
it to 0

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/18590

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

Reply via email to