[mapserver-users] bug with mapscript and MS_ERRORFILE?

Alex Rice alex_rice at arc.to
Tue Aug 20 22:18:18 EDT 2002


I have been absolutely nuts for a little bit here... I think I 
may have found a really bizarre mapscript bug. Using Perl 
mapscript 3.6.1, unmodified, the following test script goes into 
an infinite loop and fills mapserver.log with 
"msAddImageSymbol(): Unable to access file.".

If I do any of the following 3 things, the script executes fine 
and no infinite loop occurs.

1) comment out the line $ENV{MS_ERRORFILE} = "...";
2) remove the mapserver.log file.
3) remove write permissions on the mapserver.log  file.

-- test script --

#!/usr/bin/perl
$ENV{MS_ERRORFILE} = "/var/log/mapserver.log";
use mapscript;
my $mapObj = new mapObj('aps.map') or die("Unable to open mapfile");
my $filename = $mapObj->{web}->{imagepath} . $$. '.png';
my $imgObj = $mapObj->draw; # <------------------------- goes 
into infinite loop here
$res = $imgObj->saveImage($filename,
			  $mapscript::MS_PNG, # image type
			  $mapscript::MS_TRUE, # transparency
			  $mapscript::MS_TRUE, # interlace
			  -1); # quality % (applicable to jpg only)
die "saveImage() returned '$res'";

--end test script--

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice at arc.to
alrice at swcp.com





More information about the mapserver-users mailing list