unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrii Kolomoiets <andreyk.mad@gmail.com>
Cc: alan@idiocy.org, jguenther@gmail.com, 38748@debbugs.gnu.org
Subject: bug#38748: 28.0.50; crash on MacOS 10.15.2
Date: Thu, 02 Jan 2020 16:06:23 +0200	[thread overview]
Message-ID: <834kxej6lc.fsf@gnu.org> (raw)
In-Reply-To: <m25zhuyklw.fsf@gmail.com> (message from Andrii Kolomoiets on Wed, 01 Jan 2020 22:42:19 +0200)

> From: Andrii Kolomoiets <andreyk.mad@gmail.com>
> Cc: alan@idiocy.org,  38748@debbugs.gnu.org,  jguenther@gmail.com
> Date: Wed, 01 Jan 2020 22:42:19 +0200
> 
> >   (gdb) p last_marked_index
> >   $2 = 1
> >   (gdb) p last_marked[0]
> >   $3 = XIL(0x8000000006287630)
> >   (gdb) xtype
> >   Lisp_String
> >   (gdb) xstring
> >   $4 = (struct Lisp_String *) 0x6287630
> >   " *buffer-defaults*"
> 
> I'm still have no luck to print last_marked item:
> 
> (gdb) p last_marked_index
> $1 = 278
> (gdb) p last_marked[277]
> 'last_marked' has unknown type; cast it to its declared type

This looks like some compiler bug, or maybe bug in GDB on your
platform?  Because the source clearly says

   Lisp_Object last_marked[LAST_MARKED_SIZE] EXTERNALLY_VISIBLE;

so the type should be known to GDB.  But this is just an aside.

> But I found the commit after which error is occurs:
> b2949d39261e82c33572ba8a250298ef0b165b95
> 
> Commenting out that 'ok = false;' line make Emacs works without errors.

I cannot explain how that change could cause any harm.  Here's the
relevant code fragment:

      if (CONSP (parent_face))
	{
	  Lisp_Object tail;
	  ok = false;
	  for (tail = parent_face; !NILP (tail); tail = XCDR (tail))
	    {
	      ok = get_lface_attributes (w, f, XCAR (tail), inherited_attrs,
					 false, named_merge_points);
	      if (!ok)
		break;
	      attr_val = face_inherited_attr (w, f, inherited_attrs, attr_idx,
					      named_merge_points);
	      if (!UNSPECIFIEDP (attr_val))
		break;
	    }
	  if (!ok)	/* bad face? */
	    break;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	}
      else
	{
	  ok = get_lface_attributes (w, f, parent_face, inherited_attrs,
				     false, named_merge_points);
	  if (!ok)
	    break;
	  attr_val = inherited_attrs[attr_idx];
	}

Since parent_face is a cons cell, then we enter the for-loop (since a
cons cell cannot be nil), and then we immediately call
get_lface_attributes whose return value overwrites the initial value
of 'ok'.

So how could the initial value of 'ok' matter here?  What am I
missing?

Can you run the unmodified code with a breakpoint on the line
indicated by "<<<<<" above, and see if the breakpoint ever breaks?  If
it does break, can you show the face being merged in this case?

Also, if you build Emacs with exactly the same configure options, but
without optimizations, does the problem persist?

Thanks.





  reply	other threads:[~2020-01-02 14:06 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=834kxej6lc.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 \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).