mapscript crashes on getFeature

Benedikt Rothe umn-ms at HYDROTEC.DE
Fri Nov 18 00:59:03 PST 2005


Hallo Donovan

Some month ago I made a posting about  Mapserver/Java-crashes
in Java-Finalizers, which tries to explain a problem on
memory-managment in Mapserver/Javascript  ("Java VM Crashes using the 
Mapscript API"):

http://article.gmane.org/gmane.comp.gis.mapserver.user/11536
http://article.gmane.org/gmane.comp.gis.mapserver.user/11678

Additional hint: I found bugs of this kind by changing all existing 
Java-Mascript-finalizers which call "delete()" to:

  protected void finalize() {
    if(swigCPtr != 0 && swigCMemOwn) {
      System.out.println(this.getClass().getName() + "-finalize 
deallokiert");
    }
    delete();
  }

The stdout will have messages for all classes which are freed in a 
dangerous way.
As long as this kind of messages one should look for missing delete's.

I hope this helps
Benedikt Rothe

PS: By following this rules the Java-App became much more stable.
But I still face problems of this kind one some machines.

UMN MapServer Users List <MAPSERVER-USERS at LISTS.UMN.EDU> schrieb am 
15.11.2005 18:10:18:

> I've been working with mapscript and tomcat for several weeks, generally
> mapserver is working great but when i try to query a layer (tried a 
polygon
> shp file, polygon tab file and a point tab file) the jvm crashes as soon 
as
> getFeature is called.  QueryByPoint and getResults appear to work - i 
can
> iterate over the resultset and print shape indexes but getFeature always
> crashes with this message:
> 
> > *** glibc detected *** free(): invalid pointer: 0x093f6e30 ***
> > 15/11/2005 10:48:04 11023 jsvc.exec error: Service did not exit 
cleanly
> 
> Any ideas?  I'm really stuck...
> 
> Following is a snip of the code and some more detail:
> 
> layer.queryByPoint(map,point,mapscriptConstants.MS_MULTIPLE,-1);
> resultCacheObj results = layer.getResults();
> layer.open();
>     for (int i=0;i<results.getNumresults();i++) {
>         resultCacheMemberObj result = results.getResult(i);
>         shapeObj feature =
> layer.getFeature(result.getShapeindex(),result.getTileindex());
>     }
> f.realLayer.close();
> 
> I'm using mapserver 4.8.0 but also tried 4.6.0 - same results
> I compiled mapserver myself with these flags
> --with-gdal --with-ogr --with-postgis --with-proj --with-threads 
--with-png
> --with-geos --with-gd --enable-debug
> 
> gdal-1.2.6,  proj-4.4.9 and geos-2.1.1 were installed using RPMs from
> mappinghacks.com
> JDK 1.5.0_05
> Tomcat 5.0
> Fedora core 3
> 
> I tried loading the jvm in GDB but it don't have the skill to track down 
the
> source of the memory corruption.
> Searched the list, google and the documentation with no success...
> 
> Donovan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051118/5e73fe76/attachment.htm>


More information about the MapServer-users mailing list