From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Brightman Newsgroups: gmane.emacs.bugs Subject: bug#43886: 28.0.50; daemon segfaults when loading theme as second emacsclient connects Date: Fri, 9 Oct 2020 16:58:38 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1247"; mail-complaints-to="usenet@ciao.gmane.io" To: 43886@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 18:50:53 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQvbX-0000Ba-FZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 18:50:51 +0200 Original-Received: from localhost ([::1]:56016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQvbW-0008S2-F0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 12:50:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQvP8-0000X4-Nw for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 12:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQvP8-0005x8-DO for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 12:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQvP8-0000so-B3 for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 12:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Brightman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Oct 2020 16:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43886 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16022614613362 (code B ref -1); Fri, 09 Oct 2020 16:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Oct 2020 16:37:41 +0000 Original-Received: from localhost ([127.0.0.1]:36123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQvOm-0000s9-Eo for submit@debbugs.gnu.org; Fri, 09 Oct 2020 12:37:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQunI-0008KK-Ok for submit@debbugs.gnu.org; Fri, 09 Oct 2020 11:58:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQunI-0001yb-D5 for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 11:58:56 -0400 Original-Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:33623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQunF-0000hI-PX for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 11:58:56 -0400 Original-Received: by mail-lf1-x143.google.com with SMTP id l2so11239275lfk.0 for ; Fri, 09 Oct 2020 08:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5sv8hy8maY6HX/Gw48hjrwgoN0a8BUWHIimvLptvJig=; b=IQVjkY5d0nmWyF6mxBkbdH3F5MR7mwBrTLH5Opwh6mlfyNaJ7R6kbfiSBfR6/H5I65 1A2RopYZS5TGFDM2dAg8Cdc4gWy3mNwNy8XypujhJTY1c5zbbtQgtlsys6EvX8g9wD4C XhmJCaaxO1CoCk+s2pyRg+1GrpCqcWXH+4TYVg4iEHDtI6IqJUV7p6kCqqNcTr1p9dXx ftd6NXUnxX1BERDynsZZOXuZFLjXT6O+gPH+1jEH5etevR+UzqQ0oyxnkk1SlPtRR7DU ygeWUUpDpMy9i1FL3EgJH0L7cTuC+9ViPaF86SZtEEmaDmC4Th6BVu6S5UTUGskHszTB ET+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5sv8hy8maY6HX/Gw48hjrwgoN0a8BUWHIimvLptvJig=; b=il4D1ezsuW0u4WPyuWcCKm7XRGE3gB3zxeEnKpddN9LbhkR7PcicXfqKhn85d0n3MQ c61I64i/EjdFx8MA82wqPbyiBPGYMA0yA2fChFPVVPrVwHV7zDsqmO92fldJZEmX+zJE KC3FHnZD75ueeNeNBOsAvf4aTqPNocc8Bxdv2gjX7gKd5kSmjGTLBhuQCPUvGwtw9Pym kbQedD7hVX4j37zSs21qjcZC5Qu3lfMo9I0+68NCmmif89CJNaiHL3IcyEj+wZRy1c/t eXpBJWY9fPfbrmVyHogoOFE4ncLvTcicAm6D8cjHqr9qTgtTKrzIoqc8DcjCJsIvQI2Y 4fqw== X-Gm-Message-State: AOAM533vsbkzTodcFqt+IT76m5j0cniIyU+6N+v2hzmqLF9CQIsiZIzO tiOQTavRW6qyMUlqsApO/pQIKnu0Ubxv7n6rij7Aa419g5E= X-Google-Smtp-Source: ABdhPJwIbx9G425YDpOveenZwgE8QcrRosLAHAst8meSgK/BdYS704UEl1VSFwHk9h75hnoOtNQKdqjk4Sr/i5mjOLo= X-Received: by 2002:a19:c1ce:: with SMTP id r197mr4967305lff.266.1602259129213; Fri, 09 Oct 2020 08:58:49 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::143; envelope-from=sam.brightman@gmail.com; helo=mail-lf1-x143.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 09 Oct 2020 12:37:39 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190171 Archived-At: Initially discussed here: https://emacs.stackexchange.com/questions/61088/emacs-27-1-daemon-segfaulting-when-loading-theme-as-emacsclient-connects 1. Start emacs -Q -l test.el --fg-daemon. (see test.el below) 2. Connect with emacsclient -t. 3. Suspend the first client. 4. Connect with another emacsclient -t. 5. Server crashes. I've seen other variations, and sometimes seen many clients connect without issue and then suddenly another one causes it to crash. This method appears to reproduce every time. I am connecting the client from another mate-terminal tab. It also works in the same terminal with --bg-daemon. test.el: (defun my/after-make-frame-functions-hook (frame) (with-selected-frame frame (load-theme 'tango-dark t))) (if (daemonp) (add-hook 'after-make-frame-functions 'my/after-make-frame-functions-hook)) Does not occur in 26.3, occurs in 27.1 or later. Does not occur if (server-start) is used in an existing Emacs instance. GDB: Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x0000000000490e45 in load_color2 (f=f@entry=0xa1d440, face=face@entry=0xb1e930, name=XIL(0x7ffff4d337dc), target_index=target_index@entry=LFACE_FOREGROUND_INDEX, color=color@entry=0x7fffffff80c0) at xfaces.c:1195 #2 0x0000000000491a6c in load_color (target_index=LFACE_FOREGROUND_INDEX, name=, face=0xb1e930, f=0xa1d440) at xfaces.c:1258 #3 map_tty_color (f=f@entry=0xa1d440, face=face@entry=0xb1e930, idx=idx@entry=LFACE_FOREGROUND_INDEX, defaulted=) at xfaces.c:6185 #4 0x0000000000491db7 in realize_tty_face (cache=0xa96c20, attrs=0x7fffffff8130) at xfaces.c:6259 #5 realize_face (cache=cache@entry=0xa96c20, attrs=attrs@entry=0x7fffffff8130, former_face_id=former_face_id@entry=0) at xfaces.c:5829 #6 0x00000000004933be in realize_default_face (f=) at xfaces.c:5745 #7 realize_basic_faces (f=f@entry=0xa1d440) at xfaces.c:5603 #8 0x0000000000495ae0 in update_face_from_frame_parameter (f=f@entry=0xa1d440, param=param@entry=XIL(0x2340), new_value=new_value@entry=XIL(0x7ffff4d337fc)) at xfaces.c:3669 #9 0x0000000000419773 in Fmodify_frame_parameters (frame=, alist=) at frame.c:3353 #10 0x000000000050ff53 in Ffuncall (nargs=3, args=args@entry=0x7fffffff8300) at eval.c:2806 #11 0x0000000000546958 in exec_byte_code (bytestr=XIL(0x7ffff4cbc72c), vector=XIL(0x7ffff4cbc6cd), maxdepth=, args_template=, nargs=nargs@entry=140737300383440, args=, args@entry=0x18) at bytecode.c:632 #12 0x000000000050fc11 in fetch_and_exec_byte_code (args=0x18, nargs=140737300383440, syms_left=, fun=XIL(0x7ffff4cbc6d0)) at eval.c:2928 #13 funcall_lambda (fun=XIL(0x7ffff4cbc6d0), nargs=nargs@entry=3, arg_vector=0x18, arg_vector@entry=0x7fffffff8488) at eval.c:3009 #14 0x000000000050fe9f in Ffuncall (nargs=4, args=args@entry=0x7fffffff8480) at eval.c:2820 #15 0x0000000000546958 in exec_byte_code (bytestr=XIL(0x7ffff4d43e34), vector=XIL(0x7ffff4d43ab5), maxdepth=, args_template=, nargs=nargs@entry=140737300937400, args=, args@entry=0x17) at bytecode.c:632 #16 0x000000000050fc11 in fetch_and_exec_byte_code (args=0x17, nargs=140737300937400, syms_left=, fun=XIL(0x7ffff4d43ab8)) at eval.c:2928 #17 funcall_lambda (fun=XIL(0x7ffff4d43ab8), nargs=nargs@entry=1, arg_vector=0x17, arg_vector@entry=0x7fffffff86b8) at eval.c:3009 #18 0x000000000050fe9f in Ffuncall (nargs=2, args=args@entry=0x7fffffff86b0) at eval.c:2820 #19 0x0000000000546958 in exec_byte_code (bytestr=XIL(0x7ffff4e983ec), vector=XIL(0x7ffff4d43805), maxdepth=, args_template=, nargs=nargs@entry=2, args=, args@entry=0x16) at bytecode.c:632 #20 0x000000000050fc11 in fetch_and_exec_byte_code (args=0x16, nargs=2, syms_left=, fun=XIL(0x7ffff4d43808)) at eval.c:2928 #21 funcall_lambda (fun=XIL(0x7ffff4d43808), fun@entry=, nargs=nargs@entry=140737488324816, arg_vector=0x16, arg_vector@entry=0x2) at eval.c:3009 #22 0x000000000051278c in apply_lambda (fun=, args=, count=) at eval.c:2953 Backtrace stopped: previous frame inner to this frame (corrupt stack?) Lisp Backtrace: "modify-frame-parameters" (0xffff8308) "set-frame-parameter" (0xffff8488) "disable-theme" (0xffff86b8) "load-theme" (0xffff88d0) "progn" (0xffff8a18) "unwind-protect" (0xffff8ad8) "let" (0xffff8bf8) "my/after-make-frame-functions-hook" (0xffff8e70) "run-hook-with-args" (0xffff8e68) "make-frame" (0xffff9130) "server-create-tty-frame" (0xffff93c8) "server-process-filter" (0xffff9948) (gdb) p *f $5 = {header = {size = 4611686018578567187}, name = 0xad1f44, icon_name = 0x0, title = 0x0, focus_frame = 0x0, root_window = 0xa1dab5, selected_window = 0xa1dab5, old_selected_window = 0xa1dab5, minibuffer_window = 0xa8dc65, param_alist = 0xbb8f43, scroll_bars = 0x0, condemned_scroll_bars = 0x0, menu_bar_items = 0xaa622d, face_alist = 0xa7ada3, menu_bar_vector = 0x0, buffer_predicate = 0x0, buffer_list = 0xb77bd3, buried_buffer_list = 0x0, tab_bar_items = 0x0, tool_bar_items = 0x0, face_cache = 0xa96c20, last_tab_bar_item = 0, menu_bar_items_used = 0, current_pool = 0x99f060, desired_pool = 0x99efa0, desired_matrix = 0xacbf50, current_matrix = 0xad7200, glyphs_initialized_p = true, resized_p = false, default_face_done_p = false, already_hscrolled_p = false, updated_p = true, fonts_changed = false, cursor_type_changed = false, redisplay = true, visible = 0, iconified = false, garbaged = true, wants_modeline = true, auto_raise = false, auto_lower = false, no_split = false, explicit_name = false, window_change = false, window_state_change = false, mouse_moved = false, pointer_invisible = false, frozen_window_starts = false, output_method = output_termcap, new_pixelwise = false, can_set_window_size = true, after_make_frame = true, tab_bar_redisplayed = false, tab_bar_resized = false, tool_bar_redisplayed = false, tool_bar_resized = false, inhibit_horizontal_resize = false, inhibit_vertical_resize = false, face_change = false, inhibit_clear_image_cache = false, change_stamp = 2, number_of_windows = 2, tab_bar_lines = 0, tab_bar_height = 0, n_tab_bar_rows = 0, n_tab_bar_items = 0, tool_bar_lines = 0, tool_bar_height = 0, n_tool_bar_rows = 0, n_tool_bar_items = 0, decode_mode_spec_buffer = 0xaebbd0 '-' ..., insert_line_cost = 0xaecad0, delete_line_cost = 0xaecef0, insert_n_lines_cost = 0xaecd90, delete_n_lines_cost = 0xaecc30, text_cols = 317, text_lines = 84, total_cols = 317, total_lines = 85, text_width = 317, text_height = 84, new_width = 0, new_height = 0, left_pos = 0, top_pos = 0, pixel_width = 317, pixel_height = 85, win_gravity = 0, size_hint_flags = 0, border_width = 0, internal_border_width = 0, right_divider_width = 0, bottom_divider_width = 0, left_fringe_width = 0, right_fringe_width = 0, fringe_cols = 0, menu_bar_lines = 1, menu_bar_height = 1, column_width = 1, line_height = 1, terminal = 0xa1d130, output_data = {tty = 0x99eee0, x = 0x99eee0, w32 = 0x99eee0, ns = 0x99eee0}, font_driver_list = 0x0, desired_cursor = FILLED_BOX_CURSOR, cursor_width = 0, blink_off_cursor = FILLED_BOX_CURSOR, blink_off_cursor_width = 0, config_scroll_bar_width = 0, config_scroll_bar_cols = 0, config_scroll_bar_height = 0, config_scroll_bar_lines = 0, cost_calculation_baud_rate = 38400, alpha = {0, 0}, gamma = 0, extra_line_spacing = 0, background_pixel = 18446744073709551613, foreground_pixel = 18446744073709551614} (gdb) pv f No symbol "intern" in current context. (gdb) p f $2 = (struct frame *) 0xa1d440 (gdb) pr # (gdb) pp f # (gdb) p FRAME_TERMINAL(f)->defined_color_hook $3 = (_Bool (*)(struct frame *, const char *, Emacs_Color *, _Bool, _Bool)) 0x0 (gdb) l 1190 || target_index == LFACE_STRIKE_THROUGH_INDEX 1191 || target_index == LFACE_BOX_INDEX); 1192 1193 /* if the color map is full, defined_color_hook will return a best match 1194 to the values in an existing cell. */ 1195 if (!FRAME_TERMINAL (f)->defined_color_hook 1196 (f, SSDATA (name), color, true, true)) 1197 { 1198 add_to_log ("Unable to load color \"%s\"", name); 1199 It seems like the frame is invalid even though it's running after frame creation? I am not familiar with Emacs internals at all. In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu) of 2020-10-09 built on sbrightmanlinux Repository revision: 5824c209ba17b97978519ea62478c57010311e88 Repository branch: master System Description: Ubuntu 16.04.6 LTS Configured using: 'configure --with-x-toolkit=no --without-x --with-gnutls' Configured features: SOUND NOTIFY INOTIFY GNUTLS LIBXML2 ZLIB XIM MODULES THREADS JSON PDUMPER Important settings: value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow regexp-opt sort mail-extr apropos emacsbug message rmc puny dired dired-loaddefs rfc822 mml easymenu mml-sec epa derived epg epg-config gnus-util rmail tool-bar rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tango-dark-theme term/xterm xterm byte-opt gv bytecomp byte-compile cconv server tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads inotify multi-tty make-network-process emacs) Memory information: ((conses 16 57553 8763) (symbols 48 7127 1) (strings 32 19314 2014) (string-bytes 1 643593) (vectors 16 10666) (vector-slots 8 131757 7149) (floats 8 29 251) (intervals 56 174 0) (buffers 992 12) (heap 1024 4552 749)) -- Sam Brightman