Strange mapscriptJNI_delete_1layerObj+0xf error killing Tomcat

Tamas Szekeres szekerest at GMAIL.COM
Thu May 31 13:47:28 EDT 2007


Rodrigo,

This error happened when the garbage collector have destroyed a free
standing layer object. The C memory of that object have been
implicitly destroyed previously upon the destruction of the parent map
object.

It seems to me that you are possibly using the 'layerObj(mapObj map)'
constructor somewhere in your code for creating new layers dynamically
and adding to a map. I don't know whether it have handled for java so
far, but it is potentially unsafe for SWIG and RFC-24 is dedicated to
treat this issue (among other problems).

If this statement applies to your code I would suggest to use the
layerObj(null) constructor and using insertLayer for adding the layer
to the map instead.

This issue also applies to the 'classObj(layerObj layer)' and
styleObj(classObj parent_class) constructors as well.


Best regards,

Tamas



2007/5/31, Rodrigo Del C. Andrade <rodrigo.andrade at digitro.com.br>:
>
>
>      Hello dear list.
>
>     A problem is happening in our production machine which we were unable to
> reproduce on our development machines. We have a very large application
> almost ready for deployment, in which one of the modules is written in java
> mapscript 4.10.1,  and the error on the attached log happened for the first
> time when we installed the application on the production server. Whats
> worse, the GIS module causing the error brings down Tomcat and the whole
> application with it.
>      This is a excerpt from the JVM log:
>
>  # An unexpected error has been detected by HotSpot Virtual Machine:
>  #
>  #  SIGSEGV (0xb) at pc=0x636ff93b, pid=19162, tid=1759710128
>  #
>  # Java VM: Java HotSpot(TM) Server VM (1.5.0_07-b03 mixed mode)
>  # Problematic frame:
>  # C  [libmapscript.so+0x3893b]
> Java_edu_umn_gis_mapscript_mapscriptJNI_delete_1layerObj+0xf
>  #
>
>  ---------------  T H R E A D  ---------------
>
>  Current thread (0x08112ee0):  JavaThread "Finalizer" daemon
> [_thread_in_native, id=19174]
>
>  siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x627e7024
>
>  Registers:
>  EAX=0x636ff92c, EBX=0x6b363670, ECX=0x084a03a0, EDX=0x6b372b58
>  ESP=0x68e2dae4, EBP=0x68e2fafc, ESI=0x627e7000, EDI=0x08112ee0
>  EIP=0x636ff93b, CR2=0x627e7024, EFLAGS=0x00010216
>
>  Top of Stack: (sp=0x68e2dae4)
>  0x68e2dae4:   00000000 00000000 000004b0 00000000
>  0x68e2daf4:   00000000 00000000 00000000 00000000
>  0x68e2db04:   00000000 00000000 00000000 00000000
>  0x68e2db14:   00000000 00000000 00000000 00000000
>  0x68e2db24:   00000000 00000000 00000000 00000000
>  0x68e2db34:   00000000 00000000 00000000 00000000
>  0x68e2db44:   00000000 00000000 00000000 00000000
>  0x68e2db54:   00000000 00000000 00000000 00000000
>
>  Instructions: (pc=0x636ff93b)
>  0x636ff92b:   90 55 89 e5 57 56 53 81 ec 0c 20 00 00 8b 75 10
>  0x636ff93b:   8b 4e 24 e8 00 00 00 00 5b 81 c3 15 63 0e 00 85
>
>  Stack: [0x68db0000,0x68e31000),  sp=0x68e2dae4,  free space=502k
>  Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
> code)
>  C  [libmapscript.so+0x3893b]
> Java_edu_umn_gis_mapscript_mapscriptJNI_delete_1layerObj+0xf
>  j
> edu.umn.gis.mapscript.mapscriptJNI.delete_layerObj(J)V+0
>  j  edu.umn.gis.mapscript.layerObj.delete()V+25
>  j  edu.umn.gis.mapscript.layerObj.finalize()V+1
>  v  ~StubRoutines::call_stub
>  V  [libjvm.so+0x2649ac]
>  V  [libjvm.so+0x427bc8]
>  V  [libjvm.so+0x2647df]
>  V  [libjvm.so+0x28f233]
>  V  [libjvm.so+0x2755b4]
>  C  [libjava.so+0xb3be]
> Java_java_lang_ref_Finalizer_invokeFinalizeMethod+0x6e
>  j
> java.lang.ref.Finalizer.invokeFinalizeMethod(Ljava/lang/Object;)V+0
>  j  java.lang.ref.Finalizer.runFinalizer()V+45
>  j
> java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;)V+1
>  j  java.lang.ref.Finalizer$FinalizerThread.run()V+11
>  v  ~StubRoutines::call_stub
>  V  [libjvm.so+0x2649ac]
>  V  [libjvm.so+0x427bc8]
>  V  [libjvm.so+0x264205]
>  V  [libjvm.so+0x26429e]
>  V  [libjvm.so+0x2db925]
>  V  [libjvm.so+0x4c6cb3]
>  V  [libjvm.so+0x4287d8]
>  C  [libpthread.so.0+0x5371]
>
>      It seems to happen while rendering the a map, but not always, so it
> cant be consistently reproduced. We just query maps and it will happen
> eventually.
>      Also, "delete_1layer" is hints at the removal of a layer (duh) but we
> don't have a remove or delete layers anywhere in our code, so we suspect of
> GC problems. Could it be related to the problems Umberto describes in
>
> http://lists.umn.edu/cgi-bin/wa?A2=ind0705&L=MAPSERVER-USERS&P=R28693
> and specially
>
> http://mapserver.gis.umn.edu/development/rfc/ms-rfc-24/
>     and if it is, could there be anything possible to workaround it? Full
> log attached.
>
>      We're at a loss here, folks. Any help is greatly appreciated
>      Thanks,
>
>      Rod
>
>
> --
>
>  Rodrigo Del C. Andrade
>  Programador
>  SIC - SSE - Soluções Segurança Pública
>
>  DÍGITRO TECNOLOGIA
>  E-mail: rodrigo.andrade at digitro.com.br
>  Fone: +55 48 3281-7314 / +55 48 3281-7000
>  Fax: +55 48 3281-7299
>  Site: www.digitro.com
>



More information about the mapserver-users mailing list