Bug 89938 - compress causes Segmentation fault
compress causes Segmentation fault
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: ncompress (Show other bugs)
9
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Jeff Johnson
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-29 20:30 EDT by Patrick Melo
Modified: 2007-04-18 12:53 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-23 07:36:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Patrick Melo 2003-04-29 20:30:32 EDT
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:
Comment 1 David Hull 2003-07-14 19:21:40 EDT
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@paracel.com>
To: teg@redhat.com
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
                {
Comment 2 Jeff Johnson 2004-08-23 07:36:22 EDT
Fixed in latest ncompress.

Note You need to log in before you can comment on or make changes to this bug.