ID: 14834
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Session related
Operating System: Debian 3.0 (Woody)
PHP Version: 4.1.0
New Comment:

Confirmed with CVS snapshot php4-200201160300 (compiled as CGI), Linux
2.4.12.

PHP configuration is:
./configure --enable-debug



And another test case:

<?
session_register("test");
$HTTP_SESSION_VARS=$test;
?>


And the backtrace:


#0  0x8114b7e in _zend_is_inconsistent (ht=0x5a5a5a5a, file=0x8161e04
"zend_hash.c", line=975) at zend_hash.c:84
#1  0x8117116 in zend_hash_internal_pointer_reset_ex (ht=0x5a5a5a5a,
pos=0xbffff320) at zend_hash.c:975
#2  0x808c5e2 in php_session_save_current_state () at session.c:577
#3  0x808ecb5 in php_session_flush () at session.c:1450
#4  0x808ece6 in zm_deactivate_session (type=1, module_number=3) at
session.c:1467
#5  0x8113dbc in module_registry_cleanup (module=0x81ab508) at
zend_API.c:1166
#6  0x811664c in zend_hash_apply (ht=0x818b920, apply_func=0x8113d84
<module_registry_cleanup>) at zend_hash.c:669
#7  0x8110d57 in zend_deactivate_modules () at zend.c:581
#8  0x806126e in php_request_shutdown (dummy=0x0) at main.c:722
#9  0x805fe14 in main (argc=2, argv=0xbffff9f4) at cgi_main.c:798
#10 0x400a5577 in __libc_start_main () from /lib/libc.so.6


The backtrace is the same as the one generated by the previous test
case.


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

[2002-01-06 22:30:18] [EMAIL PROTECTED]

Confirmed with 4.2.0-dev (2002/1/7). It does segfault with my linux
also.

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

[2002-01-03 18:07:36] [EMAIL PROTECTED]

The following script always produces a segmentation fault on verison
4.1.0:  

<?
session_start();
$bar = foo($HTTP_SESSION_VARS);

function foo() {
        global $HTTP_SESSION_VARS;
        return true;
}
?>
<h1>Test is complete</h1>

The problem goes away if you remove the session array as a parameter to
the foo() function (which is not expecting any parameters anyway).  The
problem also goes away if you remove the "global" declaration inside
the foo() function.  No errors or warning are generated when the
function call occurs.  

Granted, this code snippet looks very odd (why would anyone want to
pass HTTP_SESSION_VARS, for example), but was the quickest (least lines
of code) way to set up the conditions that will always force the error.
 The problem also occurs if you try to pass the new _SESSION array and
still reference the older HTTP_SESSION_VARS in the function.

Reigster_globals is off.  Error_level is set to E_ALL.  Apache version
is 1.3.22-5.




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



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


-- 
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]

Reply via email to