ID:               36267
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mikeb at tracersinfo dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         PCRE related
 Operating System: Linux
 PHP Version:      5.1.2
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

This is all I can get with valgrind and I can't reproduce the segfault
without it.

==3882== Process terminating with default action of signal 11
(SIGSEGV)
==3882==  Access not within mapped region at address 0xBE7FFF24
==3882==    at 0x806D2FD: match (pcre_exec.c:517)
==3882== Stack overflow in thread 1: can't grow stack to 0xBE7FFEAC


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

[2006-02-02 21:15:49] [EMAIL PROTECTED]

the url you refer above doesn't work (error 403). please change the
permissions.

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

[2006-02-02 21:06:42] mikeb at tracersinfo dot com

Description:
------------
I use PCRE's every day to harvest information from webpages (i.e., not
a newbie, and I use many very complex expressions regularly).

I recently ran into a problem with an expression I needed to use
(essentially, to select a particular <table>, its contents, and
everything that follows it on page full of tables -- specifically
without allowing an intervening <table> or </table> tag) that worked
perfectly throughout my development under Windows XP Home SP2.  As soon
as I ported the script to GNU/Linux (3 different machines:  Mandrake 10
[2.6.8 kernel]; 2 Ubuntu 5.10 [2.6.12 kernel]), it segfaults both under
the CLI and Apache (1.3.33) SAPI.  (The use of once-only subpattern is
not significant -- same result is obtained using merely non-matching
subpattern.)

I've simplified the referenced script to what it takes to reproduce the
problem, and I note that significant reduction in size of the two <tag>
sections can allow this to function properly under Linux, but I do not
have that luxury with arbitrary incoming webpages that must be parsed
without advance knowledge of their contents.

The same symptom obtains if I attempt to use preg_match instead of
preg_replace.

One of the failing PHP's config lines:  --disable-cgi
--with-apxs=/www/bin/apxs --enable-magic-quotes --with-openssl
--with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl
--with-curlwrappers --enable-ftp --with-gd --with-mysql --with-mysqli
--with-pdo-mysql --with-readline --enable-soap --enable-sockets
--with-xsl

Fails with stock php.ini-dist.


Reproduce code:
---------------
http://home.tampabay.rr.com/greenorb/testpregfault2.txt


Expected result:
----------------
I expect to see the first <tag> tag echoed to my screen with a legend
that "Stripfootpat worked".  (Note that this IS the result obtained
under Win32 [Windows XP Pro/Home SP2].)


Actual result:
--------------
Segmentation fault



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


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

Reply via email to