X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0	tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4FDA3917.20309@cs.utoronto.ca>
Date: Thu, 14 Jun 2012 15:18:47 -0400
From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Performance problems with emacs-X11 in current cygwin
References: <4FCB2991.3010701@users.sourceforge.net> <4FCB5438.7080903@cornell.edu> <4FCB9872.5010506@cornell.edu> <loom.20120606T123651-460@post.gmane.org> <4FD1F709.4050107@cornell.edu> <87k3zhbyyk.fsf@Rainer.invalid> <4FD22C39.6070107@cornell.edu> <4FD53FA9.2040105@cornell.edu> <4FD8DE9C.1090900@cornell.edu> <4FD90105.7050701@cornell.edu> <20120613214043.GA3554@ednor.casa.cgf.cx>
In-Reply-To: <20120613214043.GA3554@ednor.casa.cgf.cx>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

On 13/06/2012 5:40 PM, Christopher Faylor wrote:
> On Wed, Jun 13, 2012 at 05:07:17PM -0400, Ken Brown wrote:
>> On 6/13/2012 2:40 PM, Ken Brown wrote:
>>> On 6/10/2012 8:45 PM, Ken Brown wrote:
>>>> The bisection shows that the first problematic commit is this one:
>>>>
>>>> http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=7eae486179e2799c369ed9ffcea663bf9161ce79
>>>>
>>>>
>>>>
>>>> Author: Ryan Lortie<desrt@desrt.ca>
>>>> Date: Wed Aug 31 22:07:02 2011 -0400
>>>>
>>>> GMain: simplify logic for g_wakeup_acknowledge()
>>>>
>>>> Instead of messing around with context->poll_waiting, just look at the
>>>> GPollFD to see if the GWakeup needs to be acknowledged.
>>> I think this commit contains a typo: "events" should be "revents".
>>> (context->wake_up_rec.events is always nonzero at this point in the
>>> code, so it makes no sense to test that.) As a result,
>>> g_wakeup_acknowledge() is being called much more often than necessary. I
>>> think this could easily explain the performance problems that have been
>>> reported, but I won't have a chance to test this on my (slow) XP system
>>> for a while, and possibly not until tomorrow.
>> I've confirmed that fixing the typo solves the problem on my XP system.
>>   I suspect that this issue is not specific to XP after all and has more
>> to do with the slowness of the machine, so that the performance problem
>> is more noticeable.  In any case, it's clearly a glib bug.
>>
>> I've filed a bug report upstream:
>>
>>    https://bugzilla.gnome.org/show_bug.cgi?id=678052
> What incredible perseverence you've shown in tracking this down.  Bravo!
++

Amazing. This is one of the nastier kinds of bugs I've seen anybody 
track down... bug not where anybody thinks it is, and in library code 
generally assumed to be robust, bisecting the monster that is glibc, bug 
hunter knows (or willing to learn) glibc well enough to tell what 
revents and events do (and that revents even exists!), but not so well 
that the eyes glossed over the typo.

Ironically, the 'r' key on my laptop has been acting up lately, so I can 
totally relate to the poor fellow who tried to type 'revents' and didn't 
notice when 'events' compiled and checked in instead...

Ryan


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

