emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macOS NS GUI crash due to invalid font pointer in frame struct while


From: Robert Pluim
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

>>>>> On Thu, 23 Jan 2020 11:16:39 -0500, Daniel Pittman <address@hidden> 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 <address@hidden>
AuthorDate: Mon Jan 20 17:27:43 2020 +0100
Commit:     Robert Pluim <address@hidden>
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 ();
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]