delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/28/08:28:44

X-Spam-Check-By: sourceware.org
Date: Mon, 28 Aug 2006 14:27:16 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
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: <CEFD7032-DD32-4F1E-8D2F-C706BE73F470 AT andrew DOT cmu DOT edu>
Mime-Version: 1.0
In-Reply-To: <CEFD7032-DD32-4F1E-8D2F-C706BE73F470@andrew.cmu.edu>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019