Professional Web Applications Themes

#25798 [Com]: forever-running or no-error-abort in preg_match - PHP Development

ID: 25798 Comment by: tor at mail dot matrix dot msu dot edu Reported By: musha dot yoshinori at nifty dot ne dot jp Status: Verified Bug Type: PCRE related Operating System: win32 only PHP Version: 4.3.4RC2-dev New Comment: Confirmed on debian linux with php 4.3.3 Apache/2.0.47 Previous Comments: ------------------------------------------------------------------------ [2003-10-15 01:59:32] [email]sniperphp.net[/email] Reproduced with latest CVS (under Windows XP), PHP as Apache2 module. Works fine with CLI. ------------------------------------------------------------------------ [2003-10-08 14:04:09] musha dot yoshinori at nifty dot ne dot jp Description: ------------ PHP aborts without any message or runs forever in below case. Platform: Windows XP Pro, Apache2.0.46, PHP4.3.3 For ...

  1. #1

    Default #25798 [Com]: forever-running or no-error-abort in preg_match

    ID: 25798
    Comment by: tor at mail dot matrix dot msu dot edu
    Reported By: musha dot yoshinori at nifty dot ne dot jp
    Status: Verified
    Bug Type: PCRE related
    Operating System: win32 only
    PHP Version: 4.3.4RC2-dev
    New Comment:

    Confirmed on debian linux with

    php 4.3.3
    Apache/2.0.47


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

    [2003-10-15 01:59:32] [email]sniperphp.net[/email]

    Reproduced with latest CVS (under Windows XP), PHP as Apache2 module.
    Works fine with CLI.


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

    [2003-10-08 14:04:09] musha dot yoshinori at nifty dot ne dot jp

    Description:
    ------------
    PHP aborts without any message or runs forever in below case.
    Platform: Windows XP Pro, Apache2.0.46, PHP4.3.3

    For example, in preg_match('/a(?:.)+z/',$str,$match), the length of
    string matched between 'a' and 'z' is more than approximately 1KB. It
    always appears. According to the length, PHP aborts without any message
    or runs forever.

    It also appears in preg_match('/a(?>.)+z/',$str,$match), but does not
    appear in preg_match('/a(.)+z/',$str,$match) and
    preg_match('/a.+z/',$str,$match).

    Actually, I want to use
    preg_match_all('/<tr[^>]*>((?>.(?!<\/tr>))+.)<\/tr>/is',$str,$matches)
    and so on.

    Reproduce code:
    ---------------
    $str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nnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z
    EOD;

    preg_match('/a(?:.)+z/s',$str,$match);
    echo $match[0];
    // It cannot reach the 'echo $match[0];'.


    Expected result:
    ----------------
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z


    Actual result:
    --------------
    We cannot get any result.


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=25798&edit=1[/url]
    tor at mail dot matrix dot msu dot edu Guest

  2. #2

    Default #25798 [Com]: forever-running or no-error-abort in preg_match

    ID: 25798
    Comment by: roland at astrofoto dot org
    Reported By: musha dot yoshinori at nifty dot ne dot jp
    Status: Verified
    Bug Type: PCRE related
    Operating System: win32 only
    PHP Version: 4.3.4RC2-dev
    New Comment:

    I have run into what I think is the same bug in 4.3.3 under SunOS 5.7
    with apache 2.0.47 all compiled with gcc

    331 rroberts> gcc --version
    gcc_bin (GCC) 3.2-gnupro-03r1
    Copyright (C) 2002 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is
    NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.

    The particular problem shows up when attempting to use
    class.rFastTemplate.php which has a preg_match looking for unmatched
    template variables. The script *always* times out and the reported
    error is always on preg_match.

    The difference is that the preg_match is merely long-running, not
    forever running. However with PHP 4.3.1 on RedHat 8.0, I do not see
    this behavior. I can put together a test case, but I didn't see the
    point other than pointing out that it does *not* appear to be Win32
    only.


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

    [2003-10-15 01:59:32] [email]sniperphp.net[/email]

    Reproduced with latest CVS (under Windows XP), PHP as Apache2 module.
    Works fine with CLI.


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

    [2003-10-08 14:04:09] musha dot yoshinori at nifty dot ne dot jp

    Description:
    ------------
    PHP aborts without any message or runs forever in below case.
    Platform: Windows XP Pro, Apache2.0.46, PHP4.3.3

    For example, in preg_match('/a(?:.)+z/',$str,$match), the length of
    string matched between 'a' and 'z' is more than approximately 1KB. It
    always appears. According to the length, PHP aborts without any message
    or runs forever.

    It also appears in preg_match('/a(?>.)+z/',$str,$match), but does not
    appear in preg_match('/a(.)+z/',$str,$match) and
    preg_match('/a.+z/',$str,$match).

    Actually, I want to use
    preg_match_all('/<tr[^>]*>((?>.(?!<\/tr>))+.)<\/tr>/is',$str,$matches)
    and so on.

    Reproduce code:
    ---------------
    $str =<<<EOD
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z
    EOD;

    preg_match('/a(?:.)+z/s',$str,$match);
    echo $match[0];
    // It cannot reach the 'echo $match[0];'.


    Expected result:
    ----------------
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z


    Actual result:
    --------------
    We cannot get any result.


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=25798&edit=1[/url]
    roland at astrofoto dot org Guest

  3. #3

    Default #25798 [Com]: forever-running or no-error-abort in preg_match

    ID: 25798
    Comment by: drb at msu dot edu
    Reported By: musha dot yoshinori at nifty dot ne dot jp
    Status: Verified
    Bug Type: PCRE related
    Operating System: win32 only
    PHP Version: 4.3.4RC2-dev
    New Comment:

    Using the supplied test case, on Debian-testing, php 4.3.3 built by
    hand from source using the following configuration:

    ../configure --with-regex=php --with-config-file-path=/etc/php4/apache
    --disable-rpath --disable-debug --enable-memory-limit --with-layout=GNU
    --enable-calendar --enable-sysvsem --enable-sysvshm --enable-track-vars
    --enable-trans-sid --enable-bcmath --enable-ctype --with-iconv
    --enable-exif --enable-filepro --enable-ftp --with-gettext
    --enable-mbstring --with-pcre-regex=/usr --enable-shmop
    --enable-sockets --enable-wddx --enable-xml --enable-xslt
    --with-xslt-sablot --no-create --no-recursion

    Here's a traceback:

    dev1 233 # gdb /usr/sbin/apache2
    GNU gdb 5.3-debian
    Copyright 2002 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and
    you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for
    details.
    This GDB was configured as "i386-linux"...(no debugging symbols
    found)...
    (gdb) run -X
    Starting program: /usr/sbin/apache2 -X
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...[New
    Thread 16384 (LWP 8539)]

    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    [Thu Nov 13 16:03:30 2003] [warn] module php4_module is already loaded,
    skipping
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 16384 (LWP 8539)]
    php_pcre_match (ht=1, return_value=0x81cd6c4, this_ptr=0x0,
    return_value_used=0, tsrm_ls=0x8140618, global=0)
    at /root/src/php-4.3.3/ext/pcre/php_pcre.c:443
    443 subpat_names[name_idx] =
    name_table + 2;
    (gdb) where
    #0 php_pcre_match (ht=1, return_value=0x81cd6c4, this_ptr=0x0,
    return_value_used=0, tsrm_ls=0x8140618, global=0)
    at /root/src/php-4.3.3/ext/pcre/php_pcre.c:443
    #1 0x405baae3 in zif_preg_match (ht=60170, return_value=0xeb0a,
    this_ptr=0xeb0a, return_value_used=60170, tsrm_ls=0xeb0a)
    at /root/src/php-4.3.3/ext/pcre/php_pcre.c:600
    #2 0x406982ef in execute (op_array=0x81c86dc, tsrm_ls=0x8140618)
    at /root/src/php-4.3.3/Zend/zend_execute.c:1616
    #3 0x406888ed in zend_execute_scripts (type=8, tsrm_ls=0x8140618,
    retval=0x0,
    file_count=3) at /root/src/php-4.3.3/Zend/zend.c:885
    #4 0x40656e36 in php_execute_script (primary_file=0xbffff510,
    tsrm_ls=0x8140618) at /root/src/php-4.3.3/main/main.c:1723
    #5 0x4069da9f in php_handler (r=0x81baaf8)
    at /root/src/php-4.3.3/sapi/apache2handler/sapi_apache2.c:534
    #6 0x08073b0a in ap_run_handler ()
    #7 0x0807401e in ap_invoke_handler ()
    #8 0x0806767f in ap_process_request ()
    #9 0x080638ed in _start ()
    #10 0x0807c8a6 in ap_run_process_connection ()
    #11 0x080726db in ap_graceful_stop_signalled ()
    #12 0x08072882 in ap_graceful_stop_signalled ()
    #13 0x080728db in ap_graceful_stop_signalled ()
    #14 0x08072fc1 in ap_mpm_run ()
    #15 0x08077d06 in main ()
    #16 0x4032ddb6 in __libc_start_main () from /lib/libc.so.6


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

    [2003-11-06 16:40:37] roland at astrofoto dot org

    I have run into what I think is the same bug in 4.3.3 under SunOS 5.7
    with apache 2.0.47 all compiled with gcc

    331 rroberts> gcc --version
    gcc_bin (GCC) 3.2-gnupro-03r1
    Copyright (C) 2002 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is
    NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.

    The particular problem shows up when attempting to use
    class.rFastTemplate.php which has a preg_match looking for unmatched
    template variables. The script *always* times out and the reported
    error is always on preg_match.

    The difference is that the preg_match is merely long-running, not
    forever running. However with PHP 4.3.1 on RedHat 8.0, I do not see
    this behavior. I can put together a test case, but I didn't see the
    point other than pointing out that it does *not* appear to be Win32
    only.

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

    [2003-10-15 01:59:32] [email]sniperphp.net[/email]

    Reproduced with latest CVS (under Windows XP), PHP as Apache2 module.
    Works fine with CLI.


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

    [2003-10-08 14:04:09] musha dot yoshinori at nifty dot ne dot jp

    Description:
    ------------
    PHP aborts without any message or runs forever in below case.
    Platform: Windows XP Pro, Apache2.0.46, PHP4.3.3

    For example, in preg_match('/a(?:.)+z/',$str,$match), the length of
    string matched between 'a' and 'z' is more than approximately 1KB. It
    always appears. According to the length, PHP aborts without any message
    or runs forever.

    It also appears in preg_match('/a(?>.)+z/',$str,$match), but does not
    appear in preg_match('/a(.)+z/',$str,$match) and
    preg_match('/a.+z/',$str,$match).

    Actually, I want to use
    preg_match_all('/<tr[^>]*>((?>.(?!<\/tr>))+.)<\/tr>/is',$str,$matches)
    and so on.

    Reproduce code:
    ---------------
    $str =<<<EOD
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z
    EOD;

    preg_match('/a(?:.)+z/s',$str,$match);
    echo $match[0];
    // It cannot reach the 'echo $match[0];'.


    Expected result:
    ----------------
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z


    Actual result:
    --------------
    We cannot get any result.


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=25798&edit=1[/url]
    drb at msu dot edu Guest

  4. #4

    Default #25798 [Com]: forever-running or no-error-abort in preg_match

    ID: 25798
    Comment by: indy at indeyets dot pp dot ru
    Reported By: musha dot yoshinori at nifty dot ne dot jp
    Status: Bogus
    Bug Type: PCRE related
    Operating System: Windows XP
    PHP Version: 4.3.5RC2-dev
    New Comment:

    however, it works just fine on Apache-1 systems


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

    [2004-01-20 03:50:57] net

    It's a PCRE limitation, NOT any bug in PHP..


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

    [2004-01-19 23:51:12] musha dot yoshinori at nifty dot ne dot jp

    I have tried to check the latest version, 4.3.5RC2-dev,
    http://snaps.php.net/win32/php4-win32-STABLE-latest.zip.
    I'm sorry that it doesn't work well. The result doesn't change from
    previous versions.

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

    [2004-01-18 23:01:08] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php4-STABLE-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



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

    [2003-10-15 01:59:32] net

    Reproduced with latest CVS (under Windows XP), PHP as Apache2 module.
    Works fine with CLI.


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

    [2003-10-08 14:04:09] musha dot yoshinori at nifty dot ne dot jp

    Description:
    ------------
    PHP aborts without any message or runs forever in below case.
    Platform: Windows XP Pro, Apache2.0.46, PHP4.3.3

    For example, in preg_match('/a(?:.)+z/',$str,$match), the length of
    string matched between 'a' and 'z' is more than approximately 1KB. It
    always appears. According to the length, PHP aborts without any message
    or runs forever.

    It also appears in preg_match('/a(?>.)+z/',$str,$match), but does not
    appear in preg_match('/a(.)+z/',$str,$match) and
    preg_match('/a.+z/',$str,$match).

    Actually, I want to use
    preg_match_all('/<tr[^>]*>((?>.(?!<\/tr>))+.)<\/tr>/is',$str,$matches)
    and so on.

    Reproduce code:
    ---------------
    $str =<<<EOD
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
    z
    EOD;

    preg_match('/a(?:.)+z/s',$str,$match);
    echo $match[0];
    // It cannot reach the 'echo $match[0];'.


    Expected result:
    ----------------
    a
    nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnn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nnnnnnnnnnnnnnnnnn
    z


    Actual result:
    --------------
    We cannot get any result.


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


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

Similar Threads

  1. #25798 [Ver]: forever-running or no-error-abort in preg_match
    By musha dot yoshinori at nifty dot ne dot jp in forum PHP Development
    Replies: 1
    Last Post: October 16th, 09:47 AM
  2. #25798 [Fbk->Ver]: forever-running or no-error-abort in preg_match
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: October 15th, 05:59 AM
  3. #25798 [Opn->Fbk]: forever-running or no-error-abort in preg_match
    By iliaa@php.net in forum PHP Development
    Replies: 2
    Last Post: October 15th, 05:52 AM
  4. #25798 [NoF->Opn]: forever-running or no-error-abort in preg_match
    By musha dot yoshinori at nifty dot ne dot jp in forum PHP Development
    Replies: 0
    Last Post: October 15th, 02:46 AM

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