From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.bugs Subject: bug#14569: 24.3.50; bootstrap fails on Cygwin Date: Mon, 01 Jul 2013 19:31:37 +0200 Message-ID: <51D1BCF9.8080301@alice.it> References: <51BC720D.7080504@alice.it> <51BDB979.3040508@cornell.edu> <20130616150141.GB3622@ednor.casa.cgf.cx> <51BDFB25.8080101@cornell.edu> <51BE01EC.3000701@cornell.edu> <51C60DEB.8030804@alice.it> <51C75149.1070609@alice.it> <51C793FA.9070806@cs.ucla.edu> <51C8275A.4080307@cornell.edu> <51C886D5.3030704@alice.it> <51C8B4AD.7050609@cs.ucla.edu> <51C8DB3A.7050206@alice.it> <51CC529B.9090809@cs.ucla.edu> <51CC9340.3080307@cornell.edu> <51CD7F92.40007@cornell.edu> <51CDA2A0.10400@cs.ucla.edu> <51CDABD3.4070207@cornell.edu> <51CE02D6.1010702@cornell.edu> <51D16635.5080609@cornell.edu> <51D18FEF.7040602@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1372701257 11886 80.91.229.3 (1 Jul 2013 17:54:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jul 2013 17:54:17 +0000 (UTC) Cc: 14569@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 01 19:54:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UtiIr-0002pf-2t for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jul 2013 19:54:17 +0200 Original-Received: from localhost ([::1]:50632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiIq-0004K3-QB for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jul 2013 13:54:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiIh-0004Hn-Hb for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:54:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtiIc-0005iB-7z for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:54:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiIc-0005hn-0n for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UtiIb-0004N2-Nc for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Angelo Graziosi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jul 2013 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14569 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-emacs , Ken Brown Original-Received: via spool by submit@debbugs.gnu.org id=B.137270123016770 (code B ref -1); Mon, 01 Jul 2013 17:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jul 2013 17:53:50 +0000 Original-Received: from localhost ([127.0.0.1]:50715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UtiIQ-0004MO-6T for submit@debbugs.gnu.org; Mon, 01 Jul 2013 13:53:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35239) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UtiIN-0004M1-7v for submit@debbugs.gnu.org; Mon, 01 Jul 2013 13:53:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtiIA-0005U6-7d for submit@debbugs.gnu.org; Mon, 01 Jul 2013 13:53:41 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiIA-0005TQ-3S for submit@debbugs.gnu.org; Mon, 01 Jul 2013 13:53:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiI6-0003Zq-OM for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:53:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtiI3-0005Qi-J1 for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:53:30 -0400 Original-Received: from smtp202.alice.it ([82.57.200.98]:38083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uthx7-0000u0-9N for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2013 13:31:49 -0400 Original-Received: from [192.168.1.100] (87.3.155.35) by smtp202.alice.it (8.6.060.15) (authenticated as angelo.graziosi@alice.it) id 51C49E4400F5814C; Mon, 1 Jul 2013 19:31:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: <51D18FEF.7040602@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75771 Archived-At: Il 01/07/2013 16.19, Paul Eggert ha scritto: > On 07/01/2013 04:21 AM, Ken Brown wrote: >> >> Last night I began running a loop in which emacs (patched as I proposed) repeatedly starts and then >> exits after 15 seconds [*]. So far there hasn't been a single failure after more than 1300 iterations. > > I wouldn't expect your test case to exercise the bug. > The bug occurs when Gtk or Glib activity is occurring > in some other thread at the same time that Emacs is > running. To reproduce the bug, one must have a > race condition like that. In your test case Emacs > is idle, so it's unlikely to exhibit the bug. > > A couple more things. Since the bug comes into play > only when glib is tickled, shouldn't the Cygwin case > suppress only the tickling, not the catching of child > signals? > > Also, wouldn't it be better to give Cygwin maintainers > an easy way to reproduce the bug, say by compiling > with a special flag? > > So, how about the following patch instead? > > === modified file 'src/ChangeLog' > --- src/ChangeLog 2013-06-30 22:29:23 +0000 > +++ src/ChangeLog 2013-07-01 14:17:45 +0000 > @@ -1,3 +1,10 @@ > +2013-07-01 Paul Eggert > + > + Tickle glib when debugging under Cygwin (Bug#14569). > + * process.c (init_process_emacs) [CYGWIN && TICKLE_GLIB_BUGFIX]: > + Tickle glib in this case, too, so that Cygwin maintainers > + can reproduce the bug more easily. > + > 2013-06-30 Michal Nazarewicz > > * buffer.c (FKill_buffer): Run `kill-buffer-query-functions' > > === modified file 'src/process.c' > --- src/process.c 2013-06-27 14:47:52 +0000 > +++ src/process.c 2013-07-01 14:12:31 +0000 > @@ -7095,16 +7095,24 @@ > if (! noninteractive || initialized) > #endif > { > -#if defined HAVE_GLIB && !defined WINDOWSNT && !defined CYGWIN > +#if defined HAVE_GLIB && !defined WINDOWSNT > /* Tickle glib's child-handling code. Ask glib to wait for Emacs itself; > this should always fail, but is enough to initialize glib's > private SIGCHLD handler, allowing the code below to copy it into > LIB_CHILD_HANDLER. > > - For some reason tickling causes Cygwin bootstrap to fail, so it's > - skipped under Cygwin. FIXME: Skipping the tickling likely causes > - bugs in subprocess handling under Cygwin (Bug#14569). */ > - g_source_unref (g_child_watch_source_new (getpid ())); > + Under Cygwin as of July 2013, tickling causes bootstrap to fail, > + so do it only when Emacs is compiled with -DTICKLE_GLIB_BUGFIX; > + this is to help Cygwin maintainers reproduce the bug. > + FIXME: Skipping the tickling likely causes bugs in subprocess > + handling under Cygwin (Bug#14569). */ > +# if defined CYGWIN && !defined TICKLE_GLIB_BUGFIX > + bool tickle_glib = 0; > +# else > + bool tickle_glib = 1; > +# endif > + if (tickle_glib) > + g_source_unref (g_child_watch_source_new (getpid ())); > #endif > catch_child_signal (); > } It looks a nice solution. I have applied the patch and bootstrapped with CFLAGS=-DTICKLE_GLIB_BUGFIX ./my_build.sh and it fails as expected. Instead the bootstrap ./my_build.sh is completed just fine. This way Cygwin gurus have a possibility to catch Mobydick, if it exists... Ciao, Angelo.