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: Sat, 01 Jun 2019 08:22:23 +0200 Message-ID: <877ea5keow.fsf@gmail.com> References: <87y32nqb4z.fsf@gmail.com> <87blzik5tm.fsf@gmail.com> <87ftouicyg.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="9652"; 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 Sat Jun 01 08:38:01 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hWxeT-0002NY-7h for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Jun 2019 08:38:01 +0200 Original-Received: from localhost ([127.0.0.1]:53589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWxeS-0000es-3d for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Jun 2019 02:38:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWxe2-00086u-Pv for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2019 02:37:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWxPz-00055C-4q for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2019 02:23:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWxPy-00054b-KP for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2019 02:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hWxPy-0006JW-Eo for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2019 02:23: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: Sat, 01 Jun 2019 06:23: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.155937015524220 (code B ref 36019); Sat, 01 Jun 2019 06:23:02 +0000 Original-Received: (at 36019) by debbugs.gnu.org; 1 Jun 2019 06:22:35 +0000 Original-Received: from localhost ([127.0.0.1]:36849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWxPX-0006IZ-35 for submit@debbugs.gnu.org; Sat, 01 Jun 2019 02:22:35 -0400 Original-Received: from mail-ed1-f68.google.com ([209.85.208.68]:37363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWxPV-0006IM-Ek for 36019@debbugs.gnu.org; Sat, 01 Jun 2019 02:22:34 -0400 Original-Received: by mail-ed1-f68.google.com with SMTP id w37so18047597edw.4 for <36019@debbugs.gnu.org>; Fri, 31 May 2019 23:22:33 -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=/MVrD/TgXVDf4QWS6nMnMFOwIS+2R/oASbDQux0O5GE=; b=NbXSfBSkD2QSwMB7SxHv4b43aeAu5qFHJcG3+vGVdFh6ph0CUSE9q78ATFriS545bh A0K8KqNmH8jbhPYx89nMRKgSBPeOkCLzp/9VFB8KV1pSafYmnTvS3r96mo9QJn9RAyem wn4EBFp+ERINeOjC62PPsTyly4yQFh9q7SlT8WUxn5DpZRjqSkIdlZltGm0jPPgBPB5B HBSNM2Oz8tYPCxx4fChkn2CfROTtud395vgKNCo0npncbkKl2YNv8yNSyYzHseUoltve J7Xq4+86Rzhrz1HW3IroE1VNonW9BwMW+/zUN0Jz43V8fuJaT0nQi139/5sYTeOv76mN MzjQ== 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=/MVrD/TgXVDf4QWS6nMnMFOwIS+2R/oASbDQux0O5GE=; b=S3BejXtPpub9dNwqE6ocMc5WIiPc7Luc8sFCSfFkfVA4Un3HIA9/EnTXb7CAcuVbzg ANUxeIP/UkuVT3/OJpQNIdCuhKtdMEhCLl3ynR5JocW4SZZrrBKfm+dkWXWdrs8ODgo1 7ER9aMjVuc6/+4AJrJGU6nmTVuHMDfYjzfJ0ezPJUuUlQWeKWpE2LLcRDj08EAPxl39b qfcKj/pZ+0d6HpsMeFBUPMCafopLUFwe2jaFyIDbYToTQ1TZF378j+IURShnWO4JEUXv q5e5UXqxuc6Ga4/dHEnY5lEJil8UE4LOpyLXZP7Bz+zZ4fVQQl+bPAjdj/1iq661I6KF pufA== X-Gm-Message-State: APjAAAUag5Ix2OHxYLC38g+D9TzVTsyOoqjOlwxZMlq0ujGqGqNLfoAg alvoUSMR0PxyMD3jHB9OjuI= X-Google-Smtp-Source: APXvYqyVYNZglQpy2bGDsj+v88IY4x/YlQkszGUX3WsCUOPRsRpkM1MO/cZ9pd8LYkIG0LHM9xPYOA== X-Received: by 2002:a17:906:e9d3:: with SMTP id kb19mr12737181ejb.248.1559370147262; Fri, 31 May 2019 23:22:27 -0700 (PDT) Original-Received: from localhost (2001-1c00-0a17-1300-ec5d-7b0c-b812-9602.cable.dynamic.v6.ziggo.nl. [2001:1c00:a17:1300:ec5d:7b0c:b812:9602]) by smtp.gmail.com with ESMTPSA id e45sm2100844edb.12.2019.05.31.23.22.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2019 23:22:26 -0700 (PDT) In-Reply-To: <87ftouicyg.fsf@gmail.com> (Alex Gramiak's message of "Fri, 31 May 2019 14:30:31 -0600") 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:159989 Archived-At: 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;