Bug 126775

Summary: [PATCH] compress does not work if the file size is greater than 2GB
Product: Red Hat Enterprise Linux 3 Reporter: Bernd Schmidt <bernds>
Component: ncompressAssignee: Jeff Johnson <jbj>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-07-14 17:23:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 126776    
Attachments:
Description Flags
A patch which seems to fix the problem none

Description Bernd Schmidt 2004-06-26 13:14:29 UTC
From Issue Tracker (41696):

Problem:
  When the file they are compressing is greater than 2GB, they get a
segmentation fault. 

This problem has been seen at customer site and duplicated on our lab
on two systems.

Also see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=66311
possible same symptom/problem

Comment 1 Bernd Schmidt 2004-06-26 13:18:42 UTC
Customer reported this against AS2.1, but RHEL3 still seems to have
the problem.  We'll need the RHEL3 package moved into AS2.1 once the
fix has been applied; I'll open a separate bugzilla for this.

Comment 2 Bernd Schmidt 2004-06-26 13:21:17 UTC
Created attachment 101437 [details]
A patch which seems to fix the problem

There was one file-size related variable ("checkpoint") left which was declared
as "long"; changing that to "long long" appears to fix the segfault.  I can't
really follow the algorithm, but apparently it got confused once "checkpoint"
became negative, and it tried to write past the end of an array.

Note that to reproduce the problem it seems you need a file with actual 2GB of
data or more; I failed to cause a segfault with a test file which was only
holes below 2G and a bit of data above that.

Comment 3 Jeff Johnson 2004-07-14 16:39:28 UTC
This test in progress, packages immediately after success:

sudo dd if=/dev/sda1 bs=1M | compress -c | uncompress -c > /dev/null

Comment 4 Jeff Johnson 2004-07-14 17:23:11 UTC
Fixed in
    ncompress-4.2.4-37 in AS2.1-errata-candidate
    ncompress-4.2.4-38 in 3.0-U3-HEAD
Apologies for the delay.