LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-08-2011, 08:24 PM   #1
jan.vipin
LQ Newbie
 
Registered: Feb 2011
Posts: 7

Rep: Reputation: 0
Misbehaving gzip


Below are the outputs of a gzip extract from two different boxes

1. Box 1
(gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)),2.6.18-238.9.1.el5
gzip 1.3.5

gzip -dv somelog.txt.gz
somelog.txt.gz: 93.7% -- replaced with somelog.txt
ls -lk somelog.txt
-rw------- 1 yy yy 3043822 Jul 8 16:53 somelog.txt

2. Box 2
(gcc version 4.5.1 20100924 (Red Hat 4.5.1-4)),2.6.35.6-45.fc14.x86_64
gzip 1.4

gzip -dv somelog.txt.gz
somelog.txt.gz: -0.0% -- replaced with somelog.txt
ls -lk somelog.txt
-rw-------. 1 yy yy 193257 Jul 8 21:20 somelog.txt

Can somebody please explain me what can be the plausible reason here? (There is enough disc space in Box2, why is it just renaming the txt.gz instead of extracting it ?)

Thanks.
 
Old 07-10-2011, 08:40 AM   #2
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,137

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
Try like with like

gzip -9 somelog.txt on both boxes. gzip accepts numbers from 0-9 as comp[ression ratios.
 
Old 07-10-2011, 06:21 PM   #3
jan.vipin
LQ Newbie
 
Registered: Feb 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Re

I think there's a confusion here, I am not trying to compress the file, but I am trying to show that first box is decompressing the file correctly but the second box fails to do so.

There's adequate memory & disk space, but the second box is unable to decompress the file.

Any help is appreciated.

Thank You.
 
Old 07-11-2011, 02:53 AM   #4
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,137

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
Missed that.

There is a 'temporary file' stage for gzip. look for options in the man page relating to that. SELinux isn't going paranoid on it, is it?
 
Old 07-11-2011, 12:31 PM   #5
jan.vipin
LQ Newbie
 
Registered: Feb 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Hi,

Checked out the man page, but couldn't find anything like a temporary file stage.
Selinux is permissive, so it shouldn't have an effect.

The compressed file is about ~200MB and the uncompressed file is about ~3GB, Can that have an effect ?
 
Old 07-12-2011, 02:46 AM   #6
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,137

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
try this:

export TMP=/somewhere with 5 gigs minimum free

Don't look at free space and think it's all yours. A portion of that is reserved for root, so is not writable by any luser.
 
Old 07-13-2011, 08:20 AM   #7
jan.vipin
LQ Newbie
 
Registered: Feb 2011
Posts: 7

Original Poster
Rep: Reputation: 0
I did what you said business_kid but it doesn't seem to solve the problem. Same output.
Now we know that space isin't an issue.
 
Old 07-14-2011, 02:53 AM   #8
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,137

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
Try taking the same chunk of data and compressing it on both boxes. What happens? Also run file on each of your existing ones. Are the OSes the Same on both boxes? One of those gzips is misbehaving. Lastly, try ldd /path/to/gzip |grep found on the gzip executables.
 
Old 07-14-2011, 04:43 PM   #9
jan.vipin
LQ Newbie
 
Registered: Feb 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Compression on both the boxes works perfectly. The files are readable.

Box 1 is an RHEL5, Box 2 is FC 14.

The output of ldd is here
Box 1 (gzip-1.3.5)
ldd /usr/bin/gzip
linux-vdso.so.1 => (0x00007fff265fc000)
libc.so.6 => /lib64/libc.so.6 (0x00000032b4000000)
/lib64/ld-linux-x86-64.so.2 (0x00000032b3c00000)

Box 2 (gzip-1.4)
ldd /usr/bin/gzip
linux-vdso.so.1 => (0x00007fffe6391000)
librt.so.1 => /lib64/librt.so.1 (0x000000360ce00000)
libc.so.6 => /lib64/libc.so.6 (0x000000360ba00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000360c200000)
/lib64/ld-linux-x86-64.so.2 (0x000000360b600000)

The one in box 2 is giving the wrong output.
 
Old 07-15-2011, 04:12 AM   #10
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,137

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
There are times according to the man page (which I confess to having skimmed) that gzip does not decompress.

Quote:
file: compressed with xx bits, can only handle yy bits
File was compressed (using LZW) by a program that could deal with more bits than the decompress code on this machine. Recompress the file with gzip, which compresses better and uses less memory.

-- has xx other links: unchanged
The input file has links; it is left unchanged. See ln(1) for more information. Use the -f flag to force compression of multiply-linked files.
I would try a run with -l, -t, & -f (3 runs in total) on the offending box. Also see if you can trap the error value
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to open gzip file? I have gzip installed mhg Linux - Newbie 3 10-24-2008 02:18 AM
[gzip] appears in process table after gzip command completes redmanDBA Linux - General 0 02-26-2008 06:12 AM
apt-get update error: "gzip: stdin: not in gzip format" haertig Debian 0 08-02-2006 05:21 PM
Solaris 8 gzip issues- cannot gzip -d lynx sixosix Solaris / OpenSolaris 4 03-13-2005 03:17 PM
Why is my samba misbehaving? sapphos Linux - Networking 4 10-11-2003 02:27 PM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration