Bug #18399 Updated: eregi function causes apache to crash that page

From: Date: Thu, 18 Jul 2002 00:24:05 +0000
Subject: Bug #18399 Updated: eregi function causes apache to crash that page
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14478@lists.php.net to get a copy of this message
ID: 18399 Updated by: peter@600ml.com.au Reported By: peter@600ml.com.au -Status: Feedback +Status: Open Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.2.1 New Comment: php configuration: -------------------------------------- './configure' '--with-apxs=../../psa/apache/bin/apxs' '--prefix=../../psa/apache' '--with-system-regex' '--with-config-file-path=/usr/local/psa/apache/conf' '--disable-debug' '--disable-pear' '--enable-sockets' '--enable-track-vars' '--without-gd' '--with-mysql=../../psa/mysql' '--with-iodbc=../odbcsdk' '--with-imap=../imap-2001a' '--with-pgsql=/usr/local/pgsql' -------------------------------------- here is a script that will crash the page: <?php function detect_browser() { if(eregi("(opera) ([0-9]{1,2}.[0-9]{1,3}){0,1}",$_SERVER['HTTP_USER_AGENT'],$match) || eregi("(opera/)([0-9]{1,2}.[0-9]{1,3}){0,1}",$_SERVER['HTTP_USER_AGENT'],$match)){ $BName = "Opera"; $BVersion=$match[2]; }else{ $BName = "nothing"; } return $BName; } $browser = detect_browser(); print $browser; ?> you can see it in action here: http://www.600ml.com.au/test2.php Previous Comments: ------------------------------------------------------------------------ [2002-07-17 19:59:38] sniper@php.net And how was PHP configured? (you can find the configure line in phpinfo() output) ------------------------------------------------------------------------ [2002-07-17 19:58:57] sniper@php.net Can you please give us a short but complete example script which we can use to reproduce this? ------------------------------------------------------------------------ [2002-07-17 19:27:30] peter@600ml.com.au what you did: ran a php script on a apache/linux server that ran a million times before perfectly well on the same set-up with a lower version of php what you expected to happen: the script to run present me with a page what happened: the below browsers spat out the errors as described below i narrowd down the code and noticed that the apache error message and the resulting "no data" pages occured only if the "eregi" function was present in the script ------------------------------------------------------------------------ [2002-07-17 18:52:06] sniper@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ [2002-07-17 18:48:49] peter@600ml.com.au Use the eregi function on any php page running apache on linux and php version 4.21. Sorry I cant be more specific about the set-up. My knowledge of linux is limited and I didnt set-up the machine. It does run "Plesk" which is a gui server adminstration thingy. Apache will spit out the following error: "FATAL: emalloc(): Unable to allocate -193592 bytes" The page returned will contain no data. Internet explorer 6 will say "Page cannot be displayed". Netscape 4.* will say "page contains no data". Netscape 6 will do nothing. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18399&edit=1

« previous php.bugs (#14478) next »