From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: SB Newsgroups: gmane.emacs.bugs Subject: bug#15946: 24.3; Mac OS X, Mavericks, distnoted process Date: Fri, 27 Dec 2013 14:15:37 +0900 Message-ID: References: <013FF6AE-1615-454A-AB1E-A289EC1E67F0@till.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1388172816 18267 80.91.229.3 (27 Dec 2013 19:33:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Dec 2013 19:33:36 +0000 (UTC) Cc: "15946@debbugs.gnu.org" <15946@debbugs.gnu.org> To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 27 20:33:43 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 1VwdAE-000807-Tg for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Dec 2013 20:33:43 +0100 Original-Received: from localhost ([::1]:50102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwdAE-0006lK-EO for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Dec 2013 14:33:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vwd5p-0005uN-OR for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2013 14:29:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vwd5i-00048U-US for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2013 14:29:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vwd5i-00048P-Q1 for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2013 14:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vwd5i-0001KJ-I6 for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2013 14:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: SB Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Dec 2013 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15946 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 15946-submit@debbugs.gnu.org id=B15946.13881725205030 (code B ref 15946); Fri, 27 Dec 2013 19:29:02 +0000 Original-Received: (at 15946) by debbugs.gnu.org; 27 Dec 2013 19:28:40 +0000 Original-Received: from localhost ([127.0.0.1]:46965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vwd5L-0001J4-KM for submit@debbugs.gnu.org; Fri, 27 Dec 2013 14:28:40 -0500 Original-Received: from mail-vc0-f173.google.com ([209.85.220.173]:34974) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VwPmB-0007Yd-HA for 15946@debbugs.gnu.org; Fri, 27 Dec 2013 00:16:00 -0500 Original-Received: by mail-vc0-f173.google.com with SMTP id ht17so4543106vcb.18 for <15946@debbugs.gnu.org>; Thu, 26 Dec 2013 21:15:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=3PvKENIvIU+0mxhL4sflDy28sbpxSje6RVPQmVliIPg=; b=azui4wjaxLCgK4nnWTQYtvygy8JeI3gh0BEk0mDv42y5MZpEQla+nH+CkqTNWhzt7t IExKxQ46WRPVI1XQL6EIrrlydB4y86n9eggW3G3WdZE24cwxXMDZwe+zahGh7PndA5a3 KzFhtlvAwU7nf9pzZZBUvR4dNwwswTtDyflCovzk33fT1i2tLUmW5gdfmG0u0y7+6vB2 qlbhO0IHMnV3FAZ0QPACG9qU/CEemhksZkiuAN2760IGgY/pfPzC6A+spBkIUQ8JLpUR ZqG+B94+i7RixMgdxb1gFdFD+LCoJCp7+8ToOLBjYZmaSiAZHWW5jQ6mAPR+ODkxx+Yw YMNg== X-Received: by 10.58.180.227 with SMTP id dr3mr3049603vec.36.1388121358913; Thu, 26 Dec 2013 21:15:58 -0800 (PST) Original-Received: by 10.58.211.228 with HTTP; Thu, 26 Dec 2013 21:15:37 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Fri, 27 Dec 2013 14:28:38 -0500 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-Mailman-Approved-At: Fri, 27 Dec 2013 14:33:40 -0500 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:82665 Archived-At: Hello, I've investigated this problem since I had similar symptoms that correlated with everyone else's reports (quit emacs.app and distnoted quiets down). Also, in my case when I download the vanilla emacs.app from the emacs for OSX site, the problem does not appear. In my case, under Mavericks, this problem only occurs when I use Emacs.app with the inline patch applied (for more native Japanese input). Emacs inline patch http://svn.sourceforge.jp/svnroot/macemacsjp/inline_patch/trunk/emacs-inlin= e.patch After investigating, it seems that the purpose of distnoted is to serve as a daemon to facilitate interapplication communication. In the case of the "inline patch", to capture the moment the IME is changed so that Emacs can do likewise to change language input. This is done by adding an observer using NSDistributedNotificationCenter and there is also a corresponding Core Foundation method. I didn't find any used of NSDistributedNotificationCenter in the official release (24.3) source. https://developer.apple.com/library/mac/documentation/cocoa/reference/found= ation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.htm= l The fix was to add "suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately" rather than the default which was "NSNotificationSuspensionBehaviorCoalesce". For whatever reason, modifying the inline patch in this manner fixed the issue for me. This would be consistent with the report above that "Cmd Tabbing" seems to trigger it (since it would activate the suspension behavior). Others with the same problem seem to take a sledgehammer approach of killing distnoted with a cronjob (which I did manually as well). This is the patch (modified by hand so it may not apply) against emacs 24.3= . https://gist.github.com/anonymous/8142555 The modified line: [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp selector: @selector (changeInputMethod:) name: @"AppleSelectedInputSourcesChangedNotification" object: nil suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately]; Suspension Behavior https://developer.apple.com/library/mac/documentation/cocoa/reference/found= ation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.htm= l#//apple_ref/doc/c_ref/NSNotificationSuspensionBehavior For others who do not use the patch, there may be other applications, since this is most likely a bug with Mavericks itself and you may want to log distnoted for additional hints and grep the source of your emacs build to see if NSDistributedNotificationCenter is being used. Logging Distnoted http://www.cocoawithlove.com/2009/02/interprocess-communication-snooping.ht= ml Hope this helps someone. Cheers, Sam On Mon, Dec 9, 2013 at 7:06 PM, Jan Dj=E4rv wrote: > Hello. > >> 9 dec 2013 kl. 05:38 skrev Christopher Smith : >> >> Donald Tillman till.com> writes: >>> Hi! >>> >>> I use Emacs on Mac OS X, Mavericks, Intel MacBook Pro, downloaded from >>> emacsformacosx.com. >>> >>> Running Emacs, a process named "distnoted" starts around 1% or 2% of th= e >>> CPU, and after a while, slowly works its way up to 50% to 100% of >>> the CPU. Yoiks! Actually there appear to be 3 distnoted processes, >>> but only one eats up the CPU. >>> >>> Quitting Emacs brings distnoted down to under 1% within seconds. >> >> Just wanted to bump this up, as I've now seen this bug myself. Not sure >> why Emacs is causing the problem. My emacs was built from macports. > > It is no use bumping anything that isn't reproducable. More helpful would= be if those that have this can do some debugging. For example dtruss on Em= acs and distnoted. > > Jan D. > >