Subject: bug#35253: emacs-27.0.50_2019-01-17; `-nw' option causes core dump

From: Atsuo Ohki <[email-masked]>
Date: Sat, 13 Apr 2019 11:40:02 +0900

emacs-27.0.50_2019-01-17 built with following configuration dumps core
 (segmentaion fault), when `-nw' option is specified.

 When built it with `--with-pdumper=no --with-dumping=unexec'
 configuration options, it works fine with `-nw' option.

 I suspected the reinitialization after loading a pdmp file is
 inadequate, and found the next patch fixes the problem.

--- src/coding.c-ORIG   2019-01-17 19:31:05.000000000 +0900
+++ src/coding.c        2019-04-13 10:53:04.819899000 +0900
@@ -11341,4 +11341,5 @@
           setup_coding_system (CODING_ID_NAME (id), this);
         }
     }
+  setup_coding_system (Qno_conversion, &safe_terminal_coding);
 }

#------------------------------------------------------------------------
In GNU Emacs 27.0.50 (build 1, x86_64-pc-freebsd11, X toolkit, Xaw3d scroll bars)
 of 2019-04-13 built on hz550
System Description: 11.2-STABLE

Recent messages:
Loading /usr/local/share/emacs/site-lisp/site-start-27.x.el (source)...done
Waiting for git... [2 times]
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure amd64-freebsd11
 --srcdir=/usr/src/local/GNU/emacs/emacs-27.0.50 --with-x
 --x-includes=/usr/local/include --x-libraries=/usr/local/lib
 --with-x-toolkit=lucid --without-xim --with-modules --without-pop
 --without-xpm --without-jpeg --without-tiff --without-gif --without-png
 --without-rsvg --without-imagemagick --without-gpm --without-dbus
 --without-gconf --without-gsettings --without-selinux --without-sound
 --without-gnutls LDFLAGS=-L/usr/local/lib'

Configured features:
XAW3D NOTIFY KQUEUE ACL LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS
LUCID X11 XDBE XIM MODULES THREADS CANNOT_DUMP LCMS2 GMP

Important settings:
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml easymenu mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils elec-pair tramp tramp-loaddefs
trampver tramp-compat ucs-normalize shell pcomplete comint ansi-color
ring parse-time format-spec advice auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json map seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib japan-util ps-print
ps-print-loaddefs ps-def lpr disp-table mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads kqueue lcms2 dynamic-setting font-render-setting
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 178146 7158)
 (symbols 48 8084 1)
 (strings 32 23697 2126)
 (string-bytes 1 790174)
 (vectors 16 31725)
 (vector-slots 8 421034 10170)
 (floats 8 275 289)
 (intervals 56 140 0)
 (buffers 992 11))