Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 +SENDMAIL+2.11; site dcl-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!mcvax!ukc!dcl-cs!stephen From: stephen@dcl-cs.UUCP (Stephen J. Muir) Newsgroups: net.bugs.4bsd Subject: Bug in flock(3) in 4.2BSD. Message-ID: <863@dcl-cs.UUCP> Date: Wed, 11-Dec-85 22:39:22 EST Article-I.D.: dcl-cs.863 Posted: Wed Dec 11 22:39:22 1985 Date-Received: Mon, 16-Dec-85 04:18:43 EST Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir) Organization: Department of Computing at Lancaster University. Lines: 31 Consider the following scenario: 1. process 0 starts and opens a file 2. process 1 starts and opens the same file 3. process 2 starts and opens the same file 4. process 1 applies a shared lock and succeeds 5. process 2 attempts to apply an exclusive lock and hangs 6. process 1 attempts to upgrade its lock to an exclusive one and hangs Process 1 should not have hung here. 7. I kill process 2 Process 1 is still hung. 8. I kill process 1 9. process 3 starts and opens the same file 10. process 3 attempts to apply an exclusive lock and hangs Process 3 should not have hung here. 11. I kill processes 0 & 3 12. process 4 starts and opens the same file 13. process 4 applies an exclusive lock and succeeds This is correct. -- UUCP: ...!seismo!mcvax!ukc!dcl-cs!stephen DARPA: stephen%comp.lancs.ac.uk@ucl-cs | Post: University of Lancaster, JANET: stephen@uk.ac.lancs.comp | Department of Computing, Phone: +44 524 65201 Ext. 4599 | Bailrigg, Lancaster, UK. Project:Alvey ECLIPSE Distribution | LA1 4YR