From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.bugs Subject: bug#36019: 27.0.50; Segfault in color_distance in emacs --batch Date: Fri, 31 May 2019 14:30:31 -0600 Message-ID: <87ftouicyg.fsf@gmail.com> References: <87y32nqb4z.fsf@gmail.com> <87blzik5tm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="167906"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 36019@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 31 22:42:12 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 1hWoLr-000hWK-Rv for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 May 2019 22:42:12 +0200 Original-Received: from localhost ([127.0.0.1]:48881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoLq-0002JI-Rw for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 May 2019 16:42:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoLk-0002D6-Bo for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:42:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWoB6-000204-2B for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:31:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51033) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWoB4-0001xW-He for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hWoB4-0003Fb-DB for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Gramiak Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2019 20:31: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.155933463512438 (code B ref 36019); Fri, 31 May 2019 20:31:02 +0000 Original-Received: (at 36019) by debbugs.gnu.org; 31 May 2019 20:30:35 +0000 Original-Received: from localhost ([127.0.0.1]:36344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWoAd-0003EY-BF for submit@debbugs.gnu.org; Fri, 31 May 2019 16:30:35 -0400 Original-Received: from mail-pl1-f176.google.com ([209.85.214.176]:41450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWoAa-0003EE-MV for 36019@debbugs.gnu.org; Fri, 31 May 2019 16:30:33 -0400 Original-Received: by mail-pl1-f176.google.com with SMTP id s24so4306228plr.8 for <36019@debbugs.gnu.org>; Fri, 31 May 2019 13:30:32 -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=beOb9FNINl4KVer3Gwb7Mg/sSmjg5yWVkvQpW1BSMCg=; b=fdwlw769TodqTc879PKACWhJibdHWqDdXWl+7A+Keu5wg0TwJVOAQ+il3CGnacp5fu wqBaQHcw9dPOOZraMDXSDFkzQtt4bMO3bUdSyBv16WoPEce22hP0M3CrEr5bR1G6S0p+ DcBTZtRfoTvOHEFEj6egsGCtGJl6oq8RWl2yzv2d1dzgbCXCd3pmNP6AH+SzwMQM6GPe 8jRxGYYhvUa23xPHm9KpDU8fdk6lQUxnl+nj5ABov05t8Z7wxDIejo7QgaEXssnUtbLe H+9i95tFwgg8U2KX5iZVt+w5J1o0PoLBMOiIsUmBHSfipLjtCSRUpTtclO2VGrZu3mRp 4nxA== 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=beOb9FNINl4KVer3Gwb7Mg/sSmjg5yWVkvQpW1BSMCg=; b=NiWaBiBkCQlS+avYxlz6pSkrWGZ5UoB6XABGeiw53Et6dChRELiAAJGqHj8bniOPVM LX6JfLVTSau/dUZyAXRNS/7b825e/8JkQQNmUCyu+2OutHbz4OqFR+XdPeCkWzjCRe4R kWzpoez3YLeGgYwKpAzYIGBTekvT2VuZhcv8hEeM7Pi4jCVvHirm9dunFh1WO/qbRXeY 0TlN2SlEkAv78frY7K9gWi8d9RMbYPGXwI5I7IiTB+rb3druqe+4xflqPqQbMcEH53a0 OJTCoooa1U1/62KQzLOlrzeK6RzSi27V9eJBoyCKYqo+z0rPNNut3+R91eNB0bwji66t gMOg== X-Gm-Message-State: APjAAAW+iNho9YayBkGNqP3o1C20E6Wvk3iW2asoUWT8jVKIxBho7CLk XHA+Uvr0f5HBaf4prWYABnxdHN5m X-Google-Smtp-Source: APXvYqz1gGcR8oUTwawGicPlhhw/kjnE3IzxXLRcDIkbMZnf0hsZw9pfdDf/AdSPTAkGQliQU2MJdQ== X-Received: by 2002:a17:902:b083:: with SMTP id p3mr11832627plr.151.1559334626767; Fri, 31 May 2019 13:30:26 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id q6sm10038236pfg.7.2019.05.31.13.30.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2019 13:30:25 -0700 (PDT) In-Reply-To: <87blzik5tm.fsf@gmail.com> (Vitalie Spinu's message of "Fri, 31 May 2019 17:21:41 +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:159979 Archived-At: --=-=-= Content-Type: text/plain 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? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=color_distance.diff 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, --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=tty_defined_color.diff Content-Description: tty_defined_color 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; --=-=-=--