Return-Path: <tiff-bounces@remotesensing.org>
Received: from inav006.isp.belgacom.be (inav006.isp.belgacom.be [195.238.2.75])
        by mailst034.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i9HFhC0P007834
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Oct 2004 17:43:12 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inas008.isp.belgacom.be (localhost [127.0.0.1])
        by inav006.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id i9HFhAFh022771
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Oct 2004 17:43:10 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inmx012.isp.belgacom.be (inmx012.isp.belgacom.be [195.238.3.90])
        by inas008.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id i9HFh0SF000693
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Oct 2004 17:43:01 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx012.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i9HFgiH5003858
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Oct 2004 17:42:45 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 67D133C5C3A; Sun, 17 Oct 2004 11:42:27 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from scooby.simplesystems.org (scooby.simplesystems.org
	[65.66.246.67])
	by xserve.flids.com (Postfix) with ESMTP id 031F63C5C16
	for <tiff@remotesensing.org>; Sun, 17 Oct 2004 11:42:24 -0400 (EDT)
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by scooby.simplesystems.org (8.12.10+Sun/8.12.10) with ESMTP id
	i9HFgN9p002059
	for <tiff@remotesensing.org>; Sun, 17 Oct 2004 10:42:24 -0500 (CDT)
Date: Sun, 17 Oct 2004 10:42:23 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@blade.simplesystems.org
To: tiff@remotesensing.org
Message-ID: <Pine.SOC.4.60.0410171004270.2727@blade.simplesystems.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Subject: [Tiff] libtiff 3.7.0 dumps core while writing photoshop tag
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 68d8fe919928c4a61476c91b80f0588d

During the libtiff 3.7 development cycle it was noted that 
TIFFWriteDirectory() causes a core dump while writing the photoshop 
tag.  The problem is noticed with GraphicsMagick and has been 
replicated with three major GraphicsMagick release branches (which use 
substantially different tiff support code). This problem is still 
evident with the 3.7.0 release.

It appears likely that the stack is becoming corrupted since a debug 
backtrace shows that a stack value (filename pointer) has been 
altered.

(gdb) bt
#0  0x00000208 in ?? ()
#1  0x282beb7f in TIFFWriteDirectory (tif=0x828e400)
     at /home/bfriesen/src/graphics/libtiff/libtiff/tif_dirwrite.c:401
#2  0x081a99dc in WriteTIFFImage (image_info=0x82fb000, image=0x82fe000)
     at /home/bfriesen/src/graphics/GraphicsMagick-head/coders/tiff.c:2497
#3  0x080866db in GmWriteImage (image_info=0x82ba000, image=0x82fe000)
     at /home/bfriesen/src/graphics/GraphicsMagick-head/magick/constitute.c:4262
#4  0x08086a90 in GmWriteImages (image_info=0x82ba000, image=0x82fe000,
     filename=0x1 <Address 0x1 out of bounds>, exception=0xbfbfec7c)
     at /home/bfriesen/src/graphics/GraphicsMagick-head/magick/constitute.c:4370
#5  0x0805eae9 in GmConvertImageCommand (image_info=0x82ba000, argc=3,
     argv=0x82be000, metadata=0x0, exception=0xbfbfec7c)
     at /home/bfriesen/src/graphics/GraphicsMagick-head/magick/command.c:4649
#6  0x08065590 in GmMagickCommand (image_info=0x82ba000, argc=3,
     argv=0xbfbff4f0, metadata=0xbfbfec78, exception=0xbfbfec7c)
     at /home/bfriesen/src/graphics/GraphicsMagick-head/magick/command.c:7216
#7  0x08050569 in main (argc=3, argv=0xbfbff4f0)
     at /home/bfriesen/src/graphics/GraphicsMagick-head/utilities/gm.c:150
#8  0x08050365 in _start ()

The problem is evident under Solaris (SPARC) and FreeBSD (Intel 
Pentinum IV) using GCC 3.4.2, and under FreeBSD using GCC 3.2.1. 
Libtiff 3.6.1 worked fine in these environments.

Interestingly, the problem does not occur under Linux using GCC 3.3.3 
and GraphicsMagick valgrinds clean with libtiff 3.7.0 during the 
conversion operation.

Since GraphicsMagick preserves the Photoshop tag when converting TIFF 
files, this problem makes libtiff 3.7.0 useless for use with 
GraphicsMagick (except for maybe under Linux).

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
