From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#38618: 27.0.50; Mach port leak on macOS Catalina causing crash Date: Tue, 17 Dec 2019 12:49:07 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <0DAC0841-F55E-48B8-8007-39107F92C039@iontech.nz> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="15232"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 38618@debbugs.gnu.org To: Phillip Hutchings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 17 04:50:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ih3sB-0003n1-7k for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Dec 2019 04:50:11 +0100 Original-Received: from localhost ([::1]:34846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ih3sA-0006jc-5n for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Dec 2019 22:50:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45918) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ih3s3-0006i5-Ab for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2019 22:50:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ih3s2-0006TL-79 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2019 22:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ih3s2-0006TF-49 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2019 22:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ih3s2-0000Od-06 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2019 22:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Dec 2019 03:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38618 X-GNU-PR-Package: emacs Original-Received: via spool by 38618-submit@debbugs.gnu.org id=B38618.15765545541465 (code B ref 38618); Tue, 17 Dec 2019 03:50:01 +0000 Original-Received: (at 38618) by debbugs.gnu.org; 17 Dec 2019 03:49:14 +0000 Original-Received: from localhost ([127.0.0.1]:40606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ih3rG-0000NY-1D for submit@debbugs.gnu.org; Mon, 16 Dec 2019 22:49:14 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:58672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ih3rD-0000NJ-Km for 38618@debbugs.gnu.org; Mon, 16 Dec 2019 22:49:12 -0500 Original-Received: from mathent.math.s.chiba-u.ac.jp (mathent [192.168.32.5]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id DC400F08D5; Tue, 17 Dec 2019 12:49:07 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: <0DAC0841-F55E-48B8-8007-39107F92C039@iontech.nz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:173467 Archived-At: On Sun, 15 Dec 2019 10:35:10 +0900, Phillip Hutchings wrote: > > On macOS Catalina (all versions up to and including 10.15.2), after > opening a file stored on an iCloud Drive folder Emacs leaks Mach ports > eventually resulting in an Emacs crash during a random syscall. > > Reproduction: > * Using Emacs for MacOS X (currently using Nightly build, but also on > the 26.3 release from 2019-09-02 > * Open a file stored in an iCloud Drive folder, eg Documents when using > default settings > * Modify the file, no need to save it, only modify the contents > * Emacs will leak Mach ports on every edit. > > This does not happen on non-iCloud Drive files, the port count observed > in Activity Monitor does not change for these files. The Mac port (not the NS port in your report) also has the problem of Mach port leaks in -[NSWindow setRepresentedURL:] on macOS 10.15. I think this is a bug in AppKit or some lower-level stuff. I'll file it to Apple later. I've installed a workaround into the "work" branch of the repository of the Mac port: https://bitbucket.org/mituharu/emacs-mac/commits/19c97087065b7ca64b71f392a453673042e024c6 YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp