Description of problem: The compress command seems to be having trouble compressing files. If I try to compress a 1G file the commands produces a return value of 2 and no compressed file is created. If I try to compress a 2G file, a compressed file is created but the command also seems to generate a 'Segmentation fault'. I am running 'Red Hat Linux release 9 (Shrike)' which comes with ncompress-4.2.4- 33. [patrick@sprout tmp]$ dd if=/dev/urandom of=large bs=1024 count=1048576 1048576+0 records in 1048576+0 records out [patrick@sprout tmp]$ ls -lh total 1.1G -rw------- 1 patrick patrick 1.0G Apr 29 16:32 large [patrick@sprout tmp]$ compress large [patrick@sprout tmp]$ echo $? 2 [patrick@sprout tmp]$ ls -lh total 1.1G -rw------- 1 patrick patrick 1.0G Apr 29 16:32 large [patrick@sprout tmp]$ cat large large > xlarge [patrick@sprout tmp]$ ls -lh total 3.1G -rw------- 1 patrick patrick 1.0G Apr 29 16:32 large -rw------- 1 patrick patrick 2.0G Apr 29 16:47 xlarge [patrick@sprout tmp]$ compress xlarge Segmentation fault [patrick@sprout tmp]$ echo $? 139 [patrick@sprout tmp]$ ls -lh total 5.5G -rw------- 1 patrick patrick 1.0G Apr 29 16:32 large -rw------- 1 patrick patrick 2.0G Apr 29 16:47 xlarge -rw------- 1 patrick patrick 2.5G Apr 29 17:08 xlarge.Z [patrick@sprout tmp]$ Version-Release number of selected component (if applicable): ncompress-4.2.4-33 How reproducible: Every time Steps to Reproduce: 1. dd if=/dev/urandom of=large bs=1024 2. cat large large > xlarge 3. compress xlarge Actual results: xlarge.Z is created and Segmentation fault is displayed Expected results: Segmentation fault should not have occurred Additional info:
I e-mailed the following patch to ncompress not long ago but didn't receive a reply. I suspect that this might fix the segmentation fault problem, at least. From: David Hull <hull> To: teg Subject: ncompress 32-bit bug Date: Thu, 29 May 2003 16:22:28 -0700 The compress application that comes with Red Hat Linux 7.3 (and 9 as well) had a problem compressing a large (>2GB) file. This is version ncompress-4.2.4-28. The attached patch fixes the problem for me. (I'm sending this to you because you entered the last entry in the RPM .spec file.) -- David Hull --- compress42.c.orig Thu May 29 12:02:53 2003 +++ compress42.c Thu May 29 15:43:27 2003 @@ -1355,7 +1355,7 @@ REG11 int boff; REG12 int n_bits; REG13 int ratio; - REG14 long checkpoint; + REG14 long long checkpoint; REG15 code_int extcode; union {
Fixed in latest ncompress.