unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Gramiak <agrambot@gmail.com>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: 36019@debbugs.gnu.org
Subject: bug#36019: 27.0.50; Segfault in color_distance in emacs --batch
Date: Fri, 31 May 2019 14:30:31 -0600	[thread overview]
Message-ID: <87ftouicyg.fsf@gmail.com> (raw)
In-Reply-To: <87blzik5tm.fsf@gmail.com> (Vitalie Spinu's message of "Fri, 31 May 2019 17:21:41 +0200")

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

Vitalie Spinu <spinuvit@gmail.com> writes:

> I have bisected it to:
>
> yes: 5d8b0fadee * | Add terminal hook query_frame_background_color
> err: 41e20ee4bc * | Add terminal hook defined_color_hook
> err: a411517faf * | Rename generic x_* identifiers
> err: da9541dd10 * | Add prefixes to some window system-dependent procedures
>  no: ff4e31fa32 * |  Rename generic x_* procedures in xdisp.c
>
> The commits marked with err: don't build. So should be one of the top 4 commits.
>
>
>   Vitalie
>
>>> On Fri, May 31 2019 10:30, Vitalie Spinu wrote:
>
>> Hi,
>
>> One of my packages started segfaulting in tests after emacs 27 update. I cannot
>> reproduce it in an X session, nor make a simple reproducible example. Hopefully
>> the backtraces will be enough.
>
>> The issue appeared in the last 4-5 months. I can bisect if needed.

I can't reproduce this, but looking at the likely culprit (41e20ee4bc)
it's likely due to the frame being the initial frame. Just to make sure,
could you test with this simple primitive check for this?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: color_distance.diff --]
[-- Type: text/x-patch, Size: 568 bytes --]

diff --git a/src/xfaces.c b/src/xfaces.c
index d211ec8c46..10cfa50526 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4207,6 +4207,11 @@ two lists of the form (RED GREEN BLUE) aforementioned. */)
   struct frame *f = decode_live_frame (frame);
   Emacs_Color cdef1, cdef2;
 
+  fprintf (stderr,
+           "Initial: %d, hook: %p",
+           FRAME_INITIAL_P (f),
+           FRAME_TERMINAL (f)->defined_color_hook);
+
   if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
       && !(STRINGP (color1)
            && FRAME_TERMINAL (f)->defined_color_hook (f,

[-- Attachment #3: Type: text/plain, Size: 302 bytes --]


I expect that it will print "Initial: 1, hook: 0x0" before segfaulting.

If this is the case, then perhaps the initial frame should also have
this hook defined, though this would be the first such hook defined for
the initial frame type.

If this is correct, then the following diff should fix this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: tty_defined_color --]
[-- Type: text/x-patch, Size: 510 bytes --]

diff --git a/src/terminal.c b/src/terminal.c
index 0ee0121e35..ed2cfead7a 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -624,6 +624,7 @@ init_initial_terminal (void)
   initial_terminal->kboard = initial_kboard;
   initial_terminal->delete_terminal_hook = &delete_initial_terminal;
   initial_terminal->delete_frame_hook = &initial_free_frame_resources;
+  initial_terminal->defined_color_hook = &tty_defined_color; /* xfaces.c */
   /* Other hooks are NULL by default.  */
 
   return initial_terminal;

  reply	other threads:[~2019-05-31 20:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  8:30 bug#36019: 27.0.50; Segfault in color_distance in emacs --batch Vitalie Spinu
2019-05-31 15:21 ` Vitalie Spinu
2019-05-31 20:30   ` Alex Gramiak [this message]
2019-06-01  6:22     ` Vitalie Spinu
2019-08-07  6:57       ` Vitalie Spinu
2019-08-07 14:29         ` Eli Zaretskii
2019-08-10  8:47           ` Eli Zaretskii

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=87ftouicyg.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=36019@debbugs.gnu.org \
    --cc=spinuvit@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).