From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#38618: 27.0.50; Mach port leak on macOS Catalina causing crash Date: Sun, 15 Dec 2019 14:48:27 +0000 Message-ID: <20191215144827.GA10859@breton.holly.idiocy.org> References: <0DAC0841-F55E-48B8-8007-39107F92C039@iontech.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="44641"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38618@debbugs.gnu.org To: Phillip Hutchings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 15 15:49: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 1igVCp-000BTN-VE for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Dec 2019 15:49:12 +0100 Original-Received: from localhost ([::1]:40380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igVCo-0001LN-AI for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Dec 2019 09:49:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40013) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igVCh-0001L2-K0 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2019 09:49:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igVCg-0004rM-H4 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2019 09:49:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igVCg-0004ps-8L for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2019 09:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igVCg-0002O6-6k for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2019 09:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2019 14:49:02 +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.15764213189136 (code B ref 38618); Sun, 15 Dec 2019 14:49:02 +0000 Original-Received: (at 38618) by debbugs.gnu.org; 15 Dec 2019 14:48:38 +0000 Original-Received: from localhost ([127.0.0.1]:36061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igVCH-0002NI-WF for submit@debbugs.gnu.org; Sun, 15 Dec 2019 09:48:38 -0500 Original-Received: from mail-wr1-f42.google.com ([209.85.221.42]:37070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igVCG-0002N5-8J for 38618@debbugs.gnu.org; Sun, 15 Dec 2019 09:48:37 -0500 Original-Received: by mail-wr1-f42.google.com with SMTP id w15so4123681wru.4 for <38618@debbugs.gnu.org>; Sun, 15 Dec 2019 06:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=xL8YcQzWdsAPVB3Wt6ongpk5eW4YBEYDPsn1PdGWcyM=; b=VFdQ6ox/tIqh6CVxTpP8ZlJANBSKEQfPMMGd3DvLJJDRiWa7GipZtMJ4cTOuEsO+0a c2F3/0sqiTxCNHGRoBx5uojRMZermT559Y3lG7il+9se+wCD33AeH/b459A8OrvE2TlA TYKMyq/2wZ/jxNazfcd6Z077wWVI0oy52wb2DczRooHSUSX4WhP2DLIW0GrYaYdz8XgJ XNAqF9eTgqsXpjRAKM+AQCxRNULe3sfWNbRvQN8FpSlr7cwUmdGSQ/u5Q4IUDuMheIrV MNJcx+dMKTnfSTXFQKkkWzk/vJ3OB0pCfMdivXPsFlS6D0oakF5FY9tQfe5X643whuQS 4kUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=xL8YcQzWdsAPVB3Wt6ongpk5eW4YBEYDPsn1PdGWcyM=; b=IGveS72F/b1Q5jN0CN+WZzP4F8N1O9sHK7Q5rSx+0RsC4XjhJIAGX7ClBgdNuD486k /UzEDRR6CBPUBAhVWDfTR0MSn4s721K6nwIsfjYAqJyI4lUWtA+nnNW0r4S4m+Fl1hz5 NWLlITAzOoRkC3UyT2Ov0bgD7fQYYkU+NwJu02mll7t9QIoSbbLOkMiuoUzheM2BW00+ wnKRhVz+xHwCLQF+by2dfkppzpJEn8jh7SNNMzc7VLOdjxY76tJuZXgN5dfAgrqgegVY /IXqM0iULFLleoAwXhljutEoy683Fs00JfGIUNy9J5LZuJK4DcL/MW54kEMWa0SWtECN KJ2w== X-Gm-Message-State: APjAAAUSsT6SEKNHW1ZAwwB20ORskhrvVXtXcTCa42Sd1AS0yUQPLRh4 RxhdUd5oKkX1I6ZpL9nAspM= X-Google-Smtp-Source: APXvYqykvwS9n4koZeJKN3GedGvIdILCZ2E3yDP8ctKOlwYfeGuhZooEfmBldSuq9zftf2fZk/m4tw== X-Received: by 2002:adf:e6c5:: with SMTP id y5mr24520747wrm.210.1576421310257; Sun, 15 Dec 2019 06:48:30 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-0d9a-e711-75bf-e162.holly.idiocy.org. [2001:8b0:3f8:8129:d9a:e711:75bf:e162]) by smtp.gmail.com with ESMTPSA id a184sm18127945wmf.29.2019.12.15.06.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Dec 2019 06:48:29 -0800 (PST) Content-Disposition: inline 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:173372 Archived-At: On Sun, Dec 15, 2019 at 02:35:10PM +1300, 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. > > So far I've removed all customisations, then tried disabling file > backups and auto saves, and pretty much anything I can think of that > accesses files. So far I haven't managed to find a cause. This sounds strange. I’m not on Catalina, nor do I use icloud, so I can’t debug this locally. Can you try enabling NSTRACE (uncomment line 55 in nstrace.h) and then compare the output when editing a file that doesn’t leak vs one that does? It might be worth enabling NSTRACE_GROUP_EVENTS too, but it results in a ton of output, so perhaps try without it first. Oh, and can you try testing with ‘emacs -nw’, just in case it’s not related to the window system code. -- Alan Third