Bug #18528 Updated: Php crashes upon using eregi_replace

From: Date: Wed, 24 Jul 2002 08:49:58 +0000
Subject: Bug #18528 Updated: Php crashes upon using eregi_replace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15016@lists.php.net to get a copy of this message
ID: 18528 Updated by: derick@php.net Reported By: flash@daaw.org -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Redhat linux 7.1 (kernel 2.4.18) PHP Version: 4.2.2 New Comment: I think you mean "I used the same configure OPTIONS" as in PHP 4.2.1. Please try to rebuild the configure script like I asked. Derick Previous Comments: ------------------------------------------------------------------------ [2002-07-24 04:36:54] flash@daaw.org I used the same configure script as with version 4.2.1 and I just now went back again to 4.2.1 and the problem is gone again. here are my configure options: ./configure --with-apxs=/usr/local/apache/bin/apxs \ --with-config-file-path=/usr/local/apache/conf \ --with-mysql=/usr/local \ --with-gd \ --with-system-regex I will retry in a minute with the options as you said. ------------------------------------------------------------------------ [2002-07-24 04:32:23] derick@php.net That doesn't make much sense, as 4.2.2 is exactly the same as 4.2.1 + the security fix and a new configure script. I suspect the problem lies in the configure script used. If you have autoconf 2.52 isntalled (check with autoconf --version) then you can try this: cd php-4.2.2 rm configure ./cvsclean ./buildconf ./configure --your options make If this doesn't solve it, you can try try to add --with-regex=system to your configure options. Derick ------------------------------------------------------------------------ [2002-07-24 04:26:20] flash@daaw.org I just updated to php 4.2.2 from 4.2.1 and I didnt have the problem in 4.2.1 so it has to have something to do with 4.2.2 since I used thesame configure commands. ------------------------------------------------------------------------ [2002-07-24 04:16:48] msopacua@idg.nl strike that please - that's the unescaped pipe ('or') I used. ------------------------------------------------------------------------ [2002-07-24 04:10:41] msopacua@idg.nl Derick: I don't think it's an actual crash :-) He just runs outof memory, not realizing that the meta-character "&" is 'the match' - but the bug is in PHP, as it is resolving the & character in the result of the operation! So it seems a recursion eval in ereg functions. Example: ?php $text="bla&|&bla2"; $a = eregi_replace("&|&", ":", $text); $b = str_replace("&|&", ":", $text); $c = eregi_replace("\\\&|\\\&", ":", $text); echo "$a\n$b\n$c"; ?> Output: $ php -f ./tmp.php bla:|:bla2 bla:bla2 bla&|&bla2 ------------------------------------------------------------------------ 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/18528 -- Edit this bug report at http://bugs.php.net/?id=18528&edit=1

« previous php.bugs (#15016) next »