Bug #18528 Updated: Php crashes upon using eregi_replace

From: Date: Wed, 24 Jul 2002 08:03:19 +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-15003@lists.php.net to get a copy of this message
ID: 18528 Updated by: flash@daaw.org Reported By: flash@daaw.org -Status: Feedback +Status: Open Bug Type: Reproducible crash Operating System: Redhat linux 7.1 (kernel 2.4.18) PHP Version: 4.2.2 New Comment: Backtrace (I dont see errors) [root@lhurgoyf bin]# gdb ./httpd GNU gdb Red Hat Linux (5.1-0.71) Copyright 2001 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-redhat-linux"... (gdb) run -X Starting program: /usr/local/apache/bin/./httpd -X Program exited with code 01. (gdb) bt No stack. (gdb) Previous Comments: ------------------------------------------------------------------------ [2002-07-24 03:50:38] derick@php.net Please make a backtrace as asked in an earlier reply. The location with info on how to do this is: http://bugs.php.net/bugs-generating-backtrace.php Derick ------------------------------------------------------------------------ [2002-07-24 03:48:51] flash@daaw.org the apache error log shows: FATAL: emalloc(): Unable to allocate -133048 bytes one time each time you refresh the script. so it has something to do with the crashing. ------------------------------------------------------------------------ [2002-07-24 03:45:25] flash@daaw.org forgot! im using apache 1.3.26 with php compiled as DSO. ------------------------------------------------------------------------ [2002-07-24 03:44:52] derick@php.net 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 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. ------------------------------------------------------------------------ [2002-07-24 03:44:03] flash@daaw.org Below you see a snippet of a very basic news script that retrieves news items from a file that is build up like this: <id>:<user>:<date>:<topic>:<bigtext> below is the script that crashes on eregi_replace, as soon as I comment out the eregi_replace line and change $text1 to $text in the line above, the script works. --snip-- $n = getdata("$news"); $var1 = 0; foreach ($n as $a) { $var1++; if ($var1 < 10) { $topic = $a['4']; $date = $a['3']; $user = $a['2']; $text1 = $a['5']; $text = eregi_replace("&;&", ":", $text1); echo "<TABLE bgColor=\"#ffffff\" border=0 cellPadding=0 cellSpacing=0 width=\"100%\"><TR><TD> <TABLE bgColor=\"#cccccc\" border=0 cellPadding=1 cellSpacing=0 width=\"100%\"><TR><TD> <TABLE bgColor=\"#eeeeee\" border=0 cellPadding=3 cellSpacing=0 width=\"100%\"><TR> <TD align=center><FONT class=option color=\"#363636\"> <B> $topic.</B></FONT> By $user - $date</TD></TR> </TABLE></TD></TR></TABLE>$text </TD></TR></TABLE> <br><center><a href=\"#top\">Back to top</a> --snip-- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18528&edit=1

« previous php.bugs (#15003) next »