all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pip Cet <pipcet@gmail.com>
Cc: rpluim@gmail.com, 38748@debbugs.gnu.org, alan@idiocy.org,
	andreyk.mad@gmail.com, jguenther@gmail.com
Subject: bug#38748: 28.0.50; crash on MacOS 10.15.2
Date: Fri, 10 Jan 2020 10:27:45 +0200	[thread overview]
Message-ID: <834kx3af7i.fsf@gnu.org> (raw)
In-Reply-To: <CAOqdjBdX6F-1phVjmirOtDYUyNoY__6ZNYt1QY=R2xhsQvKnVQ@mail.gmail.com> (message from Pip Cet on Fri, 10 Jan 2020 07:32:07 +0000)

> From: Pip Cet <pipcet@gmail.com>
> Date: Fri, 10 Jan 2020 07:32:07 +0000
> Cc: rpluim@gmail.com, alan@idiocy.org, jguenther@gmail.com, 
> 	andreyk.mad@gmail.com, 38748@debbugs.gnu.org
> 
> > The backtrace shows a very recursive GC, it doesn't show any other
> > function being deeply recursive.  So I'm not sure I understand what
> > tail-recursive function did you have in mind.  Can you elaborate?
> 
> I can. I think we're looking at two bugs: the first is the simple
> use-after-free of XFRAME (frame)->output_data.ns where `frame' is a
> dead frame. I've confirmed on GNU/Linux that mark_frame is called for
> a frame for which x_free_frame_resources has already been called, if
> there's a global variable still referencing the frame. I think the
> same thing happens on macOS.

This one doesn't depend on the 'ok's initialization in
face_inherited_attr in any way, does it?

> 1. I think face_inherited_attr is being optimized to tail-call itself
> rather than calling itself in a new stack frame; thus, it loops
> indefinitely for a faulty face setup which would otherwise lead to an
> immediate crash.
> 1b. that optimization only works without the harmless initialization of "ok".
> 
> 2. Our initial face setup is faulty in the sense above.
> 
> 3. Something happens on a secondary thread which causes our face setup
> to become non-faulty, possibly during GC.

What do you mean by "secondary thread"?  And how can GC modify Lisp
data structures? that'd be a terrible bug.

In any case, the full backtrace shows no trace of face_inherited_attr
call anywhere in the callstack, so if there is indeed infinite
recursion in that function, it was somehow exited long ago by the time
GC runs.

As for the tail-recursion part: do you see any sign of that in the
disassembly posted by Robert?  I didn't, but maybe I missed
something.  And such subtleties should only rear their ugly heads in
optimized code, whereas we already know that an unoptimized build
crashes in the same way.

I still think the shortest way to finding the culprit here is to
patiently and painfully go over the last_marked array, deciphering
the Lisp object we marked, until we succeed in identifying the Lisp
data structure which got corrupted.  Once we succeed in identifying
that data structure, it should be relatively easy to find who and
where corrupts it.  This may mean a lot of inconvenient drudgery,
exacerbated by the fact that having a functional GDB on macOS is not
easy, but I don't think we have a better way at this point.





  reply	other threads:[~2020-01-10  8:27 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26  9:47 bug#38748: 28.0.50; crash on MacOS 10.15.2 Andrii Kolomoiets
2019-12-26 13:04 ` Alan Third
2019-12-26 17:18   ` Eli Zaretskii
2019-12-27 11:28     ` Andrii Kolomoiets
2019-12-27 14:14       ` Eli Zaretskii
2019-12-29 19:01         ` Andrii Kolomoiets
2019-12-29 19:31           ` Eli Zaretskii
2020-01-01 20:42             ` Andrii Kolomoiets
2020-01-02 14:06               ` Eli Zaretskii
2020-01-08 17:39                 ` Robert Pluim
2020-01-08 19:18                   ` Pip Cet
2020-01-08 19:58                     ` Eli Zaretskii
2020-01-08 20:39                       ` Pip Cet
2020-01-09  3:30                         ` Eli Zaretskii
2020-01-10  7:32                           ` Pip Cet
2020-01-10  8:27                             ` Eli Zaretskii [this message]
2020-01-10  8:58                               ` Robert Pluim
2020-01-10  9:21                                 ` Eli Zaretskii
2020-01-10 10:18                                   ` Robert Pluim
2020-01-11  6:26                                     ` Pankaj Jangid
2020-01-11  8:08                                       ` Eli Zaretskii
2020-01-11 10:43                                         ` Pankaj Jangid
2020-01-11 12:14                                           ` Eli Zaretskii
2020-01-10  9:22                               ` Pip Cet
2020-01-10  9:33                                 ` Eli Zaretskii
2020-01-11 13:59                                 ` Alan Third
2020-01-11 14:13                                   ` Pip Cet
2020-01-11 19:07                                     ` Alan Third
2020-01-08 21:43                     ` Robert Pluim
2020-01-08 22:18                       ` Pip Cet
2020-01-08 22:23                         ` Robert Pluim
2020-01-09  7:51                           ` Robert Pluim
2020-01-09 10:07                             ` Eli Zaretskii
2020-01-09 10:31                               ` Robert Pluim
2020-01-09 14:10                                 ` Pip Cet
2020-01-09 14:16                                 ` Eli Zaretskii
2020-01-09 14:56                                   ` Robert Pluim
2020-01-09 17:06                                     ` Eli Zaretskii
2020-01-09 13:51                               ` Andrii Kolomoiets
2020-01-09 14:13                                 ` Robert Pluim
2020-01-09 14:16                                 ` Pip Cet
2020-01-09 14:29                                   ` Andrii Kolomoiets
2020-01-09 15:15                                   ` Robert Pluim
2020-01-11 18:37                                     ` Pieter van Oostrum
2020-01-11 18:43                                       ` Eli Zaretskii
2020-01-11 21:23                                         ` Pieter van Oostrum
2020-01-12  3:33                                           ` Eli Zaretskii
2020-01-11 19:14                                       ` Pip Cet
2020-01-11 21:36                                         ` Pieter van Oostrum
2020-01-04 16:48               ` Pieter van Oostrum
2020-01-04 17:25                 ` Alan Third
2020-01-05 19:41                   ` Pieter van Oostrum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834kx3af7i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=38748@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=andreyk.mad@gmail.com \
    --cc=jguenther@gmail.com \
    --cc=pipcet@gmail.com \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.