duplicate ids in /proc/locks
Hi All,
Red Hat Enterprise Linux Server release 5.4 (Tikanga) 2.6.18-164.11.1.el5xen (Xen release for virtualisation) I'm trying to track down a problem with a utility that used to work and now hangs indefinitely. Since its hanging, I suspected a locking problem, and went to have a look for the process ids in /proc/locks; I get: 148: FLOCK ADVISORY WRITE 30279 ca:21:49153 0 EOF 148: -> FLOCK ADVISORY READ 30282 ca:21:49153 0 EOF Now as near as I can tell this shouldn't be my problem, since the two ADVISORY locks - one READ and one WRITE - shouldn't conflict with one another. But I'd like to understand it all the same. I haven't been able to find any kind of definitive guide for the format of /proc/locks entries, but what I did find in the manuals specifically states: "Each lock has its own line which starts with a unique number. " Which is obviously not true; both of my lines start with the same number. Also, since most search engines don't seem to play nicely with symbols, I can't find any reference to what the "->" means. Can anyone explain? Or point me to a good reference? Thanks much, - rob. |
man 5 proc
As for your 'hanging process', I would use strace to find what resource it is trying to acquire or wait on. strace -o /var/tmp/foo myProg You may need to use -f, ymmv. |
man 5 proc has this to say about /proc/locks:
Quote:
But strace is a useful one that I hadn't used before - thanks for the pointer. |
Quote:
|
I'm replying to this because there is so little information about the format of /proc/locks
Your output clearly shows why you have deadlock, if only you knew how to read it. 148: FLOCK ADVISORY WRITE 30279 ca:21:49153 0 EOF 148: -> FLOCK ADVISORY READ 30282 ca:21:49153 0 EOF The first line shows one lock (id. 148) held by process with pid 30279. This is a write lock. The second line shows a process is waiting to acquire the lock. It's pid 30282 and the "->" shows it's waiting to acquire the lock. It wants a read lock. You need to figure out why process 30279 is holding a write lock, blocking process 30282 which is waiting for a read lock. I hope this is helpful to people searching for information on this subject. |
All times are GMT -5. The time now is 04:56 AM. |