X-Spam-Check-By: sourceware.org Date: Mon, 28 Aug 2006 14:27:16 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: cygserver blocking on semctl(SETVAL) call Message-ID: <20060828122715.GG20467@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Aug 25 11:21, Ethan Tira-Thompson wrote: > [Slightly modified from version previously sent on cygwin-developers, > who suggest this is a better forum for discussion] > > I've discovered what I believe to be a internal deadlock issue in > cygserver. > > I have a piece of code: > void SemaphoreManager::setValue(semid_t id, int x) const { > semun params; > params.val=x; > cout << "SEMCTL..." << flush; > if(semctl(semid,id,SETVAL,params)<0) { > perror("ERROR: SemaphoreManager::setValue (semctl)"); > exit(EXIT_FAILURE); > } > cout << "done" << endl; > } > > This is part of a function which gets called a number of times > throughout the life of the program. It works just fine up until one > particular call (with x=0) which reliably causes it to block between > the two cout's. Not just my program either -- all IPC is blocked at > this point. [...] > Our code can be checked out from CVS, but before running you'll need > to increase the semmns and semmsl parameters as described in step 5: > http://www.cs.cmu.edu/~tekkotsu/cygwin-install.html > [...] This sounds pretty strange since from the source code I can't see any chance that semctl(SETVAL) could hang indefinitly. However, as mentioned on cygwin-developers, please provide a simple, short, concise, standalone testcase, possibly in plain C, which builds and shows the problem OOTB. The problem should be isolated to the minimum of code necessary to get the hang, if possible. I really don't have time nor exactly fun to dive into a foreign complex project. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/