From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: macOS NS GUI crash due to invalid font pointer in frame struct while marking Date: Thu, 23 Jan 2020 20:10:11 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68570"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Daniel Pittman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 23 20:58:05 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iuic7-000Hlr-Va for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Jan 2020 20:58:03 +0100 Original-Received: from localhost ([::1]:60940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuic7-0002i6-3v for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Jan 2020 14:58:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56563) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuhrs-0004Ur-G8 for emacs-devel@gnu.org; Thu, 23 Jan 2020 14:10:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuhrr-0006B2-7e for emacs-devel@gnu.org; Thu, 23 Jan 2020 14:10:16 -0500 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuhrr-00069S-0n for emacs-devel@gnu.org; Thu, 23 Jan 2020 14:10:15 -0500 Original-Received: by mail-wr1-x42e.google.com with SMTP id g17so4388328wro.2 for ; Thu, 23 Jan 2020 11:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version; bh=nZfQU2R2ZkQj+ExKQr/EITdZFqaH4897CY41B7VtVZI=; b=GZ4PH+B7kqmaMiql6KJS5BFKo4R1N0L4xXGscn3G8m6Pb2xEZnGcY8wPqh+WDZA5d6 /obKaLqHF78sbEC8XeDNX9JNOZV10tYIM1LNTYSVxbsjHv4RYmnNcApQd8/E2suW7gqE 2idOaXqmeNOaiuqhOlb5OzeF76pnEJXahQldtPjks/Y7SaV42OqiQwladbFtUInn3/Yd Tz6Cg19nl7YQzZsvVRa9WydXCssdYybYjwLqsLmEt3N0D8NnrF1/SU7cc/WepCPb/NGv 8p2eySH+0ZhEI8O3v2vgWe6n9rGdh143+nKgy7g88UN95h3K/UUfOOr0EN/ZPrC72/La 1AZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=nZfQU2R2ZkQj+ExKQr/EITdZFqaH4897CY41B7VtVZI=; b=EkdMso/ZV4N3l0/qkoyMKWuCD+Lat1lWpRxJHSxXhbelxFc496h5JJP0DhEHjNeYuT DLj7fdtEVxeDC3B+vMfzYympoQNG8efRL632aRQhApzZVQDgnlOaU5ZZTxxbrydncXfJ S5TbIAlt1mTp8Nn5szEvWumD3nYox97RbF/ukXRpjp/IUioUJjknWJgl+Ow/P7oW/yfr jZ0z7nv21xUddC45qhUpe9YtbcDIn4Yog2CaG+QaEnqkhApva87nF5CuYXDa6lb0boIx kdo3hGBuHwv5QLbIcGEYFYTfh3tHQ0evqtSnB0cHDun09yPasqD6UlxncHvlO+nZ08kp fGWA== X-Gm-Message-State: APjAAAWSzUaXIt/m4KgaSHoKsP0j9N2l1WKQ5ZCYyUzURCuIPLUCletC 5QqWjsxnHweSitsFZOFT11PV9G2T X-Google-Smtp-Source: APXvYqx5dwK7Fa+x8ZcVUB+8ysmKcntFNqpiiqJ0xW225IG3gc139YT0h8s4WAAze7dcYU7MDTgp7Q== X-Received: by 2002:adf:ef8b:: with SMTP id d11mr18350616wro.45.1579806613283; Thu, 23 Jan 2020 11:10:13 -0800 (PST) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:5048:d273:cb99:1b5f]) by smtp.gmail.com with ESMTPSA id d14sm4596748wru.9.2020.01.23.11.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 11:10:12 -0800 (PST) Gmane-Reply-To-List: yes In-Reply-To: (Daniel Pittman's message of "Thu, 23 Jan 2020 11:16:39 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244548 Archived-At: >>>>> On Thu, 23 Jan 2020 11:16:39 -0500, Daniel Pittman said: Daniel> G'day. I've come across a crash during GC on macOS 10.15.2, GNU Emacs Daniel> built from source, git d97a77c481ec913d8c3c24f2eecdc41a28243678. Daniel> The crash is located at: ...-> mark_window->mark_vectorlike->mark_frame Daniel> In this the bad pointer is in (struct frame).output_data.ns.font, where the Daniel> pointer is wildly out of the memory map, and so crashes trying to determine Daniel> if that was marked. Daniel> I haven't yet tracked this down to a root cause, but before I invest Daniel> significant time in that I'd like to know if anyone else is investigating Daniel> this, or something similar to this? Daniel> Reproduction is, painfully, just a matter of waiting for a crash. It seems Daniel> to be vaguely correlated to external process interactions, but can't find a Daniel> clear root cause. Daniel> I'll work to get a fix, of course, but wanted to avoid duplicating work if Daniel> someone else already has this in hand, or knows more. git sh 2eb834ead401fa83270cad585a4310e2e05b8baa commit 2eb834ead401fa83270cad585a4310e2e05b8baa Author: Pip Cet AuthorDate: Mon Jan 20 17:27:43 2020 +0100 Commit: Robert Pluim CommitDate: Mon Jan 20 17:27:43 2020 +0100 Clear output data pointer on NS * src/nsterm.m (ns_free_frame_resources): Clear the output data pointer to prevent attempting to reuse freed resources (Bug#38748). diff --git a/src/nsterm.m b/src/nsterm.m index 03754e5ae5..c1d1d41117 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1644,6 +1644,7 @@ Hide the window (X11 semantics) [view release]; xfree (f->output_data.ns); + f->output_data.ns = NULL; unblock_input (); }