[PHP-DEV] Fwd: Re: [thies@thieso.net: Re: [PHP-DEV] incomplete class broken?]

2001-08-06 Thread Zeev Suraski


Date: Mon, 06 Aug 2001 16:07:55 +0300
To: Thies C. Arntzen [EMAIL PROTECTED]
From: Zeev Suraski [EMAIL PROTECTED]
Subject: Re: [[EMAIL PROTECTED]: Re: [PHP-DEV] incomplete class broken?]
Cc: Thies C. Arntzen [EMAIL PROTECTED], Andi Gutmans [EMAIL PROTECTED]

At 16:00 06/08/2001, Thies C. Arntzen wrote:
 could you elaborate why it doesn't work (anymore)?

Yeah.  We no longer go over the entire class/function tables on shutdown, 
in order to clean the userland classes/functions.  We traverse the hash's 
linked list from its end, as userland entries will always be in the 
end.  When we hit a non userland entry, we stop.  This greatly improves 
performance.  It does mean, however, that internal entries should no 
longer be registered during the request.

Zeev

--
Zeev Suraski [EMAIL PROTECTED]
CTO   co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] incomplete class broken?

2001-08-05 Thread Thies C. Arntzen

On Sun, Aug 05, 2001 at 01:46:35PM +0200, Thies C. Arntzen wrote:
 
 hi,
 the following code breaks php:

after some more testing:

it seems that one can no longer call
zend_register_internal_class when the script is already
executing.

my testscript unserializes an object from a class that has
no definition loaded, so we call
php_create_incomplete_class() to setup our incomplete
class. this used to work just fine...

...
zend_class_entry *php_create_incomplete_class(TSRMLS_D)
{
zend_class_entry incomplete_class;
 
INIT_OVERLOADED_CLASS_ENTRY(incomplete_class, INCOMPLETE_CLASS, NULL,
incomplete_class_call_func,
incomplete_class_get_property,
incomplete_class_set_property);
 
BG(incomplete_class) = zend_register_internal_class(incomplete_class TSRMLS_CC);
 
return (BG(incomplete_class));
}
...

this together with (atleast) one user-level class will cause
the mentioned crash. i tend to think that something in zend
is causing this. zeev, andi?

BTW: if i call php_create_incomplete_class() from
MINIT(basic_functions) the problem goes away.

tc

 
 ?php
 class tubu { }
 $thies = unserialize('O:1:a:0:{}');
 ?
 
 X-Powered-By: PHP/4.0.7-dev
 Content-type: text/html
 
 ../../php4/Zend/zend_hash.c(176) :  Freeing 0x084B3A54 (64 bytes), script=../ser2.php
 Last leak repeated 1 time
 ../../php4/Zend/zend_compile.c(1532) :  Freeing 0x084B39AC (4 bytes), 
script=../ser2.php
 ../../php4/Zend/zend_language_scanner.l(1144) :  Freeing 0x084B390C (5 bytes), 
script=../ser2.php
 [Sun Aug  5 13:44:17 2001]  Script:  '../ser2.php'
 ---
 ../../php4/Zend/zend_opcode.c(117) : Block 0x084B3988 status:
 Beginning:Overrun (magic=0x08450298, expected=0x7312F8DC)
   End:Unknown
 ---
 [Sun Aug  5 13:44:17 2001]  Script:  '../ser2.php'
 ---
 ../../php4/Zend/zend_hash.c(548) : Block 0x084B39C0 status:
 Beginning:Overrun (magic=0x40B49080, expected=0x7312F8DC)
   End:Unknown
 ---
 [Sun Aug  5 13:44:17 2001]  Script:  '../ser2.php'
 ---
 ../../php4/Zend/zend_hash.c(548) : Block 0x084B3A30 status:
 Beginning:Overrun (magic=0x40B49040, expected=0x7312F8DC)
   End:Unknown
 ---
 
 if you comment out the tubu class everything works. i'm not
 too sure if this is due to saschas work in var.c or some
 changes in the engine.
 
 does anybody have a clue what might be wrong?
 
 re,
 tc
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]