Bug 340 - tar works horribly slow with fakeroot
Summary: tar works horribly slow with fakeroot
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Bruno Cornec
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2011-03-11 14:27 CET by MichaÅ Walenciak
Modified: 2012-05-11 22:35 CEST (History)
3 users (show)

See Also:
Source RPM: fakeroot-1.14.4-1.mga1.src.rpm
CVE:
Status comment:


Attachments

Description MichaÅ Walenciak 2011-03-11 14:27:16 CET
Description of problem:

If I use fakeroot on tar like this:
fakeroot tar -xf linux-2.6.37.3.tar.bz2 
tar is very slow. No cpu nor disk is used (hardly). Package is being unpacked but I was too unpatient to mesure how long would it take ;)

the problem doesn't affect ie bzip2

Version-Release number of selected component (if applicable):

fakeroot version 1.14.4
tar (GNU tar) 1.25


How reproducible:
always

Steps to Reproduce:
1. untar something big with tar + fakeroot


Reproducible: 

Steps to Reproduce:
Comment 1 MichaÅ Walenciak 2011-03-11 14:28:47 CET
I forgot to say that there is no problem with tar without fakeroot:

time tar -xf linux-2.6.37.3.tar 

real    0m33.677s
user    0m0.293s
sys     0m4.257s
Thierry Vignaud 2011-03-15 09:57:56 CET

CC: (none) => thierry.vignaud
Assignee: bugsquad => pterjan

Comment 2 Pascal Terjan 2011-03-15 20:56:36 CET
I tried with fakeroot tar -xf linux-2.6.37.3.tar and stopped it after 8 minutes.

None of the process (tar/faked) had been using much cpu and it had not made big progress

 5067 pterjan   20   0  2500 1056  880 S    1  0.0   0:02.79 tar                                                                                                                 
 5060 pterjan   20   0  2472 1012  252 S    0  0.0   0:00.78 faked                                                                                                               

Looking at strace it seems "normal", tar is sort of worst case for fakeroot.
When running as root, tar will do additionnal things: chown the files to their original user and restore original permissions. So tar keeps doing some stat/chown/chmod and each of them means communicating with faked over tcp...

$ time fakeroot tar --no-same-owner --no-same-permissions -xf linux-2.6.37.3.tar  
real	1m25.951s
user	0m0.820s
sys	0m4.790s

(--no-same-owner --no-same-permissions are the default when not running as root)
Comment 3 MichaÅ Walenciak 2011-03-16 08:26:45 CET
yeah I've been stracing tar too and I've same conclusions.
Fakeroot uses some tcp communication with faked process? 
Anyway I tried fakeroot + tar under debian and it's ok.
I've also tried mandirva's fakeroot and it's broken too.
Comment 4 Pascal Terjan 2011-03-16 08:51:42 CET
It is on Mandriva and Mageia because it is built with --with-ipc=tcp
I don't know why...
Comment 5 Thierry Vignaud 2011-03-16 09:45:44 CET
OK we've a solution then

Keywords: (none) => PATCH

Comment 6 Pascal Terjan 2011-03-16 09:53:09 CET
Would be nice to know why oden changed it
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages?view=revision&revision=162573
Comment 7 MichaÅ Walenciak 2011-03-18 09:26:01 CET
I've build fakeroot by myself without tcp. I'll test it and let You know if there are any other issuses with it.
Comment 8 MichaÅ Walenciak 2011-03-19 19:01:37 CET
for me looks ok
Comment 9 Marja Van Waes 2011-10-05 17:55:55 CEST
@ Pascal

Any news on this bug? Does it still exist?

CC: (none) => marja11

Comment 10 Marja Van Waes 2012-01-07 22:20:26 CET
we still have the same version of fakeroot since it was imported, so it didn't get fixed.


@ Pascal
@ Bruno

Bruno is the maintainer of fakeroot now, can this bug be re-assigned to him?

CC: (none) => bruno

Comment 11 Marja Van Waes 2012-04-11 16:58:29 CEST
(In reply to comment #10)
> we still have the same version of fakeroot since it was imported, so it didn't
> get fixed.
> 
> 
> @ Pascal
> @ Bruno
> 
> Bruno is the maintainer of fakeroot now, can this bug be re-assigned to him?

3 Months later now, reassigning to Bruno
If that is wrong: tell me

Assignee: pterjan => bruno

Comment 12 Bruno Cornec 2012-05-11 22:35:17 CEST
Uploaded the recompiled as suggested above for Mageia 2

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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