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 PROTECTED]
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
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
n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nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
z
Actual result:
--------------
We cannot get any result.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25798&edit=1