Fatal error: Possible integer overflow in memory allocation

This is a discussion on Fatal error: Possible integer overflow in memory allocation within the PHP Language forums, part of the PHP Programming Forums category; G'day, Got a bizzare issue with PHP 5.0.2/Apache constantly generating variations of the following error: "...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2006
chris.mcinnes@gmail.com
 
Posts: n/a
Default Fatal error: Possible integer overflow in memory allocation

G'day,

Got a bizzare issue with PHP 5.0.2/Apache constantly generating
variations of the following error:

"Fatal error: Possible integer overflow in memory allocation"

At first I traced it through to any line using the $_SERVER[] command
and so replaced it with $HTTP_SERVER_VARS[].

This worked fine, however now I seem to get the issue whenever I use a
"preg_match" command.

Is there some greater global variable/configuration item that I need to
sort out to stop this from happening or is it something else?

For example, trying to implement a VERY basic PHP image gallery script,
the following function errors on the "if (preg_match" line - as have
several other scripts.

function GetFileList($dirname="."){
global $config;
$list = array();

if ($handle = opendir($dirname)) {
while (false !== ($file = readdir($handle))) {
if (preg_match("/\.(jpeg|gif|png)$/i",$file)) {
$list[] = $file;
}
}
closedir($handle);
}
sort($list);

return $list;
}#-#GetFileList()

Any help would be GREATLY appreciated!

Thanks in advance

Chris

Reply With Quote
  #2 (permalink)  
Old 04-19-2006
Carl Vondrick
 
Posts: n/a
Default Re: Fatal error: Possible integer overflow in memory allocation

chris.mcinnes@gmail.com wrote:
> Any help would be GREATLY appreciated!

How much memory are you allocating to PHP? I use 8MB in production and 16MB
in development.

You may have faulty memory -- run a memory test at memtest.org


--
Carl Vondrick
Web-Enginner
www.CarlSoft.net
To contact me, please use my website.
Reply With Quote
  #3 (permalink)  
Old 04-20-2006
chris.mcinnes@gmail.com
 
Posts: n/a
Default Re: Fatal error: Possible integer overflow in memory allocation

Carl,

Good call on the memory. I have no idea how much is allocated - how to
I look that up and/or change the allocation?

cheers

chris

Reply With Quote
  #4 (permalink)  
Old 04-20-2006
fletch
 
Posts: n/a
Default Re: Fatal error: Possible integer overflow in memory allocation

Limits are set in php.ini on how much memory a script may use before
php kills it

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0