<br><font size=2><tt>Dear List</tt></font>
<br>
<br><font size=2><tt>We are using MapScript/Tomcat/Java/OracleSpatial.</tt></font>
<br>
<br><font size=2><tt>We use mapObj.mapClone() to get a fresh mapObject
</tt></font>
<br><font size=2><tt>in each request without reading the Mapfile.</tt></font>
<br>
<br><font size=2><tt>We detected problems after we activated Connection-Pooling:</tt></font>
<br><font size=2><tt>Tomcat crashed in mapObj.delete()</tt></font>
<br>
<br><font size=2><tt>Hole thing turned out to be a bug in mapcopy.c where</tt></font>
<br><font size=2><tt>the joins are copied:</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br><font size=2><tt>MS_COPYSTELEM(numjoins);</tt></font>
<br>
<br><font size=2><tt>for (i = 0; i < dst->numprocessing; i++) {</tt></font>
<br><font size=2><tt>   return_value = msCopyJoin(&(dst->joins[i]),
&(src->joins[i]));</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br>
<br><font size=2><tt>This must be changed to</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br><font size=2><tt>MS_COPYSTELEM(numjoins);</tt></font>
<br>
<br><font size=2><tt>for (i = 0; i < dst->numjoins; i++) {</tt></font>
<br><font size=2><tt>   return_value = msCopyJoin(&(dst->joins[i]),
&(src->joins[i]));</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br>
<br><font size=2><tt>There is some other code in mapobject.c, wich didn't
</tt></font>
<br><font size=2><tt>raise any problems for us, but from wich I do think
</tt></font>
<br><font size=2><tt>that array-allocs are missing.</tt></font>
<br><font size=2><tt>I watched the code an *think* these are are not allocated
</tt></font>
<br><font size=2><tt>anywhere. I hope, there is no misleading hint:</tt></font>
<br><font size=2><tt><br>
----------------------------<br>
// I do think, that dst->point is not allocated.<br>
// code seems to be unused (?)<br>
dst->numpoints = src->numpoints;<br>
for (i = 0; i < dst->numpoints; i++) {<br>
  MS_COPYPOINT(&(dst->point[i]), &(src->point[i]));<br>
}<br>
----------------------------<br>
// I do think, that dst->items and dst->values is<br>
// not allocated<br>
MS_COPYSTELEM(numitems);<br>
for (i = 0; i < dst->numitems; i++) {<br>
  MS_COPYSTRING(dst->items[i], src->items[i]);<br>
  MS_COPYSTRING(dst->values[i], src->values[i]);<br>
}<br>
<br>
-----------------------------<br>
// I'm quite shure, that dst->items is not allocated<br>
MS_COPYSTELEM(numitems);<br>
<br>
for (i = 0; i < dst->numitems; i++) {<br>
  MS_COPYSTRING(dst->items[i], src->items[i]);<br>
}<br>
</tt></font>
<br><font size=2><tt>I hope this is helpful. Greetings</tt></font>
<br><font size=2><tt>Benedikt Rothe</tt></font>