[xdebug-dev] Bug 0000093: crash in lookup_hostname on x86_64

From: <xdebug-dev[@]lists.xdebug.org>
Date: Tue, 12 Oct 2004 16:56:36 +0200

The following bug has been CLOSED
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000093
======================================================================
Reporter: ratchet
Handler:
======================================================================
Project: Xdebug
Bug ID: 93
Category: Usage problems
Reproducibility: always
Severity: crash
Priority: normal
Status: closed
Operating System: SUSE Linux 9.1/x86_64
PHP Version: 4.3.4
Xdebug Version: 2.0-dev
======================================================================
Date Submitted: 2004-10-06 16:23 CEST
Last Modified: 2004-10-12 16:56 CEST
======================================================================
Summary: crash in lookup_hostname on x86_64
Description:
Under certain circumstances, setting the remote_port seems to be
overwriting the memory that stores the remote_host. Using PHP CLI, this
occurs when setting remote_port after remote_host in the environment:

ratchet[@]rsdev:~> XDEBUG_CONFIG="remote_enable=1 remote_handler=dbgp
remote_host=localhost remote_port=8009" php test.php
Segmentation fault
======================================================================

----------------------------------------------------------------------
 ratchet - 2004-10-06 16:25 CEST
----------------------------------------------------------------------
Proposed fix, made against the CVS code as of 2004-10-05:

Index: php_xdebug.h
===================================================================
RCS file: /repository/xdebug/php_xdebug.h,v
retrieving revision 1.81
diff -u -r1.81 php_xdebug.h
--- php_xdebug.h 3 Oct 2004 13:10:56 -0000 1.81
+++ php_xdebug.h 6 Oct 2004 01:43:45 -0000
@@ -93,7 +93,7 @@

        int level;
        xdebug_llist *stack;
- int max_nesting_level;
+ long max_nesting_level;
        zend_bool default_enable;
        zend_bool collect_includes;
        zend_bool collect_params;
@@ -138,7 +138,7 @@

        /* remote settings */
        zend_bool remote_enable; /* 0 */
- int remote_port; /* 9000 */
+ long remote_port; /* 9000 */
        char *remote_host; /* localhost */
        int remote_mode; /* XDEBUG_NONE, XDEBUG_JIT,
XDEBUG_REQ */
        char *remote_handler; /* php3, gdb, dbgp */

----------------------------------------------------------------------
 derick - 2004-10-06 16:59 CEST
----------------------------------------------------------------------
Fixed in Cvs, thanks for the patch. There might be some more 64bit issues,
but unfortunately I do not have access to a 64bit machine running linux.

----------------------------------------------------------------------
 ratchet - 2004-10-06 19:10 CEST
----------------------------------------------------------------------
Found related problem when specifying remote_handler at the end of the
options string:

ratchet[@]rsdev:~> XDEBUG_CONFIG="remote_enable=1 remote_host=localhost
remote_port=9998 remote_handler=dbgp" php test.php
Segmentation fault

----------------------------------------------------------------------
 ratchet - 2004-10-06 19:13 CEST
----------------------------------------------------------------------
Another proposed patch, made against CVS as of 2004-10-06:

Index: php_xdebug.h
===================================================================
RCS file: /repository/xdebug/php_xdebug.h,v
retrieving revision 1.82
diff -u -r1.82 php_xdebug.h
--- php_xdebug.h 6 Oct 2004 14:58:38 -0000 1.82
+++ php_xdebug.h 6 Oct 2004 17:06:49 -0000
@@ -140,7 +140,7 @@
        zend_bool remote_enable; /* 0 */
        long remote_port; /* 9000 */
        char *remote_host; /* localhost */
- int remote_mode; /* XDEBUG_NONE, XDEBUG_JIT,
XDEBUG_REQ */
+ long remote_mode; /* XDEBUG_NONE, XDEBUG_JIT,
XDEBUG_REQ */
        char *remote_handler; /* php3, gdb, dbgp */
        zend_bool remote_autostart; /* Disables the requirement for
XDEBUG_SESSION_START */

This appears to be the last xdebug_globals integer value that
zend_alter_ini_entry touches.

----------------------------------------------------------------------
 derick - 2004-10-12 16:56 CEST
----------------------------------------------------------------------
Fixed in CVS.

Bug History
Date Modified Username Field Change
======================================================================
2004-10-06 16:23ratchet New Bug
2004-10-06 16:25ratchet Bugnote Added: 0000197
2004-10-06 16:59derick Bugnote Added: 0000198
2004-10-06 16:59derick Status new => closed
2004-10-06 19:10ratchet Bugnote Added: 0000199
2004-10-06 19:10ratchet Resolution open => reopened
2004-10-06 19:10ratchet Status closed => feedback
2004-10-06 19:13ratchet Bugnote Added: 0000200
2004-10-12 16:56derick Bugnote Added: 0000203
2004-10-12 16:56derick Status feedback => closed
======================================================================
Received on Tue Oct 12 2004 - 16:56:42 BST

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