Re: cvs: php-src(PHP_4_3) /ext/session session.c
| From: | Sascha Schumann | Date: | Tue, 22 Jul 2003 11:56:12 +0000 |
| Subject: | Re: cvs: php-src(PHP_4_3) /ext/session session.c | ||
| References: | 1 2 3 4 5 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-22713@lists.php.net to get a copy of this message | ||
> Can you give me a concrete example of when you think this macro doesn't
> behave properly? If it's correct, I'll try to fix it. Note that the last
> time you had problems with this (and other) macros these were actually bugs
> in the session module.
That was another instance showing the inherent lack of
abstraction in this particular API. What should be a black
box is a test of familiarity with implementation details.
<?php
$foo = $bar = $a;
@session_start();
$_SESSION['foo'] = $_SESSION['bar'] = $a;
All four zvals are initialized using an undefined variable.
During the shutdown phase, this occurs:
zval **val;
ht = Z_ARRVAL_P(PS(http_session_vars));
zend_hash_find(&EG(symbol_table), "foo", &val);
ZEND_SET_SYMBOL_WITH_LENGTH(ht, "foo", *val,
(*val)->refcount + 1 , 1);
zend_hash_find(&EG(symbol_table), "bar", &val);
/* crash in FREE_ZVAL */
ZEND_SET_SYMBOL_WITH_LENGTH(ht, "bar", *val,
(*val)->refcount + 1 , 1);
The contents of val at each stage can be seen here:
http://news.php.net/article.php?group=php.cvs&article=22706
- Sascha