Opened 18 years ago

Closed 18 years ago

#1801 closed defect (fixed)

Every call to create a shapeObj or getFeature function the VM crashes.

Reported by: hrodriguez@… Owned by: unicoletti
Priority: high Milestone:
Component: MapScript-Java Version: 4.8
Severity: major Keywords:
Cc:

Description

Every time i want to create a shapeObj or call the getFeature function the VM
crashes.
MapServer version 4.8.1 
 example 
public List queryPorPunto(int x, int y)   {
>                 List lista = new ArrayList();
>                 pointObj p = new pointObj(x, y, 0);
>                 String row = "";
>
>                 layerObj l = map.getLayerByName("entorno");
>                 l.queryByPoint(map, p, mapscriptConstants.MS_MULTIPLE, 
> -1);
>
>                         resultCacheObj results = l.getResults();
>                         if (results == null)
>                                 return lista;
>
>                         l.open();
>                         for (int i = 0; i < results.getNumresults(); i++)
>                         {
>                                 resultCacheMemberObj r = 
> results.getResult(i);
>                                 shapeObj shape = 
> l.getFeature(r.getShapeindex(), -1);
>                                 row = "";
>                                 for (int j = 0; j < 
> shape.getNumvalues();
> j++)
>                                         {
>                                         row = row + "<TD>" +
> shape.getValue(j) + "</TD>";
>                                         }
>                                 lista.add(row);
>                         }
>                         l.close();
>                 return lista;
>         }

FAILURE LOG

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x400a69b0, pid=2773, tid=1075220608
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_11-b06 mixed mode)
# Problematic frame:
# C  [libc.so.6+0x729b0]
#

---------------  T H R E A D  ---------------

Current thread (0x08057cc0):  JavaThread "main" [_thread_in_native, id=2773]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x0000000c

Registers:
EAX=0x00000001, EBX=0x40165e80, ECX=0x40166880, EDX=0x0806d5a0
ESP=0xbfffcb08, EBP=0xbfffcb40, ESI=0x00000000, EDI=0x40166840
EIP=0x400a69b0, CR2=0x0000000c, EFLAGS=0x00010206

Top of Stack: (sp=0xbfffcb08)
0xbfffcb08:   400277e4 08057f00 40166880 4043ecab
0xbfffcb18:   40166888 bfffcbe0 40166840 0806d5a0
0xbfffcb28:   00000004 00000020 40166840 40165e80
0xbfffcb38:   40166840 00000001 bfffcb5c 400a5c43
0xbfffcb48:   40166840 00000016 4d0cb754 00000000
0xbfffcb58:   00000015 bfffcb8c 4d089333 00000016
0xbfffcb68:   400277e4 40028c45 0000000e ffffffff
0xbfffcb78:   403c8a1d 00000000 4d0cb754 08136b80 

Instructions: (pc=0x400a69b0)
0x400a69a0:   8b 4d d0 09 84 97 48 04 00 00 8b 55 e4 89 4a 0c
0x400a69b0:   89 56 0c 89 72 08 89 51 08 8b 57 54 8b 7d d8 89 

Stack: [0xbfe0e000,0xc0000000),  sp=0xbfffcb08,  free space=1978k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x729b0]
C  [libc.so.6+0x71c43]  malloc+0x93
C  [libmapscript.so+0x105333]  strstrIgnoreCase+0x43
C  [libmapscript.so+0x108122]
C  [libmapscript.so+0x107188]  msPOSTGISLayerGetShape+0x88
C  [libmapscript.so+0x10931d]  msPOSTGISLayerGetShapeVT+0x2d
C  [libmapscript.so+0xa78b1]  msLayerGetShape+0x51
C  [libmapscript.so+0x37e49]  layerObj_getFeature+0x59
C  [libmapscript.so+0x50f76] 
Java_edu_umn_gis_mapscript_mapscriptJNI_layerObj_1getFeature+0x46
j  edu.umn.gis.mapscript.mapscriptJNI.layerObj_getFeature(JII)J+0
j  edu.umn.gis.mapscript.layerObj.getFeature(II)Ledu/umn/gis/mapscript/shapeObj;+6
j  testMapscript.TestMapscript.queryPorPunto(II)Ljava/util/List;+93
j  testMapscript.TestMapscript.dibujartabla()Ljava/lang/String;+7
j  testMapscript.TestMapscript.main([Ljava/lang/String;)V+61
v  ~StubRoutines::call_stub
V  [libjvm.so+0x1a9f14]
V  [libjvm.so+0x25f2a5]
V  [libjvm.so+0x1aa166]
V  [libjvm.so+0x1b23dc]
V  [libjvm.so+0x1c0f4d]
C  [java+0x1880]
C  [libc.so.6+0x15974]  __libc_start_main+0xf4

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  edu.umn.gis.mapscript.mapscriptJNI.layerObj_getFeature(JII)J+0
j  edu.umn.gis.mapscript.layerObj.getFeature(II)Ledu/umn/gis/mapscript/shapeObj;+6
j  testMapscript.TestMapscript.queryPorPunto(II)Ljava/util/List;+93
j  testMapscript.TestMapscript.dibujartabla()Ljava/lang/String;+7
j  testMapscript.TestMapscript.main([Ljava/lang/String;)V+61
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x08098b18 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2773]
  0x08097d80 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2773]
  0x080961b8 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=2773]
  0x08095320 JavaThread "JDWP Event Helper Thread" daemon [_thread_in_native,
id=2773]
  0x08094838 JavaThread "JDWP Transport Listener: dt_socket" daemon
[_thread_in_native, id=2773]
  0x0808eac0 JavaThread "Finalizer" daemon [_thread_blocked, id=2773]
  0x0808de98 JavaThread "Reference Handler" daemon [_thread_blocked, id=2773]
=>0x08057cc0 JavaThread "main" [_thread_in_native, id=2773]

Other Threads:
  0x0808cc30 VMThread [id=2773]
  0x080b96b0 WatcherThread [id=2773]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 576K, used 89K [0x447d0000, 0x44870000, 0x44cb0000)
  eden space 512K,   4% used [0x447d0000, 0x447d64e0, 0x44850000)
  from space 64K, 100% used [0x44860000, 0x44870000, 0x44870000)
  to   space 64K,   0% used [0x44850000, 0x44850000, 0x44860000)
 tenured generation   total 1408K, used 51K [0x44cb0000, 0x44e10000, 0x487d0000)
   the space 1408K,   3% used [0x44cb0000, 0x44cbcf90, 0x44cbd000, 0x44e10000)
 compacting perm gen  total 4096K, used 1394K [0x487d0000, 0x48bd0000, 0x4c7d0000)
   the space 4096K,  34% used [0x487d0000, 0x4892ca00, 0x4892ca00, 0x48bd0000)

Dynamic libraries:
08048000-08053000 r-xp 00000000 08:07 504609    
/usr/local/bin/j2sdk1.4.2_11/bin/java
08053000-08055000 rw-p 0000a000 08:07 504609    
/usr/local/bin/j2sdk1.4.2_11/bin/java
08055000-081eb000 rw-p 08055000 00:00 0 
40000000-40016000 r-xp 00000000 08:05 110177     /lib/ld-2.3.2.so
40016000-40017000 rw-p 00015000 08:05 110177     /lib/ld-2.3.2.so
40017000-40018000 rw-p 40017000 00:00 0 
40021000-4002d000 r-xp 00000000 08:05 114258     /lib/tls/libpthread-0.60.so
4002d000-4002e000 rw-p 0000c000 08:05 114258     /lib/tls/libpthread-0.60.so
4002e000-40031000 rw-p 4002e000 00:00 0 
40031000-40033000 r-xp 00000000 08:05 114247     /lib/tls/libdl-2.3.2.so
40033000-40034000 rw-p 00002000 08:05 114247     /lib/tls/libdl-2.3.2.so
40034000-4015e000 r-xp 00000000 08:05 114245     /lib/tls/libc-2.3.2.so
4015e000-40167000 rw-p 00129000 08:05 114245     /lib/tls/libc-2.3.2.so
40167000-4016a000 rw-p 40167000 00:00 0 
4016a000-4057c000 r-xp 00000000 08:07 503963    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/client/libjvm.so
4057c000-40598000 rw-p 00411000 08:07 503963    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/client/libjvm.so
40598000-405ab000 rw-p 40598000 00:00 0 
405ab000-405b1000 r-xp 00000000 08:07 503957    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/native_threads/libhpi.so
405b1000-405b3000 rw-p 00005000 08:07 503957    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/native_threads/libhpi.so
405b4000-405c5000 r-xp 00000000 08:05 114250     /lib/tls/libnsl-2.3.2.so
405c5000-405c6000 rw-p 00011000 08:05 114250     /lib/tls/libnsl-2.3.2.so
405c6000-405c8000 rw-p 405c6000 00:00 0 
405c8000-405e9000 r-xp 00000000 08:05 114248     /lib/tls/libm-2.3.2.so
405e9000-405ea000 rw-p 00020000 08:05 114248     /lib/tls/libm-2.3.2.so
405ea000-405ee000 rw-s 00000000 08:05 65296      /tmp/hsperfdata_gistest/2773
405f3000-405fa000 r-xp 00000000 08:05 114251     /lib/tls/libnss_compat-2.3.2.so
405fa000-405fb000 rw-p 00006000 08:05 114251     /lib/tls/libnss_compat-2.3.2.so
405fb000-40603000 r-xp 00000000 08:05 114255     /lib/tls/libnss_nis-2.3.2.so
40603000-40604000 rw-p 00007000 08:05 114255     /lib/tls/libnss_nis-2.3.2.so
40604000-4060d000 r-xp 00000000 08:05 114253     /lib/tls/libnss_files-2.3.2.so
4060d000-4060e000 rw-p 00008000 08:05 114253     /lib/tls/libnss_files-2.3.2.so
4060e000-4061b000 r-xp 00000000 08:07 503968    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libverify.so
4061b000-4061d000 rw-p 0000c000 08:07 503968    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libverify.so
4061d000-40639000 r-xp 00000000 08:07 503969    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libjava.so
40639000-4063b000 rw-p 0001b000 08:07 503969    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libjava.so
4063b000-40649000 r-xp 00000000 08:07 503971    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libzip.so
40649000-4064b000 rw-p 0000d000 08:07 503971    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libzip.so
4064b000-41ff5000 r--s 00000000 08:07 504602    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/rt.jar
41ff5000-4203f000 rw-p 41ff5000 00:00 0 
4203f000-42055000 r--s 00000000 08:07 503998    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/sunrsasign.jar
42055000-42132000 r--s 00000000 08:07 504510    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/jsse.jar
42132000-42144000 r--s 00000000 08:07 503999    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/jce.jar
42144000-42719000 r--s 00000000 08:07 504548    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/charsets.jar
42719000-427a1000 rwxp 42719000 00:00 0 
427a1000-44719000 rwxp 427a1000 00:00 0 
44719000-4471c000 rwxp 44719000 00:00 0 
4471c000-44799000 rwxp 4471c000 00:00 0 
44799000-447c1000 rw-p 44799000 00:00 0 
447c1000-447c4000 r--s 00000000 08:07 503995    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/ext/dnsns.jar
447d0000-44870000 rwxp 447d0000 00:00 0 
44870000-44cb0000 rwxp 44870000 00:00 0 
44cb0000-44e10000 rwxp 44cb0000 00:00 0 
44e10000-487d0000 rwxp 44e10000 00:00 0 
487d0000-48bd0000 rwxp 487d0000 00:00 0 
48bd0000-4c7d0000 rwxp 48bd0000 00:00 0 
4c7d0000-4c7d1000 rwxp 4c7d0000 00:00 0 
4c7d1000-4c7d2000 rwxp 4c7d1000 00:00 0 
4c7d2000-4c7d4000 rwxp 4c7d2000 00:00 0 
4c7d4000-4c7f0000 rwxp 4c7d4000 00:00 0 
4c7f0000-4c7f2000 rwxp 4c7f0000 00:00 0 
4c7f2000-4c810000 rwxp 4c7f2000 00:00 0 
4c810000-4c812000 rwxp 4c810000 00:00 0 
4c812000-4c82f000 rwxp 4c812000 00:00 0 
4c82f000-4c832000 rwxp 4c82f000 00:00 0 
4c832000-4c850000 rwxp 4c832000 00:00 0 
4c850000-4c851000 ---p 4c850000 00:00 0 
4c851000-4c8d0000 rwxp 4c851000 00:00 0 
4c8d0000-4c8d1000 ---p 4c8d0000 00:00 0 
4c8d1000-4c8de000 rwxp 4c8d1000 00:00 0 
4c8de000-4c8e1000 ---p 4c8de000 00:00 0 
4c8e1000-4c950000 rwxp 4c8e1000 00:00 0 
4c950000-4c951000 ---p 4c950000 00:00 0 
4c951000-4c95e000 rwxp 4c951000 00:00 0 
4c95e000-4c961000 ---p 4c95e000 00:00 0 
4c961000-4c9d0000 rwxp 4c961000 00:00 0 
4c9d0000-4ca17000 r--p 00000000 08:07 553173     /usr/lib/locale/locale-archive
4ca17000-4ca39000 r-xp 00000000 08:07 503990    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libjdwp.so
4ca39000-4ca3b000 rw-p 00021000 08:07 503990    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libjdwp.so
4ca3b000-4ca3e000 rw-p 4ca3b000 00:00 0 
4ca3e000-4ca40000 r-xp 00000000 08:07 503991    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libdt_socket.so
4ca40000-4ca42000 rw-p 00001000 08:07 503991    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/libdt_socket.so
4ca4b000-4ca4f000 r-xp 00000000 08:05 110375     /lib/libnss_db-2.2.so
4ca4f000-4ca50000 rw-p 00004000 08:05 110375     /lib/libnss_db-2.2.so
4ca50000-4caf9000 r-xp 00000000 08:07 552729     /usr/lib/libdb3.so.3.0.2
4caf9000-4cafa000 rw-p 000a8000 08:07 552729     /usr/lib/libdb3.so.3.0.2
4cafa000-4cafb000 ---p 4cafa000 00:00 0 
4cafb000-4cb08000 rwxp 4cafb000 00:00 0 
4cb08000-4cb0b000 ---p 4cb08000 00:00 0 
4cb0b000-4cb7a000 rwxp 4cb0b000 00:00 0 
4cb7a000-4cb7b000 ---p 4cb7a000 00:00 0 
4cb7b000-4cb88000 rwxp 4cb7b000 00:00 0 
4cb88000-4cb8b000 ---p 4cb88000 00:00 0 
4cb8b000-4cbfa000 rwxp 4cb8b000 00:00 0 
4cbfa000-4cbfb000 ---p 4cbfa000 00:00 0 
4cbfb000-4cc08000 rwxp 4cbfb000 00:00 0 
4cc08000-4cc0b000 ---p 4cc08000 00:00 0 
4cc0b000-4cc7a000 rwxp 4cc0b000 00:00 0 
4cc7a000-4cc7b000 ---p 4cc7a000 00:00 0 
4cc7b000-4ccfa000 rwxp 4cc7b000 00:00 0 
4ccfa000-4ccfb000 ---p 4ccfa000 00:00 0 
4ccfb000-4cd08000 rwxp 4ccfb000 00:00 0 
4cd08000-4cd0b000 ---p 4cd08000 00:00 0 
4cd0b000-4cd7a000 rwxp 4cd0b000 00:00 0 
4cd7a000-4cd7b000 ---p 4cd7a000 00:00 0 
4cd7b000-4cd88000 rwxp 4cd7b000 00:00 0 
4cd88000-4cd8b000 ---p 4cd88000 00:00 0 
4cd8b000-4cdfa000 rwxp 4cd8b000 00:00 0 
4cdfa000-4cdfb000 ---p 4cdfa000 00:00 0 
4cdfb000-4ce7a000 rwxp 4cdfb000 00:00 0 
4ce7a000-4ce96000 r--s 00000000 08:07 503994    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/ext/sunjce_provider.jar
4ce96000-4cea3000 r--s 00000000 08:07 503997    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/ext/ldapsec.jar
4cea3000-4cf5f000 r--s 00000000 08:07 504549    
/usr/local/bin/j2sdk1.4.2_11/jre/lib/ext/localedata.jar
4cf5f000-4cf84000 r--s 00000000 08:07 607351    
/usr/local/bin/jakarta-tomcat-4.1.31/common/lib/mapscript.jar
4cf84000-4d0c8000 r-xp 00000000 08:07 607346    
/usr/local/bin/jakarta-tomcat-4.1.31/shared/mapscript/libmapscript.so
4d0c8000-4d0cd000 rw-p 00144000 08:07 607346    
/usr/local/bin/jakarta-tomcat-4.1.31/shared/mapscript/libmapscript.so
4d0cd000-4d0cf000 rw-p 4d0cd000 00:00 0 
4d0d8000-4d0f4000 r-xp 00000000 08:07 455612     /usr/local/lib/libgd.so.2.0.0
4d0f4000-4d114000 rw-p 0001b000 08:07 455612     /usr/local/lib/libgd.so.2.0.0
4d114000-4d128000 rw-p 4d114000 00:00 0 
4d128000-4d145000 r-xp 00000000 08:07 554640     /usr/lib/libjpeg.so.62.0.0
4d145000-4d146000 rw-p 0001d000 08:07 554640     /usr/lib/libjpeg.so.62.0.0
4d146000-4d1ac000 r-xp 00000000 08:07 554602     /usr/lib/libfreetype.so.6.3.5
4d1ac000-4d1b3000 rw-p 00066000 08:07 554602     /usr/lib/libfreetype.so.6.3.5
4d1b3000-4d1d7000 r-xp 00000000 08:07 455561     /usr/local/lib/libpng.so.3.0.0
4d1d7000-4d1d8000 rw-p 00023000 08:07 455561     /usr/local/lib/libpng.so.3.0.0
4d1d8000-4d1e9000 r-xp 00000000 08:07 554973     /usr/lib/libz.so.1.2.2
4d1e9000-4d1ea000 rw-p 00010000 08:07 554973     /usr/lib/libz.so.1.2.2
4d1ea000-4d2dd000 r-xp 00000000 08:07 455647     /usr/local/lib/libpdf.so.5.0.1
4d2dd000-4d2fb000 rw-p 000f3000 08:07 455647     /usr/local/lib/libpdf.so.5.0.1
4d2fb000-4d32e000 r-xp 00000000 08:07 455514     /usr/local/lib/libproj.so.0.5.0
4d32e000-4d330000 rw-p 00033000 08:07 455514     /usr/local/lib/libproj.so.0.5.0
4d330000-4d5f2000 r-xp 00000000 08:07 455718     /usr/local/lib/libgdal.so.1.9.0
4d5f2000-4d673000 rw-p 002c2000 08:07 455718     /usr/local/lib/libgdal.so.1.9.0
4d673000-4d688000 rw-p 4d673000 00:00 0 
4d688000-4d6a0000 r-xp 00000000 08:07 636108     /usr/local/pgsql/lib/libpq.so.4.1
4d6a0000-4d6a1000 rw-p 00017000 08:07 636108     /usr/local/pgsql/lib/libpq.so.4.1
4d6a1000-4d6cf000 r-xp 00000000 08:07 455639     /usr/local/lib/libcurl.so.3.0.0
4d6cf000-4d6d0000 rw-p 0002d000 08:07 455639     /usr/local/lib/libcurl.so.3.0.0
4d6d0000-4d76f000 r-xp 00000000 08:07 552756     /usr/lib/libstdc++.so.5.0.7
4d76f000-4d785000 rw-p 0009e000 08:07 552756     /usr/lib/libstdc++.so.5.0.7
4d785000-4d78a000 rw-p 4d785000 00:00 0 
4d78a000-4d792000 r-xp 00000000 08:05 110233     /lib/libgcc_s.so.1
4d792000-4d793000 rw-p 00007000 08:05 110233     /lib/libgcc_s.so.1
4d793000-4d7c6000 r-xp 00000000 08:07 455587    
/usr/local/lib/libfontconfig.so.1.0.4
4d7c6000-4d7ca000 rw-p 00032000 08:07 455587    
/usr/local/lib/libfontconfig.so.1.0.4
4d7ca000-4d7cb000 rw-p 4d7ca000 00:00 0 
4d7cb000-4d7ef000 r-xp 00000000 08:07 455557     /usr/local/lib/libpng12.so.0.0.0
4d7ef000-4d7f0000 rw-p 00023000 08:07 455557     /usr/local/lib/libpng12.so.0.0.0
4d7f0000-4d8c8000 r-xp 00000000 08:07 455530     /usr/local/lib/libgeos.so.2.2.1
4d8c8000-4d8eb000 rw-p 000d8000 08:07 455530     /usr/local/lib/libgeos.so.2.2.1
4d8eb000-4d907000 r-xp 00000000 08:07 455714     /usr/local/lib/libgeotiff.so.1.2.2
4d907000-4d90d000 rw-p 0001b000 08:07 455714     /usr/local/lib/libgeotiff.so.1.2.2
4d90d000-4d95c000 r-xp 00000000 08:07 455653     /usr/local/lib/libtiff.so.3.8.0
4d95c000-4d95f000 rw-p 0004e000 08:07 455653     /usr/local/lib/libtiff.so.3.8.0
4d95f000-4d964000 r-xp 00000000 08:05 114260     /lib/tls/librt-2.3.2.so
4d964000-4d965000 rw-p 00005000 08:05 114260     /lib/tls/librt-2.3.2.so
4d965000-4d96a000 r-xp 00000000 08:05 114246     /lib/tls/libcrypt-2.3.2.so
4d96a000-4d96b000 rw-p 00004000 08:05 114246     /lib/tls/libcrypt-2.3.2.so
4d96b000-4d992000 rw-p 4d96b000 00:00 0 
4d992000-4d9a1000 r-xp 00000000 08:05 114259     /lib/tls/libresolv-2.3.2.so
4d9a1000-4d9a2000 rw-p 0000f000 08:05 114259     /lib/tls/libresolv-2.3.2.so
4d9a2000-4d9a4000 rw-p 4d9a2000 00:00 0 
4d9a4000-4dabe000 r-xp 00000000 08:07 455576     /usr/local/lib/libxml2.so.2.6.23
4dabe000-4dac7000 rw-p 00119000 08:07 455576     /usr/local/lib/libxml2.so.2.6.23
4dac7000-4db9e000 r-xp 00000000 08:07 455507     /usr/local/lib/libiconv.so.2.2.0
4db9e000-4db9f000 rw-p 000d7000 08:07 455507     /usr/local/lib/libiconv.so.2.2.0
bfe04000-bfe0e000 rwxp bfe04000 00:00 0 
bfe0e000-bfe11000 ---p bfe0e000 00:00 0 
bfff7000-c0000000 rw-p bfff7000 00:00 0 
ffffe000-fffff000 ---p 00000000 00:00 0 

VM Arguments:
jvm_args: -Djava.library.path=/usr/local/bin/tomcat/shared/mapscript -Xdebug
-Xnoagent -Xrunjdwp:transport=dt_socket,suspend=y,address=localhost:32976
java_command: testMapscript.TestMapscript
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/usr/local/bin/java
JRE_HOME=/usr/local/bin/java/jre
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/usr/local/sbin:/sbin:/usr/local/bin/j2sdk1.4.2_11/bin:/usr/local/pgsql/bin
USERNAME=gistest
LD_LIBRARY_PATH=/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386/client:/usr/local/bin/j2sdk1.4.2_11/jre/lib/i386:/usr/local/bin/j2sdk1.4.2_11/jre/../lib/i386
SHELL=/bin/bash
DISPLAY=:0.0


---------------  S Y S T E M  ---------------

OS:3.1

uname:Linux 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686
libc:glibc 2.3.2 NPTL 0.60 
rlimit: STACK 8192k, CORE 0k, NPROC infinity, NOFILE 1024, AS infinity
load average:-0.53 0.00 -0.53

CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 403204k(29720k free), swap 498004k(498004k free)

vm_info: Java HotSpot(TM) Client VM (1.4.2_11-b06) for linux-x86, built on Feb
13 2006 11:02:10 by unknown with unknown compiler

Attachments (3)

postgis-debug.patch (524 bytes ) - added by unicoletti 18 years ago.
Debugging output (do not use on prod systems!!!!)
hs_err_pid2550.log (16.4 KB ) - added by unicoletti 18 years ago.
JVM crash log reported by user on ML
hs_err_pid2489.log (14.2 KB ) - added by unicoletti 18 years ago.
JVM crash log reported by user on ML

Download all attachments as: .zip

Change History (15)

comment:1 by unicoletti, 18 years ago

Status: newassigned
Apply the attached patch or add this statement

    printf("DEBUG: strstrIgnoreCase(%s,%s)\n", haystack, needle);

at about line 233 of mappostgis.c and then post the standard output here.

by unicoletti, 18 years ago

Attachment: postgis-debug.patch added

Debugging output (do not use on prod systems!!!!)

by unicoletti, 18 years ago

Attachment: hs_err_pid2550.log added

JVM crash log reported by user on ML

by unicoletti, 18 years ago

Attachment: hs_err_pid2489.log added

JVM crash log reported by user on ML

comment:2 by unicoletti, 18 years ago

Please try this queryByPoint code (which works well for me on postgis):

    protected List queryLayerByPoint(int i, pointObj queryPoint) {
       List results = new ArrayList();

       layerObj layer = map.getLayer(i);
       if (layer != null && isVisible(layer)) {
           if (log.isDebugEnabled()) {
               log.debug("Querying layer: " + layer.getName());
           }
           if (layer.queryByPoint(map, queryPoint,
mapscript.MS_MULTIPLE, -1) == mapscript.MS_SUCCESS) {
               //resultCacheObj resultCache = layer.ggetResultcache();
               if (layer.open() == mapscript.MS_SUCCESS) {
                   //for (int j=0;j<resultCache.getNumresults();j++) {
                   for (int j = 0; j < layer.getNumResults(); j++) {
                       if (log.isDebugEnabled())
                           log.debug("Layer " + layer.getName() + ",
result number:" + j);
                       resultCacheMemberObj resultMember = layer.getResult(j);
                       shapeObj shape = new shapeObj(layer.getType());
                       layer.getShape(shape,
resultMember.getTileindex(), resultMember.getShapeindex());
                       if (shape != null) {
                           Map aResult = getResult(shape, layer);

                           results.add(aResult);
                       } else {
                           log.error("Shape " + j + " is null!");
                       }
                   }
                   layer.close();
               } else {
                   log.error("Cannot open layer: " + layer.getName());
               }
           } else {
               log.info("Query on layer " + layer.getName() + " failed.");
           }
       }
       return results;
   }

comment:3 by szekerest, 18 years ago

Cc: szekeres.tamas@… added
I have found similar problems with C# on linux if support for geos was enabled.
Without geos support compiled in the problem has not come out.

Tamas

comment:4 by szekerest, 18 years ago

Umberto,

You should enable GEOS support in java makefile.in for fixing this problem.

Tamas

comment:5 by szekerest, 18 years ago

Fixed for C#

comment:6 by unicoletti, 18 years ago

I have not been able to reproduce the error (even with GEOS 2.2.1 compiled in)
and the user has not answered to emails.
I'll wait another week then close as INVALID.

comment:7 by szekerest, 18 years ago

I wonder why you haven't encounter this problem considering the followings:

1. Java makefile.in does not propagate USE_GEOS (like for C# before)
2. Compiling mapserver and mapscript with different USE_GEOS setting different
shapeObj size will be allocated for mapserver and mapscript, see the shapeObj
declaration:

typedef struct {
#ifdef SWIG
%immutable;
#endif
  int numlines;
  int numvalues;
  lineObj *line;
  char **values;
#ifdef SWIG
%mutable;
#endif

  rectObj bounds;
  int type; /* MS_SHAPE_TYPE */
  long index;
  int tileindex;
  int classindex;
  char *text;

#ifdef USE_GEOS
  void *geometry;
#endif

} shapeObj;

and the mapscript shapeObj constructor & destructor:

SWIGINTERN shapeObj *new_shapeObj(int type){
        int i;
        shapeObj *shape;

	shape = (shapeObj *)malloc(sizeof(shapeObj));
        if (!shape)
            return NULL;

        msInitShape(shape);
        if(type >= 0) shape->type = type;

        /* Allocate memory for 4 values */
        if ((shape->values = (char **)malloc(sizeof(char *)*4)) == NULL) {
            msSetError(2, "Failed to allocate memory for values", "shapeObj()");
            return NULL;
        } else {
            for (i=0; i<4; i++) shape->values[i] = strdup("");
        }
        shape->numvalues = 4;
        
        return shape;
    }
SWIGINTERN void delete_shapeObj(shapeObj *self){
        msFreeShape(self);
        free(self);		
    }

msFreeShape will want to use *geometry that was not allocated for example.
Or the reverse case may also occur.

Tamas
 

comment:8 by unicoletti, 18 years ago

I do not usually have MALLOC_CHECK_ set. When I set it I got the error too.

BTW: the shapeObj constructor allocates 4 values which are probably not needed.
Should we remove them?

comment:9 by szekerest, 18 years ago

Inline shapeObj currently supports 4 value to be handled by setValue and getValue.
Values cannot be added. How about implementing "shapeObj.addValues(string[]
values)" instead of preallocating the 4 values?


comment:10 by unicoletti, 18 years ago

I don't think we should allow users to edit shapeObj values.
Those values should be set by the datasource where the shape came from and
should not be changed (they are in fact read-only).

I am more keen on just removing the allocation of the 4 values array, which is
probably a memory leak (at lease for postgis which does not free it when it sets
its own values).

comment:11 by szekerest, 18 years ago

I have changed the followings in the CVS-HEAD:

1. Removed the default preallocation of 4 values
2. Added initValues to achieve the similar functionality if needed.

Maybe branch-4-8 should also be changed if this issue is critical.

comment:12 by unicoletti, 18 years ago

Resolution: fixed
Status: assignedclosed
This bug is closed.
Note: See TracTickets for help on using tickets.