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 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Precedence: bulk List-Id: 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 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 >>> 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