[comp.sources.d] help with arc

dave@arnold.UUCP (Dave Arnold) (10/04/88)

I am trying to build arc for System V.  Everything compiles
and runs ok---except it always creates corrupted archives.
Anybody have similar problems?
-- 
Dave Arnold
dave@arnold.UUCP	{cci632|uunet}!ccicpg!arnold!dave

rosenkra@Alliant.COM (Bill Rosenkranz) (10/05/88)

In article <204@arnold.UUCP> dave@arnold.UUCP (Dave Arnold) writes:
->I am trying to build arc for System V.  Everything compiles
->and runs ok---except it always creates corrupted archives.
->Anybody have similar problems?
->-- 
->Dave Arnold
->dave@arnold.UUCP	{cci632|uunet}!ccicpg!arnold!dave

i had a similar problem, porting a vax version to a 68000 architecure
running BSD 4.2. you need to swap bytes in timetamps, etc. i don't recall
which files, but if u want i can email the new routine...find out if
your original code was from a vax (which handles byte order like 808x).

-bill rosenkranz

rosenkra@alliant.com
linus!alliant!rosenkra
rutgers!mit-eddie!alliant!rosenkra

dave@arnold.UUCP (Dave Arnold) (10/07/88)

Alan Strassberg <ccicpg!sun!oetl1!alan> writes:
In article <204@arnold.UUCP> you write:
>I am trying to build arc for System V.  Everything compiles
>and runs ok---except it always creates corrupted archives.
>Anybody have similar problems?

	What version of arc ? What computer are you using ?
	How are the archives 'corrupted' ? Fail CRC check ?
	If you you answer this then maybe the net (and I)
	could help. 

					alan

Okay, sorry about that.  Here are the details:

My system: AT&T UNIXpc 3B1 running System V.2 3.5

What version of ARC?  Well:

--------------------------------------------------
/*
 * $Header: arc.c,v 1.12 88/07/31 18:39:50 hyc Exp $
 */

/*  ARC - Archive utility
  
    Version 5.21, created on 04/22/87 at 15:05:21

--end

I added the "-DSYSV=1" flag in the makefile.

Everything compiles and links perfectly.  The only problems
I had were gathering some scandir, opendir, readdir, closedir
routines together.  I am using some stuff I hacked up from netnews.

Now here is what happens when I create an archive:

$ arc a test.arc *
Creating new archive: test.arc
Adding file:   1431           analyzing, crunched, done. (14%)
Adding file:   1432           analyzing, crunched, done. (35%)
Adding file:   1433           analyzing, crunched, done. (23%)
Adding file:   1434           analyzing, crunched, done. (29%)
Adding file:   1435           analyzing, crunched, done. (32%)
Adding file:   1436           analyzing, crunched, done. (24%)
Adding file:   1437           analyzing, crunched, done. (28%)
Adding file:   1438           analyzing, crunched, done. (33%)
Adding file:   1439           analyzing, crunched, done. (34%)
Adding file:   1440           analyzing, crunched, done. (35%)
Adding file:   1441           analyzing, crunched, done. (28%)
Adding file:   1442           analyzing, crunched, done. (27%)
Adding file:   1443           analyzing, crunched, done. (39%)
Adding file:   1444           analyzing, crunched, done. (38%)
Adding file:   1445           analyzing, crunched, done. (24%)
Adding file:   1446           analyzing, crunched, done. (19%)
Adding file:   1447           analyzing, crunched, done. (22%)

---end

Now, here is what happens if I try to extract the archive:

$ arc t test.arc
Testing file: 1431          okay
Testing file: 1432          Corrupted compressed file.
Invalid code 905 when max is 840.
WARNING: File 1432 fails CRC check
An entry in test.arc has a bad header.  1082 bytes skipped.
Testing file: 1433          okay
Testing file: 1434          Corrupted compressed file.
Invalid code 1002 when max is 828.
WARNING: File 1434 fails CRC check
An entry in test.arc has a bad header.  644 bytes skipped.
Testing file: 1435          Corrupted compressed file.
Invalid code 333 when max is 257.
WARNING: File 1435 fails CRC check
An entry in test.arc has a bad header.  436 bytes skipped.
Archive truncated in file ^*%^HGF
13 errors detected

---end

NOTE: If I actually had ARC try and extract something, my directory gets
trashed!

Does this look familiar to anybody?

Thanks for hearing me out.
-- 
Dave Arnold
dave@arnold.UUCP	{cci632|uunet}!ccicpg!arnold!dave

coffin@duster.UUCP (Dracula) (10/07/88)

#$ arc t test.arc
#Testing file: 1431          okay
#Testing file: 1432          Corrupted compressed file.
#Invalid code 905 when max is 840.
#WARNING: File 1432 fails CRC check
#An entry in test.arc has a bad header.  1082 bytes skipped.
#Testing file: 1433          okay
#Testing file: 1434          Corrupted compressed file.
#Invalid code 1002 when max is 828.
#WARNING: File 1434 fails CRC check
#An entry in test.arc has a bad header.  644 bytes skipped.
#Testing file: 1435          Corrupted compressed file.
#Invalid code 333 when max is 257.
#WARNING: File 1435 fails CRC check
#An entry in test.arc has a bad header.  436 bytes skipped.
#Archive truncated in file ^*%^HGF
#13 errors detected

I also have this problem, however, when I download the file to a PC, it is just
fine. If anyone knows how to make it work on Un*x (5.2) 68020 CPU, VMEBUS etc.
PLEASE post the patches or fixes. I have been meaning to crank up sdb on it,
but I have several other higher priority projects going right now. 

Thanx!

Chris Coffin
hplabs!hp-sdd!crash!xroads!coffin
coffin@xroads.UUCP

res@cbnews.ATT.COM (Robert E. Stampfli) (10/08/88)

In article <209@arnold.UUCP> dave@arnold.UUCP (Dave Arnold) writes:
>>I am trying to build arc for System V.  Everything compiles
>>and runs ok---except it always creates corrupted archives.
>>Anybody have similar problems?

I tried mailing this to Dave, but apparently he didn't get it -- maybe
others will find it useful, too.  From his later posting, I am certain
he was bit by the same bug I was.

I am running a Unix-PC 7300 with version 3.5 of the OS (all known fixes
applied).  This is what I did to make the ARC 5.21 distributed by Howard
Chu useable on my UNIX-pc:

1. In file arccode.c, look at the last function, code(), and change
   the declaration for the argument from "char c" to "unsigned char c".
   This circumvents a compiler bug which manifests itself in a sign
   extension problem on 8-bit quantities returned by code().  ARC will
   now decode crunched data correctly.

2. In file arcusq.c, look for the declaration of structure nd and change
   the instance of "int child[2]" to "short child[2]".  This circumvents
   a compiler bug which causes problems with the unsqueeze of a large
   squeezed file.  (Not to mention saving a little space.)

3. In file arcpack.c, look for the line that prints the percent compression
   and insert a check to prevent the divide by zero that occurs if you try
   to insert a zero length file into an archive.  This is a program bug.


Hope this helps,
Rob Stampfli
att!cbnews!res
osu-cis!n8emr!kd8wk!res

dave@arnold.UUCP (Dave Arnold) (10/10/88)

res@cbnews.ATT.COM (Robert E. Stampfli) writes:
> In article <209@arnold.UUCP> dave@arnold.UUCP (Dave Arnold) writes:
>> [blah, blah, blah]
> 
> 1. In file arccode.c, look at the last function, code(), and change
>    the declaration for the argument from "char c" to "unsigned char c".

Yeah, I applied the changed, and it now works.  I also applied you other
bug fixes.  Thank you very much Robert!
-- 
Dave Arnold (dave@arnold.UUCP)
Work: Volt Delta Resources     Phone: (714) 921-7635
Home: 26561 Fresno street,  Mission Viejo, Ca  92691