From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1 Description of problem: I noticed rpm was hanging when I tried to remove some packages with the standard rpm -e <packagename>. I did an strace rpm -e <packagename> and found this: read(4, "/dev/hda6 / ext3 rw 0 0\nnone /pr"..., 4096) = 314 stat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0 stat64("/proc/bus/usb", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0 stat64("/boot", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0 stat64("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64("/dev/pts", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 stat64("/dev/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...}) = 0 stat64("/mnt/fat", {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0 stat64("/mnt/nfs", as you can see, it is hanging on the /mnt/nfs.. It's been like this for the past 5 minutes (still is while I'm writing this bug report). If I unmount it works fine. I guess the question is why is rpm -e reading my mount points, and 2ndly, why is it hanging on a stale NFS mountpoint? Maybe you guys need to put a timeout feature on the function that checks all the mount points? Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Mount a nfs directory. 2. Make it stale. 3. Attempt to rpm -e a package. Actual Results: rpm hangs indefinitely. Expected Results: The package should be removed. Additional info: my rpm is rpm-4.2-0.69.
I have this same problem with smbfs file systems.
Yup. In order to do disk space checks, rpm needs to know the size of all mounted file systems. This is done with statvfs, which also does a stat on each mount point. If/when the stat blocks, then rpm hangs.
Ok.. so what you are saying is that this is a bug in stat? Shouldn't rpm be smart enough to know if stat is taking too long to either die and report an error or skip that mounted filesystem altogether? If I were to write a patch for rpm or stat, where would I be looking?
No, stat is behaving exactly as it should. The problem (I'm told, iirc) is in the statvfs implementation in glibc, which walks and stats every entry in /etc/mtab even though statvfs was called with single mount point. Easiest by far is to add --ignoresize when invoking and skip the stal nfs (or smbfs) mount.
Try again, #packaging and/or #fedora, usually after 7pm EDT