AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
July 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.07.02 18:15 "Access violation in TiffOpen Function in "write" mode", by <acanicio@astrosnap.com>
2009.07.04 16:55 "Re: Access violation in TiffOpen Function in "write" mode", by <acanicio@astrosnap.com>
2009.07.04 17:30 "Re: Access violation in TiffOpen Function in "write" mode", by Toby Thain
2009.07.04 17:51 "Re: Access violation in TiffOpen Function in "write" mode", by Bob Friesenhahn

2009.07.04 17:51 "Re: Access violation in TiffOpen Function in "write" mode", by Bob Friesenhahn

On Sat, 4 Jul 2009, acanicio wrote:
>
> I just found out that I have the same problem with another program, and also
> in "r" mode...
> I just spent the last 6 hours trying to figure out the problem...
>
> And something incredible happened.
>
> Now it works.  :jumping: Without having changed a single line of code !!.
>
> I just set the "record field alignment" in the delphi compiler options to
> "4" instead of "2".
>
> Geee... Can anybody explain to me why a value of "2" or "1" this ends up
> crashing when using libtiff ? :confused:

On some CPU types (probably not yours though) unaligned word access 
will cause a segmentation violation.  In some cases this is a compiler 
option since the application could arrange use less efficient 
byte-level access to access the data word, or the OS could trap to a 
function which does so.

It is likely that the old libtiff you are using has bugs in that it is 
making assumptions about alignment, endian order, or word size. 
Oodles of such bugs have been fixed over time.  During my short time 
of helping out with libtiff, I have observed more bugs in the 
directory tag code than any other part of libtiff.

Regardless, you are likely to see better application performance when 
you compiler uses a default alignment of 4 rather than something less.

Defaulting to a word alignment of 2 and use of tiny data types for 
enumerations are Borland oddities which don't match up with MSVC does.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/