delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/21/14:39:24

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o-
Date: Sun, 21 Aug 2011 14:38:58 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
Message-ID: <20110821183857.GC19565@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1558100995 DOT 357508 DOT 1313927301638 DOT JavaMail DOT fmail AT mwmweb008> <20110821165001 DOT GA19565 AT ednor DOT casa DOT cgf DOT cx> <4E513BF4 DOT 90308 AT hones DOT org DOT uk>
MIME-Version: 1.0
In-Reply-To: <4E513BF4.90308@hones.org.uk>
User-Agent: Mutt/1.5.20 (2009-06-14)
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 Sun, Aug 21, 2011 at 06:10:12PM +0100, Cliff Hones wrote:
>On 21/08/2011 17:50, Christopher Faylor wrote:
>> On Sun, Aug 21, 2011 at 01:48:21PM +0200, whans AT web DOT de wrote:
>>> Hello,
>>> ??
>>> it seems that a child process does not see the initialization of a
>>> static const std::string variable if it is defined in a dll. Instead this corrupt variable
>>> lead to a STATUS_ACCESS_VIOLATION.
>>> ??
>>> The following 4 example files demonstrate this behaviour:
>> 
>> Am I the only person who sees lots of strange characters in the examples
>> below where, presumably there is supposed to be whitespace?
>> 
>>> 1) dllif.h: ?? ?? ??(define the dll's interface)
>>> #include <string>
>>> class cTestIf {
>>> public:
>>> ?? virtual std::string get() = 0;
>>> };
>>> ??
>>> ??
>> 
>> ...
>
>Well, I'm afraid my mind-reading skills aren't good enough to answer
>that,

Sorry for the confusion.  I wasn't expecting people to psychically
determine if anyone else had problems.

While I appreciate the inclusion of a simple test case, it's always best
if the simple test case actually compiles.  Since C++ doesn't accept the
strange characters as whitespace, the test case did not compile.  I did,
obviously, work around the problem but its always best to put in as few
barriers as possible if you want help.  Inclusion of illegal characters
in a source program program is a barrier.

cgf

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