php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57719 Can't handle simultaneous request on Win XP
Submitted: 2007-06-24 22:29 UTC Modified: 2007-08-14 16:43 UTC
From: oliviapurvis at yahoo dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5_2 CVS-2007-06-24 OS: Windows XP Home SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: oliviapurvis at yahoo dot com
New email:
PHP Version: OS:

 

 [2007-06-24 22:29 UTC] oliviapurvis at yahoo dot com
Description:
------------
Imagick works fine under most circumstances. But when I tested it under load, apache produces lots of this error:
Parent: child process exited with status 3221225477 -- Restarting.

I've done some test and it seems that if there are 2 or more simultaneous request to php scripts using Imagick, it will cause the error. I'm running Apache 2.2.3, PHP 5.2.3, Imagick latest beta, and Win XP Home SP2.

Generating a backtrace is beyond me. But I've included some codes here to reproduce it. See below.

Reproduce code:
---------------
Make a php script, im.php:
<?php
$im=new Imagick();
$im->readImage('image.jpg');
header('Content-Type: image/jpeg');
echo $im->getImageBlob();
$im->destroy();
?>

Make an html file, test.htm:
</head><body>
<img src="http://localhost/im.php?1"><img src="http://localhost/im.php?2">
<img src="http://localhost/im.php?3"><img src="http://localhost/im.php?4">
<img src="http://localhost/im.php?5"><img src="http://localhost/im.php?6">
<img src="http://localhost/im.php?7"><img src="http://localhost/im.php?8">
<img src="http://localhost/im.php?9"><img src="http://localhost/im.php?10">
</body></html>

Put the script, html file and an image (any jpg image name image.jpg) into your localhost. Then run test.htm on your localhost, i.e. http://localhost/test.htm. If there is no error on the first run, reload the page a few times. Running on a remote host might not reproduce the error as there could be latency.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-25 20:33 UTC] scottmac@php.net
I've got a backtrace, not had a chance to actually look at what was causing it.

MSVCRT! 77c33509()
MSVCRT! 77c33c1b()
MSVCRT! 77c33c60()
PHP_IMAGICK! FormatMagickStringList line 1074 + 16 bytes
PHP_IMAGICK! FormatMagickString line 1097 + 25 bytes
PHP_IMAGICK! DestroyCacheInfo line 1866
PHP_IMAGICK! GetCacheMethods line 2032 + 6 bytes
PHP_IMAGICK! DestroyImagePixels line 1999 + 3 bytes
PHP_IMAGICK! DestroyImage line 1476
PHP_IMAGICK! SetImageInfo line 3196
PHP_IMAGICK! ReadImage line 339

The above happened with jpeg, interestingly it doesn't happen with png or the png I used wasn't big enough.
 [2007-06-26 03:03 UTC] mkoppanen@php.net
A quick search on the ImageMagick discourse-server gave me this:

http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=8702&hilit=threading
 [2007-06-26 03:54 UTC] oliviapurvis at yahoo dot com
I did some further testing on gif and png images and the error occured on all of them. So it's not limited to jpgs only.

Suprisingly, if I use the MagickWand For PHP extension (http://www.magickwand.org/), there is no such error. The PHP code used is a port from Imagick to MagickWand:

<?php
$mw=NewMagickWand();
MagickReadImage($mw,'image.jpg');
header('Content-Type: image/jpeg');
MagickEchoImageBlob($mw);
?>

So if this is a problem with ImageMagick, how can MagickWand run without threading problem?

Haven't tried it on Unix/Linux OS because I don't have a local Linux machine. So not sure if this is a Windows only bug.
 [2007-06-26 04:08 UTC] mkoppanen@php.net
Does the same error happen with this code:

<?php

$im=new Imagick( 'image.jpg' );
header('Content-Type: image/jpeg');
echo $im;

?>

or with your code if you do not call the ->destroy() method?
 [2007-06-26 21:24 UTC] oliviapurvis at yahoo dot com
Error still occurs using your code or without ->destroy() method. I suspect the problem lies in how Imagick read images. Not really sure.
 [2007-07-24 09:05 UTC] smilingdolphin at gmail dot com
Description:
----------------
When I Compiler Imagick.
Run make command,Generate such as this message.
how solve that.
----------------
Error message:
imagick.c:7227: error: structure has no member named `scale'
make: *** [imagick.lo] Error 1
 [2007-07-24 09:50 UTC] mkoppanen@php.net
dolphin: Please open a proper bug report. State ImageMagick version you're using, PHP version and Operating system.

Do not append your bug report to an existing bug report, especially when the topic is completely different.
 [2007-08-09 06:49 UTC] mkoppanen@php.net
Can you test the next snapshot? (The next build from Aug 09, 2007 08:30 UTC) or any windows build after that. 

Scott committed a patch which should fix this issue.
 [2007-08-14 16:43 UTC] scottmac@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

This is definitely fixed in the latest snapshot.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC