[xdebug-dev] xdebug xdebug/test.sh xdebug/xdebug_var.c xdebug/tests/bug00032-ze22.phpt xdebug/tests/bug00184.phpt xdebug/tests/bug00032.phpt xdebug/tests/test18.phpt - Fixed bug #184: problem with control chars in code traces

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sat, 27 May 2006 22:06:58 +0200

Date: Sat May 27 22:06:57 CEST 2006
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Fixed bug #184: problem with control chars in code traces

Modified files:
           xdebug/test.sh (version: 1.17)
           xdebug/xdebug_var.c (version: 1.71)
           xdebug/tests/bug00032.phpt (version: 1.12)
           xdebug/tests/test18.phpt (version: 1.16)
Added files:
           xdebug/tests/bug00032-ze22.phpt (new version: 1.1)
           xdebug/tests/bug00184.phpt (new version: 1.1)

[FILE: /xdebug/test.sh]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- xdebug/test.sh:1.16 Mon Nov 01 11:09:49 2004 GMT
+++ xdebug/test.sh Sat May 27 18:06:57 2006 GMT
@@ -1 +1 @@
-TEST_PHP_EXECUTABLE=`which php-5.1dev` php-5.1dev -dxdebug.auto_trace=0 /dat/dev/php/php-5.1dev/run-tests.php tests/*.phpt
+TEST_PHP_EXECUTABLE=`which php-5.2dev` php-5.2dev -dxdebug.auto_trace=0 /dat/dev/php/php-5.2dev/run-tests.php tests/*.phpt

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- xdebug/xdebug_var.c:1.70 Thu May 11 09:07:23 2006 GMT
+++ xdebug/xdebug_var.c Sat May 27 18:06:57 2006 GMT
@@ -206,7 +206,7 @@
                         break;
 
                 case IS_STRING:
- tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\", 2 TSRMLS_CC);
+ tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\\0..\37", 6 TSRMLS_CC);
                         xdebug_str_add(str, xdebug_sprintf("'%s'", tmp_str), 1);
                         efree(tmp_str);
                         break;

[FILE: /xdebug/tests/bug00032-ze22.phpt]

--TEST--
Test for segmentation fault with unusual variables (ZE2.2)
--SKIPIF--
<?php if (!extension_loaded("xdebug")) print "skip"; ?>
<?php if(version_compare(zend_version(), "2.2.0-dev", '<')) echo "skip Zend Engine 2.2 needed\n"; ?>
--INI--
xdebug.default_enable=1
xdebug.auto_trace=0
xdebug.collect_params=1
xdebug.profiler_enable=0
xdebug.show_local_vars=0
--FILE--
<?php
        ${1} = "foo";
        echo ${1} . "\n";

        ${STDIN} = "foo";
        echo ${STDIN} . "\n";

        ${array(1,2,3)} = "foo";
        echo ${array(1,2,3)} . "\n";

        ${new stdclass} = "foo";
        echo ${new stdclass} . "\n";
?>
--EXPECTF--
foo
foo

Notice: Array to string conversion in %sbug00032-ze22.php on line 8

Call Stack:
%w%f %w%d 1. {main}() %sbug00032-ze22.php:0

Notice: Array to string conversion in %sbug00032-ze22.php on line 9

Call Stack:
%w%f %w%d 1. {main}() %sbug00032-ze22.php:0
foo

Catchable fatal error: Object of class stdClass could not be converted to IS_STRING in %sbug00032-ze22.php on line 11

Call Stack:
%w%f %w%d 1. {main}() %sbug00032-ze22.php:0

Notice: Object of class stdClass to string conversion in %sbug00032-ze22.php on line 11

Call Stack:
%w%f %w%d 1. {main}() %sbug00032-ze22.php:0

Catchable fatal error: Object of class stdClass could not be converted to IS_STRING in %sbug00032-ze22.php on line 12

Call Stack:
%w%f %w%d 1. {main}() %sbug00032-ze22.php:0

Notice: Object of class stdClass to string conversion in %sbug00032-ze22.php on line 12

Call Stack:
%w%f %w%d 1. {main}() %sbug00032-ze22.php:0
foo

[FILE: /xdebug/tests/bug00184.phpt]

--TEST--
Test for bug #184: problem with control chars in code traces
--INI--
xdebug.default_enable=1
xdebug.auto_trace=1
xdebug.trace_options=0
xdebug.trace_output_dir=/tmp
xdebug.collect_return=1
xdebug.collect_params=1
xdebug.auto_profile=0
xdebug.profiler_enable=0
xdebug.dump_globals=0
xdebug.show_mem_delta=0
xdebug.trace_format=0
--FILE--
<?php
        $trace_file = xdebug_get_tracefile_name();
        str_replace(array("\r", "\n"), ' ', 'foobar');
        echo file_get_contents($trace_file);
        unlink($trace_file);
        echo "DONE\n";
?>
--EXPECTF--
TRACE START [%d-%d-%d %d:%d:%d]
%w%f %w%d -> {main}() %sbug00184.php:0
%w%f %w%d -> xdebug_get_tracefile_name() %sbug00184.php:2
>=> '/tmp/trace.%d.xt'
%w%f %w%d -> str_replace(array (0 => '\r', 1 => '\n'), ' ', 'foobar') %sbug00184.php:3
>=> 'foobar'
%w%f %w%d -> file_get_contents('/tmp/trace.%d.xt') %sbug00184.php:4
DONE

[FILE: /xdebug/tests/bug00032.phpt]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- xdebug/tests/bug00032.phpt:1.11 Mon Jan 02 15:12:31 2006 GMT
+++ xdebug/tests/bug00032.phpt Sat May 27 18:06:57 2006 GMT
@@ -2,7 +2,8 @@
 Test for segmentation fault with unusual variables (ZE2)
 --SKIPIF--
 <?php if (!extension_loaded("xdebug")) print "skip"; ?>
-<?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2 needed\n"; ?>
+<?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2.0/2.1 needed\n"; ?>
+<?php if(version_compare(zend_version(), "2.2.0-dev", '>')) echo "skip Zend Engine 2.2 needed\n"; ?>
 --INI--
 xdebug.default_enable=1
 xdebug.auto_trace=0

[FILE: /xdebug/tests/test18.phpt]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- xdebug/tests/test18.phpt:1.15 Mon Jan 02 15:12:31 2006 GMT
+++ xdebug/tests/test18.phpt Sat May 27 18:06:57 2006 GMT
@@ -37,10 +37,7 @@
 TRACE START [%d-%d-%d %d:%d:%d]
 %w%f %w%d -> foo() /%s/test18.php:14
 %w%f %w%d -> bar() /%s/test18.php:11
-%w%f %w%d -> eval('$foo = foo();
-bar();
-foo();
-') /%s/test18.php:16
+%w%f %w%d -> eval('$foo = foo();\nbar();\nfoo();\n') /%s/test18.php:16
 %w%f %w%d -> foo() /%s/test18.php(16) : eval()'d code:1
 %w%f %w%d -> bar() /%s/test18.php:11
 %w%f %w%d -> bar() /%s/test18.php(16) : eval()'d code:2
Received on Sat May 27 2006 - 22:07:01 BST

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