Professional Web Applications Themes

#40768 [NEW]: nested foreach break -- infinite loop - serious - PHP Bugs

From: rave235 at gmail dot com Operating system: winxp PHP version: 5.2.1 PHP Bug Type: Scripting Engine problem Bug description: nested foreach break -- infinite loop - serious Description: ------------ i use just build i downloaded from site (5.2.1) no exts, no optimizers. it seem the $a,$b keep same internal pointer, this is quite serious error cos $b=$a should create separate array copy and it does but without the inner pointer. if you replace $b=$a with $b=array(1,2,3); it works as expected this was reported and ignored by someone on solaris before as well-- #40608 Reproduce code: --------------- $a=array(1,2,3); $b=$a; foreach($a ...

  1. #1

    Default #40768 [NEW]: nested foreach break -- infinite loop - serious

    From: rave235 at gmail dot com
    Operating system: winxp
    PHP version: 5.2.1
    PHP Bug Type: Scripting Engine problem
    Bug description: nested foreach break -- infinite loop - serious

    Description:
    ------------
    i use just build i downloaded from site (5.2.1) no exts, no optimizers.
    it seem the $a,$b keep same internal pointer, this is quite serious error
    cos $b=$a should create separate array copy and it does but without the
    inner pointer.
    if you replace $b=$a with $b=array(1,2,3); it works as expected

    this was reported and ignored by someone on solaris before as well--
    #40608


    Reproduce code:
    ---------------
    $a=array(1,2,3);
    $b=$a;

    foreach($a as $A)
    {
    foreach($b as $B)
    {
    echo "$A,$B\n";
    break;
    }
    }

    Expected result:
    ----------------
    1,1
    2,1
    3,1

    Actual result:
    --------------
    1,1
    2,1
    3,1
    2,1
    3,1
    2,1
    3,1
    --infinite-

    --
    Edit bug report at [url]http://bugs.php.net/?id=40768&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40768&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40768&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40768&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40768&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40768&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40768&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40768&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40768&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40768&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40768&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40768&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40768&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40768&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40768&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40768&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40768&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40768&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40768&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40768&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40768&r=mysqlcfg[/url]
    rave235 at gmail dot com Guest

  2. #2

    Default #40768 [Opn]: nested foreach break -- infinite loop - serious

    ID: 40768
    User updated by: abc at def dot ghi
    -Reported By: rave235 at gmail dot com
    +Reported By: abc at def dot ghi
    Status: Open
    Bug Type: Scripting Engine problem
    Operating System: winxp
    PHP Version: 5.2.1
    New Comment:

    wonder if someone can check this on linux build if its win issue.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-09 18:13:08] abc at def dot ghi

    Description:
    ------------
    i use just build i downloaded from site (5.2.1) no exts, no
    optimizers.
    it seem the $a,$b keep same internal pointer, this is quite serious
    error cos $b=$a should create separate array copy and it does but
    without the inner pointer.
    if you replace $b=$a with $b=array(1,2,3); it works as expected

    this was reported and ignored by someone on solaris before as well--
    #40608


    Reproduce code:
    ---------------
    $a=array(1,2,3);
    $b=$a;

    foreach($a as $A)
    {
    foreach($b as $B)
    {
    echo "$A,$B\n";
    break;
    }
    }

    Expected result:
    ----------------
    1,1
    2,1
    3,1

    Actual result:
    --------------
    1,1
    2,1
    3,1
    2,1
    3,1
    2,1
    3,1
    --infinite-


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40768&edit=1[/url]
    abc at def dot ghi Guest

  3. #3

    Default #40768 [Opn->Csd]: nested foreach break -- infinite loop - serious

    ID: 40768
    User updated by: abc at def dot ghi
    Reported By: abc at def dot ghi
    -Status: Open
    +Status: Closed
    Bug Type: Scripting Engine problem
    Operating System: winxp
    PHP Version: 5.2.1
    New Comment:

    me again,
    i just tried latest snapshot and it works fine there so i guess new
    snapshot should be released as i walked around some other strange
    things in that current 5.2.1.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-09 18:20:01] abc at def dot ghi

    wonder if someone can check this on linux build if its win issue.

    ------------------------------------------------------------------------

    [2007-03-09 18:13:08] abc at def dot ghi

    Description:
    ------------
    i use just build i downloaded from site (5.2.1) no exts, no
    optimizers.
    it seem the $a,$b keep same internal pointer, this is quite serious
    error cos $b=$a should create separate array copy and it does but
    without the inner pointer.
    if you replace $b=$a with $b=array(1,2,3); it works as expected

    this was reported and ignored by someone on solaris before as well--
    #40608


    Reproduce code:
    ---------------
    $a=array(1,2,3);
    $b=$a;

    foreach($a as $A)
    {
    foreach($b as $B)
    {
    echo "$A,$B\n";
    break;
    }
    }

    Expected result:
    ----------------
    1,1
    2,1
    3,1

    Actual result:
    --------------
    1,1
    2,1
    3,1
    2,1
    3,1
    2,1
    3,1
    --infinite-


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40768&edit=1[/url]
    abc at def dot ghi Guest

  4. #4

    Default #40768 [Csd]: nested foreach break -- infinite loop - serious

    ID: 40768
    Updated by: net
    Reported By: abc at def dot ghi
    Status: Closed
    Bug Type: Scripting Engine problem
    Operating System: winxp
    PHP Version: 5.2.1
    New Comment:

    Found this bug when looking at issue on PHP bug #40608.

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-09 18:30:56] abc at def dot ghi

    me again,
    i just tried latest snapshot and it works fine there so i guess new
    snapshot should be released as i walked around some other strange things
    in that current 5.2.1.

    ------------------------------------------------------------------------

    [2007-03-09 18:20:01] abc at def dot ghi

    wonder if someone can check this on linux build if its win issue.

    ------------------------------------------------------------------------

    [2007-03-09 18:13:08] abc at def dot ghi

    Description:
    ------------
    i use just build i downloaded from site (5.2.1) no exts, no
    optimizers.
    it seem the $a,$b keep same internal pointer, this is quite serious
    error cos $b=$a should create separate array copy and it does but
    without the inner pointer.
    if you replace $b=$a with $b=array(1,2,3); it works as expected

    this was reported and ignored by someone on solaris before as well--
    #40608


    Reproduce code:
    ---------------
    $a=array(1,2,3);
    $b=$a;

    foreach($a as $A)
    {
    foreach($b as $B)
    {
    echo "$A,$B\n";
    break;
    }
    }

    Expected result:
    ----------------
    1,1
    2,1
    3,1

    Actual result:
    --------------
    1,1
    2,1
    3,1
    2,1
    3,1
    2,1
    3,1
    --infinite-


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=40768&edit=1
    ashnazg@php.net Guest

Similar Threads

  1. Mysql infinite loop?!
    By StockN@gmail.com in forum MySQL
    Replies: 1
    Last Post: May 9th, 11:06 PM
  2. Weird Infinite loop
    By Andrew Milne in forum PHP Development
    Replies: 4
    Last Post: September 29th, 12:43 PM
  3. #25037 [Opn->Asn]: SendText infinite loop
    By iliaa@php.net in forum PHP Development
    Replies: 0
    Last Post: August 11th, 01:58 PM
  4. #25037 [NEW]: SentText infinite loop
    By richard at bradders2000 dot co dot uk in forum PHP Development
    Replies: 0
    Last Post: August 11th, 10:25 AM
  5. How do i stop an infinite loop in MX director?
    By David Downie in forum Macromedia Director Lingo
    Replies: 1
    Last Post: July 27th, 06:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139