From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#15946: 24.3; Mac OS X, Mavericks, distnoted process Date: Tue, 7 Jan 2014 23:56:04 +0100 Message-ID: <9DA90B8B-1002-401D-9C4A-0A68316770EC@swipnet.se> References: <013FF6AE-1615-454A-AB1E-A289EC1E67F0@till.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389135429 29831 80.91.229.3 (7 Jan 2014 22:57:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Jan 2014 22:57:09 +0000 (UTC) Cc: "15946@debbugs.gnu.org" <15946@debbugs.gnu.org> To: SB Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 07 23:57:17 2014 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 1W0faF-00077s-Ia for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2014 23:57:15 +0100 Original-Received: from localhost ([::1]:43883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0faE-0002I3-RT for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2014 17:57:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0fa7-0002A5-49 for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2014 17:57:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0fa2-0005Ji-Rs for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2014 17:57:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0fa2-0005Jc-Og for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2014 17:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W0fa2-0007K3-9X for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2014 17:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2014 22:57: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.138913537428070 (code B ref 15946); Tue, 07 Jan 2014 22:57:02 +0000 Original-Received: (at 15946) by debbugs.gnu.org; 7 Jan 2014 22:56:14 +0000 Original-Received: from localhost ([127.0.0.1]:41633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0fZE-0007If-U4 for submit@debbugs.gnu.org; Tue, 07 Jan 2014 17:56:13 -0500 Original-Received: from mailfe03.swip.net ([212.247.154.65]:52508 helo=swip.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0fZ9-0007IQ-M2 for 15946@debbugs.gnu.org; Tue, 07 Jan 2014 17:56:09 -0500 X-T2-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50 Original-Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 299586196; Tue, 07 Jan 2014 23:56:04 +0100 In-Reply-To: X-Mailer: Apple Mail (2.1827) 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:83146 Archived-At: Hello. This is good to know, but others said they used Emacs downloaded from = emacsformacosx.com, which is supposed to be unpatched. So there might = be more than one reason for this. Jan D. 27 dec 2013 kl. 06:15 skrev SB : > 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). >=20 > Emacs inline patch > = http://svn.sourceforge.jp/svnroot/macemacsjp/inline_patch/trunk/emacs-inli= ne.patch >=20 > 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. >=20 > = https://developer.apple.com/library/mac/documentation/cocoa/reference/foun= dation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.h= tml >=20 > 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). >=20 > Others with the same problem seem to take a sledgehammer approach of > killing distnoted with a cronjob (which I did manually as well). >=20 > This is the patch (modified by hand so it may not apply) against emacs = 24.3. >=20 > https://gist.github.com/anonymous/8142555 >=20 > The modified line: >=20 > [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp > selector: @selector (changeInputMethod:) > name: > @"AppleSelectedInputSourcesChangedNotification" object: nil > = suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately]; >=20 > Suspension Behavior > = https://developer.apple.com/library/mac/documentation/cocoa/reference/foun= dation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.h= tml#//apple_ref/doc/c_ref/NSNotificationSuspensionBehavior >=20 > 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. >=20 > Logging Distnoted > = http://www.cocoawithlove.com/2009/02/interprocess-communication-snooping.h= tml >=20 > Hope this helps someone. >=20 > Cheers, >=20 > Sam >=20 > On Mon, Dec 9, 2013 at 7:06 PM, Jan Dj=E4rv = wrote: >> Hello. >>=20 >>> 9 dec 2013 kl. 05:38 skrev Christopher Smith : >>>=20 >>> Donald Tillman till.com> writes: >>>> Hi! >>>>=20 >>>> I use Emacs on Mac OS X, Mavericks, Intel MacBook Pro, downloaded = from >>>> emacsformacosx.com. >>>>=20 >>>> Running Emacs, a process named "distnoted" starts around 1% or 2% = of the >>>> 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. >>>>=20 >>>> Quitting Emacs brings distnoted down to under 1% within seconds. >>>=20 >>> 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. >>=20 >> 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 Emacs and distnoted. >>=20 >> Jan D. >>=20 >>=20