Bug #73927 [Asn]: phpdbg fails with windows error prompt at "watch array"
| From: | cmb@php.net | Date: | Sat, 23 Jun 2018 13:59:02 +0000 |
| Subject: | Bug #73927 [Asn]: phpdbg fails with windows error prompt at "watch array" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215877@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73927&edit=1
ID: 73927
Updated by: cmb@php.net
Reported by: stahlstift at gmail dot com
Summary: phpdbg fails with windows error prompt at "watch
array"
Status: Assigned
Type: Bug
Package: phpdbg
Operating System: Windows 10 Pro
PHP Version: 7.0.14
Assigned To: bwoebi
Block user comment: N
Private report: N
New Comment:
The given reproduce script results in a segfault on Debian with
current master (e03739d4ab46b234709bdaa29280e16af94884c4):
Program received signal SIGSEGV, Segmentation fault.
0x00005555559da136 in zval_get_type (pz=0x1)
at /parent/php-src/Zend/zend_types.h:412
412 return pz->u1.v.type;
(gdb) bt
#0 0x00005555559da136 in zval_get_type (pz=0x1)
at /parent/php-src/Zend/zend_types.h:412
#1 0x00005555559db36b in phpdbg_parse_variable_with_arg (
input=0x7ffff68010f0 "$lower[]", len=8, parent=0x7ffff68652a0, i=7,
callback=0x5555559e8319 <phpdbg_watchpoint_parse_wrapper>,
step_cb=0x5555559e8585 <phpdbg_watchpoint_parse_step>, silent=0 '\000',
arg=0x7fffffffd1f0) at /parent/php-src/sapi/phpdbg/phpdbg_utils.c:474
#2 0x00005555559e88b9 in phpdbg_watchpoint_parse_symtables (
input=0x7ffff68010f0 "$lower[]", len=8,
callback=0x5555559e8155 <phpdbg_create_simple_watchpoint>)
at /parent/php-src/sapi/phpdbg/phpdbg_watch.c:1317
#3 0x00005555559e8a04 in phpdbg_create_var_watchpoint (
input=0x7ffff68010f0 "$lower[]", len=8)
at /parent/php-src/sapi/phpdbg/phpdbg_watch.c:1347
#4 0x00005555559ce016 in phpdbg_do_watch (param=0x555555eb9310)
at /parent/php-src/sapi/phpdbg/phpdbg_prompt.c:1594
#5 0x00005555559e1c3f in phpdbg_internal_stack_execute (stack=0x7fffffffd2d0,
allow_async_unsafe=1 '\001')
at /parent/php-src/sapi/phpdbg/phpdbg_cmd.c:703
#6 0x00005555559e1d32 in phpdbg_stack_execute (stack=0x7fffffffd2d0,
allow_async_unsafe=1 '\001')
at /parent/php-src/sapi/phpdbg/phpdbg_cmd.c:733
#7 0x00005555559ce163 in phpdbg_interactive (allow_async_unsafe=1 '\001',
input=0x7ffff68010c0 "w $lower[]\n")
at /parent/php-src/sapi/phpdbg/phpdbg_prompt.c:1631
#8 0x00005555559cf15d in phpdbg_execute_ex (execute_data=0x7ffff6821030)
at /parent/php-src/sapi/phpdbg/phpdbg_prompt.c:1877
#9 0x00005555559bcb47 in zend_execute (op_array=0x7ffff686f400,
return_value=0x555555e6afe0 <phpdbg_globals+1344>)
at /parent/php-src/Zend/zend_vm_execute.h:59961
#10 0x00005555559cbd57 in phpdbg_do_run (param=0x0)
at /parent/php-src/sapi/phpdbg/phpdbg_prompt.c:942
#11 0x00005555559e1c3f in phpdbg_internal_stack_execute (stack=0x7fffffffd7e0,
allow_async_unsafe=1 '\001')
at /parent/php-src/sapi/phpdbg/phpdbg_cmd.c:703
#12 0x00005555559e1d32 in phpdbg_stack_execute (stack=0x7fffffffd7e0,
allow_async_unsafe=1 '\001')
at /parent/php-src/sapi/phpdbg/phpdbg_cmd.c:733
#13 0x00005555559ce163 in phpdbg_interactive (allow_async_unsafe=1 '\001',
input=0x7ffff6804050 "r\n")
at /parent/php-src/sapi/phpdbg/phpdbg_prompt.c:1631
#14 0x00005555559c2e8e in main (argc=1, argv=0x7fffffffe648)
at /parent/php-src/sapi/phpdbg/phpdbg.c:2008
Previous Comments:
------------------------------------------------------------------------
[2017-01-13 14:28:04] stahlstift at gmail dot com
Description:
------------
C:\Users\username\PhpstormProjects\phpdbg>phpdbg
[Welcome to phpdbg, the interactive PHP debugger, v0.5.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
prompt> e test.php
[Set execution context: C:\Users\username\PhpstormProjects\phpdbg\test.php]
[Successful compilation of C:\Users\username\PhpstormProjects\phpdbg\test.php]
prompt> l 20
00001: <?php
00002:
00003: // Generate some mock data
00004: $example = [1, 23, 23423, 256436, 3463, 4363, 457];
00005: foreach (range(1, 1000) as $val) {
00006: $example[] = mt_rand(1, 10000);
00007: }
00008:
00009: // Stuff to debug
00010: function doCoolStuff($value)
00011: {
00012: $value++;
00013:
00014: return mt_rand(1, 1000);
00015: }
00016:
00017: $lower = [];
00018: foreach ($example as $key => $value) {
00019: if ($value < 100) {
00020: $lower[] = $value;
prompt> b 19
[Breakpoint #0 added at C:\Users\username\PhpstormProjects\phpdbg\test.php:19]
prompt> r
[Breakpoint #0 at C:\Users\username\PhpstormProjects\phpdbg\test.php:19, hits: 1]
>00019: if ($value < 100) {
00020: $lower[] = $value;
00021: } else {
prompt> c
[Breakpoint #0 at C:\Users\username\PhpstormProjects\phpdbg\test.php:19, hits: 2]
>00019: if ($value < 100) {
00020: $lower[] = $value;
00021: } else {
prompt> w $value
[Set watchpoint on $value]
prompt> w $lower[]
Test script:
---------------
<?php
// Generate some mock data
$example = [1, 23, 23423, 256436, 3463, 4363, 457];
foreach (range(1, 1000) as $val) {
$example[] = mt_rand(1, 10000);
}
// Stuff to debug
function doCoolStuff($value)
{
$value++;
return mt_rand(1, 1000);
}
$lower = [];
foreach ($example as $key => $value) {
if ($value < 100) {
$lower[] = $value;
} else {
doCoolStuff($value);
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73927&edit=1