Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005354 [Quercus] minor always 01-31-13 06:12 01-31-13 12:11
Reporter cowan View Status public  
Assigned To nam
Priority normal Resolution fixed  
Status closed   Product Version 4.0.34
Summary 0005354: OutOfMemory with UserCake Captcha
Description The following code, from the UserCake project, causes:

"WarningService: Shutdown: TcpSocketLink OutOfMemory"

Something throws an OutOfMemoryException due to out of heap memory. It happens consistently on Resin Pro 4.0.34.

I'm not positive it's a Quercus bug, but this code looks fairly insignificant, so I suspect there is some issue in Quercus that causes the problem not the UserCake code.

/*
UserCake Version: 2.0.1
http://usercake.com [^]
*/
session_start();
$md5_hash = md5(rand(0,99999));
$security_code = substr($md5_hash, 25, 5);
$enc = md5($security_code);
$_SESSION['captcha'] = $enc;

$width = 150;
$height = 30;

$image = ImageCreate($width, $height);
$white = ImageColorAllocate($image, 255, 255, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$grey = ImageColorAllocate($image, 200, 200, 200);

ImageFill($image, 0, 0, $white);
ImageString($image, 10, 5, 0, $security_code, $black);

header("Content-Type: image/png");
ImagePng($image);
ImageDestroy($image);
ImageDestroy($image);

?>


Additional Information
Attached Files

- Relationships

- Notes
(0006171)
cowan
01-31-13 06:14
edited on: 01-31-13 06:14

The code is models/captcha.php, which is used by registration.php to produce a captcha image.

 
(0006173)
nam
01-31-13 12:11

php/1p1j

Fixed for 4.0.35. Quercus wasn't properly handling fills where the start pixel's color is the same as the filling color (in effect doing nothing).

FYI, the first call to ImageColorAllocate() auto-fills the image with $white. So the call to imagefill() is redundant.
 

- Issue History
Date Modified Username Field Change
01-31-13 06:12 cowan New Issue
01-31-13 06:14 cowan Note Added: 0006171
01-31-13 06:14 cowan Note Edited: 0006171
01-31-13 12:08 nam Status new => assigned
01-31-13 12:08 nam Assigned To  => nam
01-31-13 12:11 nam Status assigned => closed
01-31-13 12:11 nam Note Added: 0006173
01-31-13 12:11 nam Resolution open => fixed
01-31-13 12:11 nam Fixed in Version  => 4.0.35


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker