Bug #72680 [NEW]: Variable $i conflict in .gdbinit

From: Date: Tue, 26 Jul 2016 15:05:54 +0000
Subject: Bug #72680 [NEW]: Variable $i conflict in .gdbinit
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202611@lists.php.net to get a copy of this message
From: th3s3v3n dot shell at gmail dot com Operating system: Ubuntu 14.04 PHP version: 5.6.24 Package: *General Issues Bug Type: Bug Bug description:Variable $i conflict in .gdbinit Description: ------------ In the gdb script .gdbinit , the life cycle of a variable is the whole calling procedure as soon as it is declared, instead of the block of function where it is declared in . in the print_cvs , variable $i is used to count the offset of the CVs. (If you want to use print_cvs , maybe you must use the EX_CV_NUM() macro to fix the bug 70008 [ https://bugs.php.net/bug.php?id=70008 ] ) Then it call printzv. But in the function printzv , when the zvalue's type is 4 (array) or 5 (object) , the function ____printzv_contents will execute code: while $i > 0 printf " " set $i = $i - 1 end $i will become 0. So the loop in the print_cvs will be endless. Test script: --------------- aa.php <?php $a = 'vdf'; $b = array(1); $c = array(2); sleep(1); # gdb php (gdb) b sleep (gdb) b sleep (gdb) source .gdbinit (gdb) r aa.php (gdb) print_cvs Expected result: ---------------- Compiled variables count: 3 0 = a [0xf7bfd5d4] (refcount=1) string(3): "vdf" 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 } 2 = c [0xf7bfe79c] (refcount=1) array(1): { 0 => [0xf7bfe72c] (refcount=1) long: 2 } Actual result: -------------- in the 5.6.24: (gdb) print_cvs Compiled variables count: 3 0 = a [0xf7bfd5d4] (refcount=1) string(3): "vdf" 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 }0 1 = b [0xf7bfd59c] (refcount=1) array(1): { ---Type <return> to continue, or q <return> to quit--- in the old version (for example 5.4.34): Compiled variables count: 3 0 = a [0xf7bfd5d4] (refcount=1) string(3): "vdf" 1 = b [0xf7bfd59c] (refcount=1) array(1): { 0 => [0xf7bfd5b8] (refcount=1) long: 1 } 1 = b Structure has no component named operator!=. -- Edit bug report at https://bugs.php.net/bug.php?id=72680&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72680&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72680&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72680&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72680&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72680&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72680&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72680&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72680&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72680&r=support Expected behavior: https://bugs.php.net/fix.php?id=72680&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72680&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72680&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72680&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72680&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72680&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72680&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72680&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72680&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72680&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72680&r=mysqlcfg

« previous php.bugs (#202611) next »