[Mapserver-users] perl/mapscript segfault with CGI
Manfred Meier
m.meier at spiekermann.de
Sat Jun 26 02:24:49 PDT 2004
Hello list,
the following (reduced on minimum) program runs fine. But if I change
the order of the two statements "my $map = new..." and "my $vv = CGI..."
the I get a segfault in the line "$slayer->draw...".
Does someone has an idea if i do something wrong? Or how i can debug to
get more information? I'm using Linux (suse 9) and mapserver 4.0.2.
Thank you
Manfred
#!/usr/bin/perl
use strict;
use CGI qw/:standard/;
use mapscript;
my $map = new mapscript::mapObj ("/usr/local/httpd/cgi-bin/" .
"essen/t1lin.map");
my $vv = CGI::Vars();
my $img = $map->prepareImage ();
my $slayer = $map->getLayerByName("stadtplan_2");
$slayer->draw($map, $img);
$map->drawLabelCache ($img);
my $file = "/tmp/map000";
$img->save ($file);
The MAP-File is like:
#
# Start of map file
#
NAME t1
STATUS ON
SIZE 800 500
EXTENT 2562000 5696000 2579000 5711000
UNITS METERS
TRANSPARENT OFF
SHAPEPATH "/usr/local/MAP-TEST"
LAYER
NAME stadtplan_2
TYPE raster
STATUS default
DATA "stadtplan.tif"
END # LAYER
END # Map File
More information about the MapServer-users
mailing list