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]