[mapserver-users] Re: Perl/mapscript error
Puneet Kishor
pkishor at GeoAnalytics.com
Sat Apr 27 18:45:34 PDT 2002
ok... I have spent a good part of today battling this, and have
discovered the following...
one of the reasons I am getting these errors because I have -w switch on
my shebang line. After much finagling, I can get the image to draw, but
with the -w switch I get the following error as well --
(in cleanup) Not a HASH reference at /Library/Perl/darwin/mapscript.pm
line 1468.
that line in mapscript.pm is the one that is trying to clean up... and
failing. Specifically,
sub DESTROY {
my $self = tied(%{$_[0]});
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
mapscriptc::delete_mapObj($self);
delete $OWNER{$self};
}
}
perhaps Lowell or Steves (L* and W*) shed some light on this.
Many thanks,
pk/
On Saturday, April 27, 2002, at 01:58 PM, Puneet Kishor wrote:
> even more...
>
> I figured that "bus error" is occurring because Perl is trying to clean
> up something that doesn't exist. This is (confirmed) by the following
> message I get...
>
> (in cleanup) Uncaught exception from user code:
> Not a HASH reference at /Library/Perl/darwin/mapscript.pm line
> 1468.
> mapObj::DESTROY('mapObj=SCALAR(0x6530)') called at ./index.pl
> line 0
> eval {...} called at ./index.pl line 0
>
> any ideas anyone?
>
> pk/
>
>
> On Saturday, April 27, 2002, at 11:37 AM, Puneet Kishor wrote:
>
>> further on this... I simplified it even more and ran it from the
>> command line... now the test image is created, but with 0 bytes. I get
>> the following
>>
>> % perl index.pl
>> Bus error
>>
>>
>>
>>
>> what's going on?
>>
>> tia.
>>
>> pk
>>
>>
>> On Saturday, April 27, 2002, at 10:52 AM, Puneet Kishor wrote:
>>
>>> I rebuilt Mapserver and mapsript. The stock examples (shpinfo.pl and
>>> dump.pl) work fine. But then...
>>>
>>> I am trying out the simplest of code (after sdl's mapquakes.pl)...
>>>
>>> 1: my $rootdir = "/Users/pkishor/Sites/ms";
>>> 2: my $imgdir = "/$rootdir/tmp/";
>>> 3: my $imgurl = "/~pkishor/ms/tmp/";
>>> 4: my $map = "/$rootdir/map/my.map";
>>> 5: my $imgid = $$ . time() . ".png";
>>> 6: my $mapobj = new mapObj("$map");
>>> 7: my $img = $mapobj->prepareImage();
>>> 8: mapscript::msSaveImage($img,
>>> $imgdir . $imgid,
>>> $mapobj->{imagetype},
>>> $mapobj->{transparent},
>>> $mapobj->{interlace},
>>> $mapobj->{imagequality});
>>>
>>> I get the following error... obviously prepareImage is failing
>>> because $mapobj can't be created on line 6 to begin with. What is
>>> causing the following "Uncaught exception..."
>>>
>>>
>>>
>>> [Sat Apr 27 10:18:27 2002] [error] Uncaught exception from user code:
>>> Can't call method "prepareImage" on an undefined value at
>>> /Users/pkishor/Sites/palatine/perl/index.pl line 16.
>>> Apache::ROOT::_7epkishor::palatine::perl::index_2epl::handler('Apache=
>>> SCALAR(
>>> 0xcccd0)') called at /System/Library/Perl/darwin/Apache/Registry.pm
>>> line 143
>>> eval {...} called at
>>> /System/Library/Perl/darwin/Apache/Registry.pm line 143
>>> Apache::Registry::handler('Apache=SCALAR(0xcccd0)') called at
>>> /dev/null line 0
>>> eval {...} called at /dev/null line 0
>>>
>>> [Sat Apr 27 10:34:49 2002] [error] Can't call method "prepareImage"
>>> on an undefined value at /Users/pkishor/Sites/palatine/perl/index.pl
>>> line 16.
>>>
>>
>
More information about the MapServer-users
mailing list