X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.2 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: jojelino Subject: _mcleanup is called twice in forkee! Date: Mon, 22 Aug 2011 18:27:54 +0900 Lines: 7 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:8.0a2) Gecko/20110819 Thunderbird/8.0a2 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 When a program is compiled with -pg, it causes invocation of _monstartup and it calls atexit, the problem is, _mcleanup is called twice in forkee! That's because of _GLOBAL_REENT is copied when a process is forked. Then we have two _mcleanup. (_monstartup is with __constructor__ attribute.) and this is not we wanted. the same thing can be applied to any atexit call in cygwin which doesn't cares about forkee. -- 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