From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gilles Newsgroups: gmane.emacs.bugs Subject: bug#47439: 27.2; In daemon mode, if after-init-hook errors out, the server does not start Date: Sun, 28 Mar 2021 03:00:40 +0200 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="18305"; mail-complaints-to="usenet@ciao.gmane.io" To: 47439@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 28 03:02:28 2021 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 1lQJox-0004gC-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 03:02:27 +0200 Original-Received: from localhost ([::1]:40054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQJow-00085X-SB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Mar 2021 21:02:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQJoY-00085O-Nq for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2021 21:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQJoY-0007NZ-EZ for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2021 21:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lQJoY-00070F-Aa for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2021 21:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gilles Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Mar 2021 01:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47439 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.161689328126866 (code B ref -1); Sun, 28 Mar 2021 01:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Mar 2021 01:01:21 +0000 Original-Received: from localhost ([127.0.0.1]:45171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQJnt-0006zF-Gj for submit@debbugs.gnu.org; Sat, 27 Mar 2021 21:01:21 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQJnr-0006z8-SV for submit@debbugs.gnu.org; Sat, 27 Mar 2021 21:01:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQJnr-00080C-GW for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2021 21:01:19 -0400 Original-Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]:41848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQJnp-0006z6-NF for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2021 21:01:19 -0400 Original-Received: by mail-qv1-xf30.google.com with SMTP id q12so4828378qvc.8 for ; Sat, 27 Mar 2021 18:01:16 -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=RTEaiX/j3t2px45h4bEn8QAmoYkUT3j6riyWHeIfmBg=; b=FcwToQmpgVaBE3kZ47AOnttbw5dljT+PIaNOcuUbeT4PvFZki7WG0TG7ER3AG/Z/aO HRh/PK/PGDTp6yRI096XE4sMHuBZShIUGmuT3+GAUbmksebmTPGT1BjuT+5q8dj3tFb8 o2tOToFfkabR/iabqprxptn2pzz9U46iTqGiiqjhxdCmHTVwSkU6gc5T6G0NdSWiimcG 1q9x9inS+4hKqYxJB2JPEwUSjPeWRoyt1pNO3z4jJQ3sYx4GbyGcIxnIEe0GaT2tIzPB 6SiaUz5fqkAZendfJCYHNZTsoQCWlU5wSte+ff+/xAgmHsXcYzJSCWSU4hpjP2V0mYx9 2mMQ== 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=RTEaiX/j3t2px45h4bEn8QAmoYkUT3j6riyWHeIfmBg=; b=J8coEE/mcMAI7YBzV3WR8Z/Y4i0mlRAmL9qZttB7T5iPc2r/mugpFW8U8IznwxOQZU /M5avmTUUpDXddWvnu0sjcHcK5FOLagzdn8MPKu0C/K8cm8hhLiaGJrDxicw045YcdMH yPHyD6OEcNS1XrhPyWpwznq1H0Cbe8GxKXihTuOJV/ZmRLw1fl6INUQWM+KbqSlDcsDY TKFhSf8/pyaHsbFupd5OJkI/4Y49NT8nvO1UwDyjjteMGdkvc8deGeDh1crBFmNoxLxa OwQtHG/Ywk1dm9AwkigaIQxCsWwqy1lNyRa2qDIRufT0ftnAeaU7/uJj1aNPum06+Akn 7Njg== X-Gm-Message-State: AOAM533fLxtr5pvSf+zjVJfxajBa+KNm5te+xcXvHRbGaCx4ibd6MtYQ BkYYwHDJFSlFOQGdfqy/i0b8QKQTXoKR6Av9OGiVn3vnbc0VTA== X-Google-Smtp-Source: ABdhPJw7AVte1iBDMcxspPdeNx0umnl5vS74xlGJxzO77q2i+FzodvCE6Kv3SfQuSso+NSWZ8ZSWzBGoOICmgD/lvwA= X-Received: by 2002:a05:6214:20ad:: with SMTP id 13mr18977439qvd.35.1616893276275; Sat, 27 Mar 2021 18:01:16 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=gilles.peskine@gmail.com; helo=mail-qv1-xf30.google.com 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-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:203140 Archived-At: 1. Make an init file with the following line: (add-hook 'after-init-hook 'barf) 2. Start Emacs in daemon mode: HOME=$PWD emacs --no-site-file --daemon=foo Expected behavior: Emacs starts normally (including starting the server), with the error logged in *Messages* (and optionally on Emacs's stderr), as happens for errors in the init file or in emacs-startup-hook. Actual behavior: the server does not start, so there is no way to open a frame other than the initial daemon frame. I did most of the investigation with a debug build of Emacs 27.2 on Linux, but I observed the same symptoms with Emacs 27.1 on macOS, with the official Ubuntu 20.04 build of Emacs 26.3, and with the official Ubuntu 16.04 build of Emacs 24.5.1. In GNU Emacs 27.2 (build 2, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2021-03-27 built on darkstar Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6 Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Ubuntu 20.04.2 LTS Configured using: 'configure --with-x-toolkit=lucid --enable-checking=yes,glyphs --enable-check-lisp-object-type --prefix=/home/gilles/Packages/emacs-27.2-dbg 'CFLAGS=-g3 -O0' LDFLAGS=-g3' Configured features: XPM JPEG TIFF GIF PNG SOUND GSETTINGS GLIB NOTIFY INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS PDUMPER GMP Important settings: value of $LC_CTYPE: en_US.UTF-8 locale-coding-system: utf-8-unix Backtrace of the daemon process: [New LWP 1377142] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 0x00007f214d60f246 in __pselect (nfds=8, readfds=0x7ffeb73ecd70, writefds=0x7ffeb73ecdf0, exceptfds=0x0, timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:48 48 ../sysdeps/unix/sysv/linux/pselect.c: No such file or directory. SIGINT is used by the debugger. Are you sure you want to change it? (y or n) [answered Y; input not from terminal] DISPLAY = :0 TERM = xterm Breakpoint 1 at 0x562be7588dbd: file emacs.c, line 379. Breakpoint 2 at 0x562be753a6f6: file xterm.c, line 10145. #0 0x00007f214d60f246 in __pselect (nfds=8, readfds=0x7ffeb73ecd70, writefds=0x7ffeb73ecdf0, exceptfds=0x0, timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:48 #1 0x0000562be7845fbe in really_call_select (arg=0x7ffeb73ecc60) at thread.c:586 #2 0x0000562be76ac0ff in flush_stack_call_func (func=0x562be7845ef3 , arg=0x7ffeb73ecc60) at alloc.c:4951 #3 0x0000562be78460ba in thread_select (func=0x7f214d60f180 <__pselect>, max_fds=8, rfds=0x7ffeb73ecd70, wfds=0x7ffeb73ecdf0, efds=0x0, timeout=0x7ffeb73ed3a0, sigmask=0x0) at thread.c:616 #4 0x0000562be78ae770 in xg_select (fds_lim=8, rfds=0x7ffeb73ed410, wfds=0x7ffeb73ed490, efds=0x0, timeout=0x7ffeb73ed3a0, sigmask=0x0) at xgselect.c:117 #5 0x0000562be77b7c7c in wait_reading_process_output (time_limit=0, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5572 #6 0x0000562be759f260 in kbd_buffer_get_event (kbp=0x7ffeb73ed770, used_mouse_menu=0x7ffeb73edd75, end_time=0x0) at keyboard.c:3866 #7 0x0000562be759989d in read_event_from_main_queue (end_time=0x0, local_getcjmp=0x7ffeb73edb80, used_mouse_menu=0x7ffeb73edd75) at keyboard.c:2156 #8 0x0000562be7599cb3 in read_decoded_event_from_main_queue (end_time=0x0, local_getcjmp=0x7ffeb73edb80, prev_event=XIL(0), used_mouse_menu=0x7ffeb73edd75) at keyboard.c:2220 #9 0x0000562be759c030 in read_char (commandflag=1, map=XIL(0x562be8a95aa3), prev_event=XIL(0), used_mouse_menu=0x7ffeb73edd75, end_time=0x0) at keyboard.c:2830 #10 0x0000562be75ae73b in read_key_sequence (keybuf=0x7ffeb73edf60, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9554 #11 0x0000562be7596f70 in command_loop_1 () at keyboard.c:1350 #12 0x0000562be770e339 in internal_condition_case (bfun=0x562be7596ad2 , handlers=XIL(0x90), hfun=0x562be7596082 ) at eval.c:1356 #13 0x0000562be7596693 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1091 #14 0x0000562be770d71c in internal_catch (tag=XIL(0xcc60), func=0x562be7596662 , arg=XIL(0)) at eval.c:1117 #15 0x0000562be759662d in command_loop () at keyboard.c:1070 #16 0x0000562be7595b49 in recursive_edit_1 () at keyboard.c:714 #17 0x0000562be7595d49 in Frecursive_edit () at keyboard.c:786 #18 0x0000562be758b75d in main (argc=3, argv=0x7ffeb73ee3e8) at emacs.c:2067 [Inferior 1 (process 1377141) detached]