Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx01.one.com (mx01.one.com [195.47.247.72])
	by mail6.local (Postfix) with ESMTP id 697F1801509BD
	for <filtered@awaresystems.be>; Thu, 18 Oct 2012 10:17:40 +0200 (CEST)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx01: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.212.48 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48])
	by mx01.one.com (Postfix) with ESMTP id 0696ABD4C
	for <filtered@awaresystems.be>; Thu, 18 Oct 2012 08:17:39 +0000 (UTC)
Received: by mail-vb0-f48.google.com with SMTP id e21so10696107vbm.21
        for <filtered@awaresystems.be>; Thu, 18 Oct 2012 01:17:39 -0700 (PDT)
Received: by 10.220.150.16 with SMTP id w16mr4040342vcv.65.1350548259012;
        Thu, 18 Oct 2012 01:17:39 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.58.144.166 with SMTP id sn6csp400709veb;
        Thu, 18 Oct 2012 01:17:38 -0700 (PDT)
Received: by 10.220.240.18 with SMTP id ky18mr4080659vcb.54.1350548258208;
        Thu, 18 Oct 2012 01:17:38 -0700 (PDT)
Received-SPF: neutral (google.com: 195.47.247.76 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=195.47.247.76;
Received: by 10.230.97.150 with POP3 id l22mf7471912vbn.15;
        Thu, 18 Oct 2012 01:17:38 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx05.one.com (mx05.one.com [195.47.247.76])
	by mail6.local (Postfix) with ESMTP id 1A6B1801509BD
	for <info@awaresystems.be>; Thu, 18 Oct 2012 10:16:51 +0200 (CEST)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx05.one.com (Postfix) with ESMTP id AD7A12458AFE
	for <info@awaresystems.be>; Thu, 18 Oct 2012 08:16:50 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 41DF943A05E;
	Thu, 18 Oct 2012 03:15:31 -0500 (EST)
Received: from mail.justcroft.com (archive.justcroft.com [81.144.249.137])
	by lists.maptools.org (Postfix) with ESMTPS id D443843A05B
	for <tiff@lists.maptools.org>; Thu, 18 Oct 2012 03:09:20 -0500 (EST)
Received: from [192.168.1.119] ([::ffff:87.213.65.165])
	(AUTH: PLAIN hjpriester, TLS: TLSv1/SSLv3,256bits,AES256-SHA)
	by snowwhite.justcroft.com with esmtp; Thu, 18 Oct 2012 09:09:19 +0100
	id 0000000000520314.00000000507FB930.00000993
Message-ID: <507FB92F.4030704@justcroft.com>
Date: Thu, 18 Oct 2012 10:09:19 +0200
From: Henk Jan Priester <hjpriester@justcroft.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.8) Gecko/20121012 Thunderbird/10.0.8
MIME-Version: 1.0
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
References: <507EE978.1070306@justcroft.com>
	<alpine.GSO.2.01.1210171229150.24148@freddy.simplesystems.org>
	<507EF0D5.2050300@justcroft.com> <507EF846.8050301@justcroft.com>
	<alpine.GSO.2.01.1210171340570.24148@freddy.simplesystems.org>
In-Reply-To: <alpine.GSO.2.01.1210171340570.24148@freddy.simplesystems.org>
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] Que: ZIPSetupDecode errorhandling
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On 10/17/2012 08:46 PM, Bob Friesenhahn wrote:
> On Wed, 17 Oct 2012, Henk Jan Priester wrote:
>>
>> I also get the error on Linux but there it does not crash.
>> so it seems that using zlib 1.2.7 for libtiff 4.0.3 is not a good idea.
>> When not calling the error function if stream.msg = NULL the output
>> of libtiff looks oke.
>
> From my experience, installing a shared library for zlib 1.2.7 is just 
> plain dangerous because the shared library versioning claims to be 
> upward compatible with earlier versions. From what I observed, 
> applications which previously used the one provided with the OS 
> started using my zlib 1.2.7 and became very unstable and crashed. It 
> did not take long for me to realize the problem and remove my version 
> of the library. If I did not remove the library it is likely that a 
> GUI login to the system would have failed.
>
> I had to make changes in GraphicsMagick for 1.2.7 because the zlib 
> stream interface changed its handle definition from a plain 'int' to 
> something else (I think an opaque structure pointer).
>
> Bob

I have compiled and linked the program with the static version of zlib 
1.2.7 and the problem is the same.
The inflateInit function returns an error and the stream.msg = NULL.

Looking in the zlib code then in case of an error it is very likely that 
stream.msg = NULL
In the start of the inflateInit routine that are several test and 
stream.msg is NOT set.

if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
stream_size != (int)(sizeof(z_stream)))
return Z_VERSION_ERROR;
if (strm == Z_NULL) return Z_STREAM_ERROR;

An improvement for libtiff could be that the to test at sp->stream.msg 
!= NULL before calling
TIFFErrorExt

In my case the problem was caused by the 'zlib configure --solo' which
results in the Z_STREAM error from inflateInit. After not using --solo 
it worked again.

Thanks for the feedback

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
