Bus error -- Re: [mapserver-users] Re: Perl/mapscript error

Lowell Filak lfilak at medinaco.org
Mon Apr 29 12:43:36 PDT 2002


Any gurus feel free to step forward, in the mean-time I have a couple of questions:
Puneet - is "(in cleanup) Not a HASH reference at /Library/Perl/darwin/mapscript.pm ine 1468." the ONLY error message in your log? Are there ANY other messages in the log around the same time (within a second or so)?
Giorgio - which DESTROY subroutine did you insert your print statement into, mapObj, layerObj, classObj, ...? It looks like layerObj as opposed to mapObj where Puneet is having trouble.
Lowell F.

The following message was sent by Puneet Kishor <pkishor at GeoAnalytics.com> on Sun, 28 Apr 2002 10:29:51 -0500.

> thanks for analysis Giorgio... I will try out some of your shenanigans 
> detailed here...
> 
> since it has not been reported exhaustively, I guess there is something 
> about our implementation that is bringing this out. My guess is so... if 
> there is an error in the Perl script (because of our own programming 
> mistake), the script goes kablooie and the map object vanishes without a 
> warning. However, the coded garbage collector tries to clean it up, 
> except it doesn't find anything. So, it croaks.
> 
> >
> > We need a PERL guru ...!
> 
> I think we already have a few on this list, probably starting with Steve 
> Lime at the very top considering he wrote most of this wizardry to begin 
> with... I am sure between him and Steve W and Lowell and Paul Ramsey, 
> etc., we will be able to squash this.
> 
> pk/
> 
> 
> 
> 
> On Sunday, April 28, 2002, at 10:20  AM, Giorgio Volpe wrote:
> 
> > Puneet Kishor wrote:
> >>
> >> 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};
> >>      }
> >> }
> >
> > I've the same problem!
> > It is not a warning but a fatal error for perl.
> >
> > The problem, i guess, is related to the use of tied hash to support
> > mapscript objects ...
> >
> > I've added a PRINT ...
> >
> > sub DESTROY {
> >     print STDERR "!!!! Destroing $_[0] ...\n";
> >     my $self = tied(%{$_[0]});
> >     ...
> >
> > The DESTRUCTOR is called two times! The first one with $_[0] that is a
> > reference to an hash, the second to a scalar so function "tied" raises
> > the error!
> >
> > !!!! Destroing layerObj=HASH(0x83e925c) ...
> > !!!! Destroing layerObj=SCALAR(0x83d8ef4) ...
> >
> > Empirically i've seen that, if I undef the variable containing the
> > reference to the object before returning from the sub where i use it,
> > than the error disappears ... (also if the two call to the DESTRUCTOR
> > are always there, but probably the undef value is passed)
> >
> >
> > We need a PERL guru ...!
> >
> > --
> >
> >     Giorgio
> >
> > -----------------------------------------




More information about the MapServer-users mailing list