Subject: 26.2.90; expand-file-name assertion failure if HOME is unset
From: Philipp Stephani <[email-masked]>
To: [email-masked]
Date: Mon, 17 Jun 2019 14:23:02 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

$ HOME= ./emacs -Q -batch -eval '(expand-file-name "~")'

fileio.c:1330: Emacs fatal error: assertion failed: tlen > file_name_as_directory_slop + 1
Fatal error 6: Aborted
Backtrace:
./emacs[0x5c24e5]
./emacs[0x5944c5]
./emacs[0x62f5da]
./emacs[0x5ea04c]
./emacs[0x658beb]
./emacs[0x6586e2]
./emacs[0x6b152d]
./emacs[0x659332]
./emacs[0x658726]
./emacs[0x6b152d]
./emacs[0x659332]
./emacs[0x658f9b]
./emacs[0x656f91]
./emacs[0x656246]
./emacs[0x59920e]
./emacs[0x654514]
./emacs[0x599253]
./emacs[0x6539bd]
./emacs[0x59913d]
./emacs[0x5986bc]
./emacs[0x5988b1]
./emacs[0x596325]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7fdcac6ba52b]
./emacs[0x41674a]
Aborted (core dumped)

Stack trace:

#0  0x0000000000594422 in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:368
#1  0x000000000062f5da in die (msg=0x77a418 "tlen > file_name_as_directory_slop + 1", file=0x77a2ff "fileio.c", line=1330) at alloc.c:7381
#2  0x00000000005ea04c in Fexpand_file_name (name=XIL(0x2c6ff24), default_directory=XIL(0x2c6ecd4)) at fileio.c:1330
        nm = 0x7fffffffc4b1 ""
        nmlim = 0x7fffffffc4b1 ""
        newdir = 0xb902de <pure+3799998> ""
        newdirlim = 0xb902de <pure+3799998> ""
        target = 0x59025a <BUFFER_OBJFWDP+24> "\203\370\003\017\224\300\311\303UH\211\345H\203\354\020H\211}\370\017\266\005s\354g"
        tlen = 3
        pw = 0xbfaa40 <bo_fwd>
        length = 0
        nbytes = 5532672
        handler = XIL(0)
        result = XIL(0xf5462ce2d34d2200)
        handled_name = XIL(0x7f0744)
        multibyte = true
        hdir = XIL(0x7f0764)
        sa_avail = 16382
        sa_count = 9
        sa_must_free = false
        defdir_multibyte = true
#3  0x0000000000658beb in funcall_subr (subr=0x7eed80 <Sexpand_file_name>, numargs=1, args=0x7fffffffc708) at eval.c:2853
        internal_argbuf = {XIL(0x82d87c), XIL(0), XIL(0x7eed85), XIL(0x7fffffffc648), XIL(0x7eed80), XIL(0x7fffffffc640), XIL(0x58f137), XIL(0x7eed85)}
        internal_args = 0x7fffffffc600
#4  0x00000000006586e2 in Ffuncall (nargs=2, args=0x7fffffffc700) at eval.c:2776
        fun = XIL(0x7eed85)
        original_fun = XIL(0x5580)
        funcar = XIL(0)
        numargs = 1
        val = XIL(0)
        count = 8
#5  0x00000000006b152d in exec_byte_code (bytestr=XIL(0x8472ac), vector=XIL(0x8472cd), maxdepth=make_number(10), args_template=make_number(257), nargs=1, args=0x7fffffffcc58) at bytecode.c:630
        op = 1
        type = (unknown: 4)
        targets = 
        const_length = 38
        bytestr_length = 227
        vectorp = 0x8472d0 <pure+355248>
        quitcounter = 1 '\001'
        stack_items = 11
        sa_avail = 16069
        sa_count = 6
        sa_must_free = false
        stack_base = 0x7fffffffc6d0
        stack_lim = 0x7fffffffc728
        top = 0x7fffffffc700
        void_stack_lim = 0x7fffffffc728
        bytestr_data = 0x7fffffffc728 "\306 \307\310\311\312\313\005!\314\"\315$\216\b\203."
        pc = 0x7fffffffc785 "#\210\327\033\330\331\303\324N!\332Q\023\333\v!\203t"
        count = 6
        result = XIL(0x7fffffffca70)
#6  0x0000000000659332 in funcall_lambda (fun=XIL(0x84727d), nargs=1, arg_vector=0x7fffffffcc50) at eval.c:2977
        size = 5
        val = XIL(0x58e8e3)
        syms_left = make_number(257)
        next = XIL(0x847278)
        lexenv = XIL(0x7fffffffcbb8)
        count = 6
        i = 77322061600
        optional = false
        rest = false
        previous_optional_or_rest = false
#7  0x0000000000658726 in Ffuncall (nargs=2, args=0x7fffffffcc48) at eval.c:2778
        fun = XIL(0x84727d)
        original_fun = XIL(0x47d9f0)
        funcar = XIL(0xcbaac0)
        numargs = 1
        val = XIL(0x47d0)
        count = 5
#8  0x00000000006b152d in exec_byte_code (bytestr=XIL(0x8f7774), vector=XIL(0x8f7795), maxdepth=make_number(12), args_template=make_number(0), nargs=0, args=0x7fffffffd240) at bytecode.c:630
        op = 1
        type = (CONDITION_CASE | CATCHER_ALL | unknown: 32764)
        targets = 
        const_length = 77
        bytestr_length = 447
        vectorp = 0x8f7798 <pure+1077368>
        quitcounter = 39 '\''
        stack_items = 13
        sa_avail = 15833
        sa_count = 5
        sa_must_free = false
        stack_base = 0x7fffffffcc40
        stack_lim = 0x7fffffffcca8
        top = 0x7fffffffcc48
        void_stack_lim = 0x7fffffffcca8
        bytestr_data = 0x7fffffffcca8 "\b\203\b"
        pc = 0x7fffffffce07 "\024\202h\001\365\366\367\"\210\016F\332\370\371\335\336\005!\372\"\373$\216\374 \210)\210\375\376\377\"\210\201H"
        count = 5
        result = XIL(0)
#9  0x0000000000659332 in funcall_lambda (fun=XIL(0x8f7745), nargs=0, arg_vector=0x7fffffffd240) at eval.c:2977
        size = 5
        val = XIL(0x7fffffffd240)
        syms_left = make_number(0)
        next = XIL(0x5904bc)
        lexenv = make_number(0)
        count = 5
        i = 6673927
        optional = 127
        rest = false
        previous_optional_or_rest = false
#10 0x0000000000658f9b in apply_lambda (fun=XIL(0x8f7745), args=XIL(0), count=4) at eval.c:2913
        args_left = XIL(0)
        i = 0
        numargs = 0
        arg_vector = 0x7fffffffd240
        tem = XIL(0x1200c10720)
        sa_avail = 16384
        sa_count = 5
        sa_must_free = false
#11 0x0000000000656f91 in eval_sub (form=XIL(0x13b2e63)) at eval.c:2286
        fun = XIL(0x8f7745)
        val = XIL(0xc0fe40)
        original_fun = XIL(0xe22310)
        original_args = XIL(0)
        funcar = XIL(0xc10720)
        count = 4
        argvals = {XIL(0x11c40c0), XIL(0xc18130), make_number(1458326), XIL(0x11c40c0), XIL(0x7fffffffd3c0), XIL(0x65a5e4), XIL(0), XIL(0x7a10)}
#12 0x0000000000656246 in Feval (form=XIL(0x13b2e63), lexical=XIL(0)) at eval.c:2061
        count = 3
#13 0x000000000059920e in top_level_2 () at keyboard.c:1119
#14 0x0000000000654514 in internal_condition_case (bfun=0x5991eb <top_level_2>, handlers=XIL(0x5280), hfun=0x598bd2 <cmd_error>) at eval.c:1336
        val = XIL(0xca2a83)
        c = 0x2c6a440
#15 0x0000000000599253 in top_level_1 (ignore=XIL(0)) at keyboard.c:1127
#16 0x00000000006539bd in internal_catch (tag=XIL(0xc900), func=0x599210 <top_level_1>, arg=XIL(0)) at eval.c:1101
        val = make_number(1455970)
        c = 0x2c6a320
#17 0x000000000059913d in command_loop () at keyboard.c:1088
#18 0x00000000005986bc in recursive_edit_1 () at keyboard.c:695
        count = 1
        val = XIL(0x7fffffffd540)
#19 0x00000000005988b1 in Frecursive_edit () at keyboard.c:766
        count = 0
        buffer = XIL(0)
#20 0x0000000000596325 in main (argc=5, argv=0x7fffffffd758) at emacs.c:1722
        stack_bottom_variable = 0x2c5f500
        do_initial_setlocale = true
        dumping = false
        skip_args = 1
        no_loadup = false
        junk = 0x0
        dname_arg = 0x0
        ch_to_dir = 0x0
        original_pwd = 0x0
        disable_aslr = false
        rlim = {
          rlim_cur = 10022912, 
          rlim_max = 18446744073709551615
        }
        sockfd = -1
        module_assertions = false

Lisp Backtrace:
"expand-file-name" (0xffffc708)
"abbreviate-file-name" (0xffffcc50)
"normal-top-level" (0xffffd240)
"expand-file-name" (0xffffc708)
"abbreviate-file-name" (0xffffcc50)
"normal-top-level" (0xffffd240)

In GNU Emacs 26.2.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.2)
 of 2019-06-17
Repository revision: 81535eeadb5b9b964dd195b2720de2b1fc432c6e
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	Debian GNU/Linux rodete

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Eager macro-expansion failure: (error "Unknown seq pattern: (seq 3 (pred (lambda (c) (and (characterp c) (= (aref (symbol-name (category c)) 0) 76)))))")
C-c C-c is undefined

Configured using:
 'configure --enable-checking=all --enable-gcc-warnings=warn-only
 --enable-gtk-deprecation-warnings --enable-check-lisp-object-type
 --with-modules 'CFLAGS=-O0 -ggdb3 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' --without-pop 'LDFLAGS=-Wl,-z,relro
 -Wl,-fuse-ld=gold''

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY GNUTLS FREETYPE
XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS
LIBSYSTEMD

Important settings:
  value of $LANG: en_US.UTF-8
  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
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-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 sort mail-extr emacsbug message rmc puny seq dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec epa epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils phst skeleton derived
edmacro kmacro pcase ffap thingatpt url-parse auth-source cl-seq eieio
byte-opt bytecomp byte-compile cconv eieio-core cl-macs gv
eieio-loaddefs password-cache url-vars subr-x rx gnutls dbus xml
cl-loaddefs cl-lib elec-pair time-date 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 dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 109060 6105)
 (symbols 48 22238 1)
 (miscs 40 41 128)
 (strings 32 32963 1633)
 (string-bytes 1 896833)
 (vectors 16 16193)
 (vector-slots 8 535544 8856)
 (floats 8 54 63)
 (intervals 56 228 0)
 (buffers 992 12))

-- 
Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

If you received this communication by mistake, please don’t forward it to
anyone else (it may contain confidential or privileged information), please
erase all copies of it, including all attachments, and please let the sender
know it went to the wrong person.  Thanks.