[xdebug-dev] Bug 0000167: [php4] crashed with user session handler

From: <xdebug-dev[@]lists.xdebug.org>
Date: Sat, 19 Aug 2006 14:38:01 +0200

The following bug has been RESOLVED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000167
======================================================================
Reporter: Xuefer
Handler: derick
======================================================================
Project: Xdebug
Bug ID: 167
Category: Usage problems
Reproducibility: always
Severity: crash
Priority: none
Status: resolved
Operating System:
PHP Version: 4.3.11
Xdebug Version: 2.0.0beta4
Resolution: unable to duplicate
======================================================================
Date Submitted: 2006-02-14 05:43 CET
Last Modified: 2006-08-19 14:38 CEST
======================================================================
Summary: [php4] crashed with user session handler
Description:
i guess the same fix is done for php5+ by ZE2's post_deactive func, but
it's not enough for php4
patch here

cvs diff: Diffing .
Index: xdebug.c
===================================================================
RCS file: /repository/xdebug/xdebug.c,v
retrieving revision 1.298
diff -u -r1.298 xdebug.c
--- xdebug.c 10 Feb 2006 14:44:55 -0000 1.298
+++ xdebug.c 14 Feb 2006 04:41:59 -0000
@@ -1165,6 +1165,12 @@
    int function_nr = 0;
    xdebug_llist_element *le;
 
+ if (XG(stack) == NULL) {
+ /* in request shutdown */
+ xdebug_old_execute(op_array TSRMLS_CC);
+ return;
+ }
+
    if (XG(level) == 0) {
        /* Set session cookie if requested */
        if (
@@ -1339,6 +1345,12 @@
    int do_return = (XG(do_trace) && XG(trace_file));
    int function_nr = 0;
 
+ if (XG(stack) == NULL) {
+ /* in request shutdown */
+ execute_internal(current_execute_data, return_value_used
TSRMLS_CC);
+ return;
+ }
+
    XG(level)++;
    if (XG(level) == XG(max_nesting_level)) {
        php_error(E_ERROR, "Maximum function nesting level of '%ld'
reached, aborting!", XG(max_nesting_level));

======================================================================

----------------------------------------------------------------------
 derick - 2006-02-21 22:35 CET
----------------------------------------------------------------------
Do you have a reproducing script with this perhaps?

----------------------------------------------------------------------
 Xuefer - 2006-03-10 12:20 CET
----------------------------------------------------------------------
<?php
function a()
{
    b();
}
function b()
{
    $dummy = 1;
}

session_set_save_handler('a', 'a', 'a', 'a', 'a', 'a');
session_start();
?>

tested when xdebug is put as php-src/ext/xdebug, buildconf, configure
--enable-xdebug
well... the doc and the source said one should load it as zend extension,
but it looks fine with the patch.

Bug History
Date Modified Username Field Change
======================================================================
2006-02-14 05:43Xuefer New Bug
2006-02-14 05:43Xuefer Bug Monitored: Xuefer
2006-02-21 22:35derick Bugnote Added: 0000372
2006-02-21 22:35derick Priority normal => none
2006-02-21 22:35derick Status new => feedback
2006-03-10 12:20Xuefer Bugnote Added: 0000383
2006-08-19 14:38derick Assigned To => derick
2006-08-19 14:38derick Resolution open => unable to duplicate
2006-08-19 14:38derick Status feedback => resolved
======================================================================
Received on Sat Aug 19 2006 - 14:38:03 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST