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

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
lepetitalbert

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

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
lepetitalbert

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

Post 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 !
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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?
lepetitalbert

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

Post by lepetitalbert »

hi magick,

relayed to perlmonks.

Have a nice day.
Post Reply