ID:               41050
 Updated by:       [EMAIL PROTECTED]
 Reported By:      legolas558 at users dot sourceforge dot net
 Status:           Bogus
 Bug Type:         PCRE related
 Operating System: Windows XP SP2
 PHP Version:      4.4.6
 New Comment:

You don't have to apply any patches in order to build PHP with external
PCRE (if you don't like the bundled version).
Use --with-pcre-regex=DIR option to do that.


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

[2007-04-20 10:55:10] legolas558 at users dot sourceforge dot net

G.Baconniere kindly provided a patch to downgrade PHP 4.4.6's internal
PCRE7 to PCRE6.6

http://www.infomaniak.ch/php4/php-4.4.6-downgrade_pcre.patch

I have not tested it, however the author is trusted.

Note: use at your own risk, you will not take advantage of the bugfixes
in PCRE7

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

[2007-04-16 15:34:10] legolas558 at users dot sourceforge dot net

I found a workaround for my own problem, maybe it will help other users
or help individuating the bug.

<?php
// by legolas558

$regex = "(?i:begin|start)\\s+([^']*('[^']*')*)*";

$old_php_regex = "/".$regex."/";

// notice the greedy/ungreedy change which actually works around the
segmentation fault
$bug41050_regex = "/".$regex."?/";

// test case
$subject = "begin\nnon string 'string' other non string";

// will work on any PHP - also the latest versions with PCRE7
preg_match_all($bug41050_regex, $subject, $m);

echo '<pre>';var_dump($m);echo '</pre>'; unset($m);

// will cause a segmentation fault (and so a 500 server error) if used
on PHP versions compiled with PCRE7
// preg_match_all($old_php_regex, $subject, $m);

echo '<pre>';var_dump($m);echo '</pre>';

?>

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

[2007-04-11 14:08:23] legolas558 at users dot sourceforge dot net

Of course.

But did you check if the bug(s) also happens out of PHP? e.g. if it is
ONLY a PCRE bug?

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

[2007-04-11 14:01:59] [EMAIL PROTECTED]

We can't fix PCRE.

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

[2007-04-11 12:00:42] legolas558 at users dot sourceforge dot net

I have tested the subject and regex in a C snippet and the segmentation
fault does not happen

So the bug is someway related to PHP's usage (maybe initialization and
reset?) of the PCRE library

More tests would be needed, of course

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/41050

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

Reply via email to