www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/24/05:15:42

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 24 Sep 2009 11:15:08 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Re: Cygwin 1.7 message queues - permission denied error still exists
Message-ID: <20090924091508.GC30267@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20090921162314 DOT GJ20981 AT calimero DOT vinschen DOT de> <4ABA7B1E DOT 7080100 AT gmx DOT de>
MIME-Version: 1.0
In-Reply-To: <4ABA7B1E.7080100@gmx.de>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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 Sep 23 21:46, Ren? Liebscher wrote:
> there is another problem with the queues.
> The mentioned test case opens two different queues in the same process.
> 
> But if you open the same queue in two different processes you get also a
> permission denied error.
> 
> I add here some test case:
> --- file: receiver.c -----------------------
> [...]
> ------------------------------------------
> --- file: sender.c ----------------------
> [...]
> -----------------------------------------
> It just sends an integer from sender to receiver.
> [...]
> However on cygwin it doesn't matter which of the processes you start
> first, the second one will get a permission denied.
> ---------------------------
> $ ./sender
> Sent 1
> Sent 2
> Sent 3
> Sent 4
> Sent 5
> Sent 6
> Sent 7
> Sent 8
> --- it waits here to get free places in queue (when receiver is running)
> ---------------------------
> But the receiver gets this:
> ---------------------------
> $ ./receiver
> Receiver: mq_open: Permission denied
> ---------------------------

Thanks for the testcase!  I could easily reproduce the problem and it
turned out that it was a miserable copy/paste bug.  Due to that the
function opening the mutex object in the second process requests more
access than the process creating the mutex has granted other processes.
Consequentially the second process got a "Permission denied".

I've fixed the bug in CVS.  The next 1.7.0 test release or the next
developer snapshot on http://cygwin.com/snapshots/ (whatever comes
first) will have the patch.


Thanks again for the testcase and the report,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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