Hi Even,<div>We was able to get it working using GDAL 1.8.1 and SWIG 1.3.40.</div><div>Not sure which part fixed it (GDAL 1.8.1 or SWIG 1.3.40).</div><div>Thanks for your suggestions. (In case we have some free time, we will probably try GDAL 1.7.3 with SWIG 1.3.40 just to understand which component fixed our issues).</div>
<div><br></div><div>Best Regards,</div><div>Daniele</div><div><br><br><div class="gmail_quote">On Mon, Jan 23, 2012 at 8:12 PM, Even Rouault <span dir="ltr">&lt;<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le lundi 23 janvier 2012 18:12:14, Daniele Romagnoli a écrit :<br>
<div class="im">&gt; Hi list,<br>
&gt; Does anyone have any experience about the reported topic?<br>
&gt;<br>
&gt; I have downloaded GDAL 1.7.3 on my Centos 5.7 (64) machine and built it<br>
&gt; (with only base drivers and with threads support).<br>
&gt; Utilities are working fine (gdalinfo, gdal_translate, ...)<br>
&gt;<br>
&gt; Then, I have installed SWIG 1.3.36 (I know, it&#39;s quite old but testing<br>
&gt; 1.3.4X or 2.x in the past, I got several JVM crashes or other types of<br>
&gt; issues) and I have created java bindings for it.<br>
&gt; Once I have configured LD_LIBRARY_PATH to use all SOs it needs, I have<br>
&gt; started running some ImageIO-Ext tests with maven and JVM is crashing.<br>
&gt;<br>
&gt; In case someone don&#39;t know it, ImageIO-Ext mainly allows to bridge Java&#39;s<br>
&gt; ImageIO (ImageReaders/writers/SPI) to GDAL format drivers.<br>
&gt; On several Ubuntu (8, 9, 10, 11) I never had similar problems. We regularly<br>
&gt; use ImageIO-Ext 1.1.2 built on top of GDAL 1.7.3 on projects like GeoTools,<br>
&gt; GeoServer, Udig, ... Therefore I guess it&#39;s not a problem on the<br>
&gt; ImageIO-Ext caller side. I think it could be related to the SWIG-JNI<br>
&gt; counterpart which isn&#39;t working properly or something odd with the memory<br>
&gt; usage.<br>
&gt;<br>
&gt; Does anyone have any feedback on this? (supported/never tested/won&#39;t<br>
&gt; work/need some CXX flags/... anything)<br>
&gt; I&#39;m pasting the hs_err_pid Log in case you find anything interesting.<br>
&gt; [1]: <a href="http://pastebin.com/WQkfnutJ" target="_blank">http://pastebin.com/WQkfnutJ</a><br>
<br>
</div>Hi Daniele,<br>
<br>
I&#39;ve never used ImageIO-Ext myself. Looking at the traces, the problem arise<br>
in GetMetadata_List() (but this may be just a consequence of an issue<br>
elsewhere). Do you have a simple code and associate data that could be used to<br>
reproduce the problem ?<br>
<br>
I&#39;ve tested the following code :<br>
<br>
import org.gdal.gdal.*;<br>
<br>
public class testgetmetadatalist<br>
{<br>
    public static void main(String[] args)<br>
    {<br>
        gdal.AllRegister();<br>
        Dataset ds = gdal.Open(args[0]);<br>
        for(int i=0;i&lt;1000;i++)<br>
        {<br>
            System.out.println(ds.GetMetadata_List());<br>
            System.out.println(ds.GetMetadata_List(&quot;IMAGE_STRUCTURE&quot;));<br>
            System.out.println(ds.GetRasterBand(1).GetMetadata_List());<br>
        }<br>
    }<br>
}<br>
<br>
with<br>
<a href="http://trac.osgeo.org/gdal/export/23788/trunk/autotest/gcore/data/byte.tif" target="_blank">http://trac.osgeo.org/gdal/export/23788/trunk/autotest/gcore/data/byte.tif</a> and<br>
<a href="http://trac.osgeo.org/gdal/export/23788/trunk/autotest/gcore/data/byte.img" target="_blank">http://trac.osgeo.org/gdal/export/23788/trunk/autotest/gcore/data/byte.img</a><br>
<br>
and it runs without any problem on my system (Ubuntu 10.04 64bit). I&#39;ve only<br>
tested with GDAL trunk, but I&#39;m not aware of significant fixes in the Java<br>
bindings since 1.7.3 that could explain a difference in behaviour.<br>
<br>
I&#39;ve run it under Valgrind too ( valgrind --trace-children=yes java -<br>
Djava.library.path=. -cp gdal.jar:. testgetmetadatalist byte.tif), and didn&#39;t<br>
see anything alarming (you can see a bunch of warnings due to the JVM inner<br>
working, but nothing from GDAL code). You need Valgrind 3.6.1 at least AFAIR<br>
so that valgrind works correctly with a 64bit JVM.<br>
<br>
Could you test that on your end ?<br>
<br>
As far as swig version is concerned, I believe we have used 1.3.36 in the past<br>
so that shouldn&#39;t be a problem. Perhaps you could retry with 1.3.40 that is<br>
the one I use currently ?<br>
<br>
Another track: perhaps you could try to recompile the lib*jni.so without the -<br>
O2 flag and see if it makes a difference. There was at a time a problem with the<br>
swig generated code that has caused the  -fno-strict-aliasing to be added in<br>
swig/java/GNUmakefile and that has solved the problem (I&#39;ve checked that the fix<br>
is well in 1.7.3), but perhaps there&#39;s something else with the compiler<br>
version you are using.<br>
<br>
Best regards,<br>
<br>
Even<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>-------------------------------------------------------<br>Ing. Daniele Romagnoli <br>
GeoSolutions S.A.S.<br>
Software Engineer<br>
<br>
Via Poggio alle Viti 1187<br>
55054  Massarosa (LU)<br>
Italy<br>
<br>
phone: +39 0584 962313<br>
fax:      +39 0584 962313<br><br><a href="http://www.geo-solutions.it/" target="_blank">http://www.geo-solutions.it</a><br>
<a href="http://geo-solutions.blogspot.com/" target="_blank">http://geo-solutions.blogspot.com/</a><br>
<a href="http://www.youtube.com/user/GeoSolutionsIT" target="_blank">http://www.youtube.com/user/GeoSolutionsIT</a><br><a href="http://it.linkedin.com/in/danieleromagnoli" target="_blank">http://it.linkedin.com/in/danieleromagnoli</a><br>
<br><br><span></span>-------------------------------------------------------<br><br>
</div>