From: CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 17-MAR-1989 22:50 To: MRGATE::"ARISIA::EVERHART" Subj: Re: Compress/Decompress problems Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 16 MAR 89 14:59:13 PDT Received: from uunet.UU.NET by KL.SRI.COM with TCP; Thu, 16 Mar 89 14:51:02 PST Received: from munnari.UUCP by uunet.UU.NET (5.61/1.14) with UUCP id AA12413; Thu, 16 Mar 89 17:51:00 -0500 Received: from levels.sait.oz (via mimir) by munnari.oz with SunIII (5.5) id AA02795; Fri, 17 Mar 89 09:31:38 EST (from CCDN@levels.sait.oz for uunet!info-vax@kl.sri.com) Received: from levels.sait.oz by PISA.sait.oz (4.44/SAIT 1.0) id AA00746; Thu, 16 Mar 89 17:41:24 CST Message-Id: <8903160711.AA00746@PISA.sait.oz> Date: Thu, 16 Mar 89 17:49 +1030 From: DAVID NEWALL Subject: Re: Compress/Decompress problems To: info-vax@kl.sri.com X-Vms-To: in%"info-vax@kl.sri.com" Path: levels!ccdn From: ccdn@levels.sait.edu.au (DAVID NEWALL) Newsgroups: comp.os.vms Subject: Re: Compress/Decompress problems Message-ID: <1762@levels.sait.edu.au> Date: 16 Mar 89 17:48:01 GMT References: <8903132157.AA09874@ucbvax.Berkeley.EDU> Organization: Sth Australian Inst of Technology Lines: 54 In article <8903132157.AA09874@ucbvax.Berkeley.EDU>, Brian.T.Carcich@CUSPIF.TN.CORNELL.EDU writes: > I have lzw from kuhub, I am running vms 4.5, and I get the following > results with both the ftp'ed lzdcmp.exe and a rebuilt one: > > The decompression step: > > $ lzd/show=all/exp=unix a.a_z a.a_u > > Decompress didn't finish correctly. > Error when decompressing "A.A_Z" to "A.A_U" > %NONAME-W-NOMSG, Message number 00000000 I am running VMS 5.0 and get similar results. With /SHOW=(ALL,DEBUG), I get the following [extract only]: $ decompress ... ... code_count 850 9: 00 01 48 72 18 c2 06 17 d4 Read LZ_CLEAR(256) code_count 851 -1: Decompress didn't finish correctly. I assumed a bug. In fact, I'm sure of it, because I found a guaranteed bug in lz.h. Consider the definition of the FAIL macro: #define FAIL(why, status) \ fprintf(stderr, "fatal: %s\n", why); \ longjmp(failure, status); Consider how it was used (from lzdcm1.c): #if VMS_V4 ... #else if ((export & EXPORT_VMS) != 0) FAIL("VMS private mode not supported", EXIT_FAILURE); #endif Obviously wrong, yes? [Hint: it expands to ``if (...) fprintf(); longjmp();''] The fix for this bug was simple: put braces around the expansion for FAIL. But I figure that where there's one bug, there's maybe another; and that's why the decompression doesn't complete. Actually, I wish someone could send us a patch to fix this, because lzw seems otherwise quite good! David Newall Phone: +61 8 343 3160 Unix Systems Programmer Fax: +61 8 349 6939 Academic Computing Service E-mail: ccdn@levels.sait.oz.au SA Institute of Technology Post: The Levels, South Australia, 5095