Page 1 of 1

strange behaviour with cgi-script (runs out fo memory)

Posted: 2008-11-04T16:11:33-07:00
by lepetitalbert
Hi all,

I have a problem that I can't resolve even with my fellow perlmonks.

The post on PM is this one

I wrote a script width some functions that uses PerlMagick and some not. The script works
nice, the problem appears when I start triying to disable the 'Perlmagick functions' of the script if the Image::Magick is not installed.

Test snippets like :

Code: Select all

#!/usr/bin/perl -w

use strict;
use warnings;

eval { require Image::Magick };

my $is_Magick = $@ ? 0 : 1;

print "Content-type: text/html; charset=ISO-8859-1\n\n";

print "<h1>$is_Magick</h1>";
runs out of memory.

from the logs :

Code: Select all

Deep recursion on subroutine "Image::Magick::AUTOLOAD" at Image/Magick.pm line 42.
I dev on an XP, perl 5.10, IM 6.4.4-2-Q16-windows-dll_.exe.

Same effect on a clean debian virtual machine.

If anyone has a clue !?

Thanks.

Have a nice day.

Re: strange behaviour with cgi-script (runs out fo memory)

Posted: 2008-11-04T19:35:44-07:00
by magick
The problem you reported was fixed in ImageMagick 6.4.4-9. Try the current release, 6.4.5-3, and let us know if the problem persists.

Re: strange behaviour with cgi-script (runs out fo memory)

Posted: 2008-11-05T01:03:51-07:00
by lepetitalbert
Hi magick,

just insalled ImageMagick-6.4.5-3-Q16-windows-dll.exe.

test code :

Code: Select all

#!/usr/bin/perl -w

use strict;
use warnings;
use diagnostics;

eval { require Image::Magick };

my $is_Magick = $@ ? 0 : 1;

print "Content-type: text/html; charset=ISO-8859-1\n\n";

print "<h1>$is_Magick</h1>";
works when IM is installed :) else OOM again

Code: Select all

Premature end of script headers: test.pl
Deep recursion on subroutine "Image::Magick::AUTOLOAD" at Image/Magick.pm line\r
\t42 (#1)\r
     (W recursion) This subroutine has called itself (directly or indirectly)\r
     100 times more than it has returned.  This probably indicates an\r
     infinite recursion, unless you're writing strange benchmark programs, in\r
     which case it indicates something else.\r
     \r
Do you need more info ?

Thanks.

Hace a nice day !

Re: strange behaviour with cgi-script (runs out fo memory)

Posted: 2008-11-05T09:02:38-07:00
by magick
We may need help on this one because we're not well versed in Perl XS programming. Anyone have a solution for this problem?

Re: strange behaviour with cgi-script (runs out fo memory)

Posted: 2008-11-06T07:50:24-07:00
by lepetitalbert
hi magick,

relayed to perlmonks.

Have a nice day.