<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
in my case o is not a null pointer, as o-&gt;tdir_count is 1.<br><br>-- Dan Greve<br>-- Software Engineer<br>-- Northrop Grumman Corp.<br><br>&gt; From: andy.cave@hamillroad.com<br>&gt; To: even.rouault@mines-paris.org; gdal-dev@lists.osgeo.org<br>&gt; CC: grevedan@hotmail.com; tiff@lists.maptools.org; Shawn.Gong@drdc-rddc.gc.ca<br>&gt; Subject: Re: [Tiff] Re: [gdal-dev] Problem with libTiff on Solaris 10<br>&gt; Date: Fri, 30 May 2008 20:40:43 +0200<br>&gt; <br>&gt; Hi Even,<br>&gt; <br>&gt; Yes IIRC from when I worked/coded on them SPARCS need to do aligned <br>&gt; accesses, or you get a trap.<br>&gt; <br>&gt; But without knowing the code, also, o could be a null pointer (is it <br>&gt; asserted as not being null on entry to the function or where it's <br>&gt; set/calculated/extracted?).<br>&gt; <br>&gt; Regards,<br>&gt; <br>&gt; Andy.<br>&gt; <br>&gt; ----- Original Message ----- <br>&gt; From: "Even Rouault" &lt;even.rouault@mines-paris.org&gt;<br>&gt; To: &lt;gdal-dev@lists.osgeo.org&gt;<br>&gt; Cc: "Dan Greve" &lt;grevedan@hotmail.com&gt;; "TIFF mailing list" <br>&gt; &lt;tiff@lists.maptools.org&gt;; "Gong,Shawn (Contractor)" <br>&gt; &lt;Shawn.Gong@drdc-rddc.gc.ca&gt;<br>&gt; Sent: Friday, May 30, 2008 7:18 PM<br>&gt; Subject: [Tiff] Re: [gdal-dev] Problem with libTiff on Solaris 10<br>&gt; <br>&gt; <br>&gt; Hi,<br>&gt; <br>&gt; Hum, I'm not a specialist of SPARC at all, but doesn't this architecture<br>&gt; require proper memory alignment accesses ?<br>&gt; <br>&gt; I say that because the crash on " *(uint32*)n=(uint32)o-&gt;tdir_count " could <br>&gt; be<br>&gt; easily explained if the memory address pointed by 'n' is not aligned on a 4<br>&gt; byte address....<br>&gt; In the next few lines of the code extract Dan Greve has quoted, I<br>&gt; see "_TIFFmemcpy(n,&amp;o-&gt;tdir_offset,4)" which is a safer way of dealing with<br>&gt; this alignment problems...<br>&gt; <br>&gt; It looks like a libtiff problem, so I add the libtiff mailing list in CC <br>&gt; too.<br>&gt; <br>&gt; Best regards,<br>&gt; Even<br>&gt; <br>&gt; -------------------------------------------------------------------------------------<br>&gt; <br>&gt; RE: [gdal-dev] Problem with libTiff on Solaris 10<br>&gt; De :<br>&gt; "Gong, Shawn (Contractor)" &lt;Shawn.Gong@drdc-rddc.gc.ca&gt;<br>&gt;   À :<br>&gt; "Dan Greve" &lt;grevedan@hotmail.com&gt;, gdal-dev@lists.osgeo.org<br>&gt;   Date :<br>&gt; Aujourd'hui 18:54:44<br>&gt; <br>&gt; Dan and list,<br>&gt; <br>&gt; This error looks very similar to what I have experienced on our Sun machine,<br>&gt; trying to build and run gdal 1.5.1.<br>&gt; Our Sun system is SPARC Solaris 9 64-bit.<br>&gt; <br>&gt; Error message when Python codes call "gtiff_driver.CreateCopy( fname,<br>&gt; vrtds, ...)"<br>&gt; ERROR 1: /home/sgong/../working_dir/test2.tif:No space to read TIFF <br>&gt; directory<br>&gt; ERROR 1: TIFFReadDirectory:Failed to read directory at offset 8 Bus error<br>&gt; (core dumped)<br>&gt; <br>&gt; <br>&gt; thanks,<br>&gt; Shawn<br>&gt; <br>&gt; ________________________________________<br>&gt; From: gdal-dev-bounces@lists.osgeo.org<br>&gt; [mailto:gdal-dev-bounces@lists.osgeo.org] On Behalf Of Dan Greve<br>&gt; Sent: Friday, May 30, 2008 11:51 AM<br>&gt; To: gdal-dev@lists.osgeo.org<br>&gt; Subject: [gdal-dev] Problem with libTiff on Solaris 10<br>&gt; <br>&gt; Greetings,<br>&gt; <br>&gt; I am using the latest stable build, gdal-1.5.1 on a SPARC Solaris 10 64-bit<br>&gt; system. It is configured with the default drivers, but is<br>&gt; using --with-jpeg=internal --with-libtiff=internal --with-geotiff=internal.<br>&gt; Using the 32-bit compiler options and libraries, I can successfully build<br>&gt; libgdal.so and the utility programs. However, when trying to do a<br>&gt; gdal_translate from one simple uncompressed 3-band geotiff into another<br>&gt; simple uncompressed 3-band geotiff, I get a "bus error" segfault. Also, if<br>&gt; the output tiff already exists I get two errors. "No space to read tiff<br>&gt; directory" and "TiffReadDirectory: failed to read directory at offset 8". A<br>&gt; quick google revealed two similiar errors, here and here. Diving into the<br>&gt; debugger, the problem seems to lie in the tif_dirwrite.c, starting with line<br>&gt; 755. I believe it's due to _TIFFmalloc not allocating memory properly. The<br>&gt; crash actual occurs on line 781, *(uint32*)n=(uint32)o-&gt;tdir_count;<br>&gt; <br>&gt; o-&gt;tdir_count is valid, but setting n to any value causes a segfault, as<br>&gt; though TIFFmalloc did not allocate the whole requested 186 bytes. Any ideas?<br>&gt; <br>&gt; &lt;snip file=tif_dirwrite.c&gt;<br>&gt; dirmem=_TIFFmalloc(dirsize);<br>&gt; if (dirmem==NULL)<br>&gt; {<br>&gt; TIFFErrorExt(tif-&gt;tif_clientdata,module,"Out of memory");<br>&gt; goto bad;<br>&gt; }<br>&gt; if (!(tif-&gt;tif_flags&amp;TIFF_BIGTIFF))<br>&gt; {<br>&gt; uint8* n;<br>&gt; TIFFDirEntry* o;<br>&gt; n=dirmem;<br>&gt; *(uint16*)n=ndir;<br>&gt; if (tif-&gt;tif_flags&amp;TIFF_SWAB)<br>&gt; TIFFSwabShort((uint16*)n);<br>&gt; n+=2;<br>&gt; o=dir;<br>&gt; for (m=0; m&lt;ndir; m++)<br>&gt; {<br>&gt; *(uint16*)n=o-&gt;tdir_tag;<br>&gt; if (tif-&gt;tif_flags&amp;TIFF_SWAB)<br>&gt; TIFFSwabShort((uint16*)n);<br>&gt; n+=2;<br>&gt; *(uint16*)n=o-&gt;tdir_type;<br>&gt; if (tif-&gt;tif_flags&amp;TIFF_SWAB)<br>&gt; TIFFSwabShort((uint16*)n);<br>&gt; n+=2;<br>&gt; *(uint32*)n=(uint32)o-&gt;tdir_count;<br>&gt; if (tif-&gt;tif_flags&amp;TIFF_SWAB)<br>&gt; TIFFSwabLong((uint32*)n);<br>&gt; n+=4;<br>&gt; _TIFFmemcpy(n,&amp;o-&gt;tdir_offset,4);<br>&gt; n+=4;<br>&gt; o++;<br>&gt; }<br>&gt; *(uint32*)n = (uint32)tif-&gt;tif_nextdiroff;<br>&gt; }<br>&gt; &lt;/snip&gt;<br>&gt; <br>&gt; -- Dan Greve<br>&gt; -- Software Engineer<br>&gt; -- Northrop Grumman Corp.<br>&gt; <br>&gt; _______________________________________________<br>&gt; Tiff mailing list: Tiff@lists.maptools.org<br>&gt; http://lists.maptools.org/mailman/listinfo/tiff<br>&gt; http://www.remotesensing.org/libtiff/ <br>&gt; <br>&gt; <br><br /><hr />E-mail for the greater good. <a href='http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ GreaterGood' target='_new'>Join the i’m Initiative from Microsoft.</a></body>
</html>