From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.bugs Subject: bug#36019: 27.0.50; Segfault in color_distance in emacs --batch Date: Wed, 07 Aug 2019 08:57:15 +0200 Message-ID: <8736idxy2c.fsf@gmail.com> References: <87y32nqb4z.fsf@gmail.com> <87blzik5tm.fsf@gmail.com> <87ftouicyg.fsf@gmail.com> <877ea5keow.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="134019"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36019@debbugs.gnu.org To: Alex Gramiak Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 07 08:58:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hvFth-000YmJ-Hc for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Aug 2019 08:58:09 +0200 Original-Received: from localhost ([::1]:37520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvFtg-0001du-5p for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Aug 2019 02:58:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57805) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvFtb-0001dl-Sl for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2019 02:58:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvFta-0008JN-QM for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2019 02:58:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57463) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvFta-0008JF-Mu for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2019 02:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hvFta-0005qF-I8 for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2019 02:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vitalie Spinu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Aug 2019 06:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36019 X-GNU-PR-Package: emacs Original-Received: via spool by 36019-submit@debbugs.gnu.org id=B36019.156516105022376 (code B ref 36019); Wed, 07 Aug 2019 06:58:02 +0000 Original-Received: (at 36019) by debbugs.gnu.org; 7 Aug 2019 06:57:30 +0000 Original-Received: from localhost ([127.0.0.1]:38051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hvFt4-0005op-Ex for submit@debbugs.gnu.org; Wed, 07 Aug 2019 02:57:30 -0400 Original-Received: from mail-wr1-f65.google.com ([209.85.221.65]:41660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hvFt2-0005oW-JH for 36019@debbugs.gnu.org; Wed, 07 Aug 2019 02:57:29 -0400 Original-Received: by mail-wr1-f65.google.com with SMTP id c2so86955990wrm.8 for <36019@debbugs.gnu.org>; Tue, 06 Aug 2019 23:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8G3lq7gXwmovo5qLqeWpbo/6RvPvnRstZW9d09dHpzE=; b=r7qQanrwyU7EiJM3RYjZhKEnqnORN+oIRktiGzslbqJAl/H9ZcKfOJDKxrgXD1NDle 3WmitnoEmHhBHL1OMjr2GQ7sBoRXS8xbs6/MDhtujl9HbF8p8n0+b4iSwPRA8hvQfuGB Wf53tVgx5ZdgBdgfauAlkbmOzwS0ILO9eotlDcU/lVRluCuFAf+NozfEC9ATeJ31EOs6 LB1woK4G+AzDdxkvgL/cFidCLKjPeAjZyMUJQ/R+rX6+wWVTLkkwqkF+7Rcp/7kwJ5sJ NNRop/jRSF5Taa79nJMprZzFV/LCTo6WT2Dw2HjmjjkD4yM1fpsQ3l/wGf1Bf3qv6P4z PENA== 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:date:in-reply-to :message-id:user-agent:mime-version; bh=8G3lq7gXwmovo5qLqeWpbo/6RvPvnRstZW9d09dHpzE=; b=bcKt1ejiQJjvTz4HRw5xsUijiUYcwqXn+erx5AVYXKaC/AL1g9r/HwKtYLoU3OCoRi 9iRMwvIkLM9lEUX9afkT+0FQcmju70s7/H7xkuvQL8b/efOsh1FOdXIkqUyt3wUImHdL leDxwUfanFwjb46QQx1cLynFKCEMlROJoRPchD7Rpmmc29GMzgDAG3xpbwOinh00GrGI WV/yLkITSIzQqXu//DF6TWtzhpsEE1+8XQSbF/ausqAtC6t+HuVeUsyDghhQDAjQHtZR 2FesgcugHkBw4FQtZdXlmgUB/HObyP03DLt57cZx/BwpdtbFuIPs8/dDm2eoTZtQ264n YaNA== X-Gm-Message-State: APjAAAUzabNSmaVVuaLDaILXoXsoWOPEx8Yobzo0ClqJLZPZMY+mHhSS AQ9dCnFUqyjrECKI9fb3zW4= X-Google-Smtp-Source: APXvYqy3b5K848apGOt04i/Ms8mw8SdxIBKcO5q4S9FPwCmaS7YlV3wUjNZQHdJC3rEnx3vL52jTMw== X-Received: by 2002:adf:ea82:: with SMTP id s2mr8651328wrm.91.1565161042486; Tue, 06 Aug 2019 23:57:22 -0700 (PDT) Original-Received: from localhost ([91.65.211.131]) by smtp.gmail.com with ESMTPSA id k9sm24324739wrd.46.2019.08.06.23.57.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Aug 2019 23:57:21 -0700 (PDT) In-Reply-To: <877ea5keow.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 01 Jun 2019 08:22:23 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164704 Archived-At: Hi Alex, The bug is still in the master. Would it be ok to push the fix? Thanks, Vitalie >> On Sat, Jun 01 2019 08:22, Vitalie Spinu wrote: > Hi Alex, > You are right on spot. > Before the crash: > Initial: 1, hook: (nil) > Your fix does help and the following is printed: > Initial: 1, hook: 0x561a49f72240Initial: 1, hook: 0x561a49f72240Initial: 1, > hook: 0x561a49f72240Initial: 1, hook: 0x561a49f72240Initial: 1, hook: > 0x561a49f72240Initial: 1, hook: 0x561a49f72240Initial: 1, hook: > 0x561a49f72240Initial: 1, hook: 0x561a49f72240Initial: 1, hook: > 0x561a49f72240Initial: 1, hook: 0x561a49f72240 > Thanks for the quick resolution. > Vitalie >>> On Fri, May 31 2019 14:30, Alex Gramiak wrote: >> Vitalie Spinu 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? >> 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, >> 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: >> 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;