Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 1 Apr 2005 14:11:43 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: ipc, sockets and windows sp2
Message-ID: <20050401121143.GD1471@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <424D0232.5060305@smousseland.com> <20050401090414.GD7415@cygbert.vinschen.de> <424D2B0B.8000604@smousseland.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <424D2B0B.8000604@smousseland.com>
User-Agent: Mutt/1.4.2i

On Apr  1 13:05, Vincent Dedun wrote:
> So I hope you wouldn't mind I attached a short testing program you can 
> easily compil with gcc to reproduce the bug.

Cool, that's exactly what I was asking for.  I was immediately able to
reproduce the problem and it turned out, that on fork() the socket
duplication from parent to child process for some reason occupied space
in the child, which in the parent is occupied by the shared memory returned
by shmat.

Consequentially the duplication of the shared memory couldn't occupy the
same address as in the parent.  That's a fatal error so the forked child
terminated itself with error 487, which basically means "Invalid address".

I've changed fork() so that the shared memory is duplicated before sockets
are duplicated, which is ok because sockets don't have special requirements
for memory addresses.  That works fine for me, but it would be good if you
could test the next snapshot, which I just uploaded, nevertheless.

It's just incredible that nobody found this problem before.


Again, thanks for the testcase,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
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/

