Subject: Re: bug#23573: segfault when starting Emacs using X11

From: Zack Piper <[email-masked]>
Date: Wed, 18 May 2016 16:07:19 +0000

On Wed, May 18, 2016 at 11:00:37AM +0000, Zack Piper wrote:
> Hi!
> 
> Apparently starting Emacs in an X11 window makes it segfault.
> 
> 
> Steps to reproduce:
> 
> `emacs -Q` (make sure it's running under X11)
> 
> Segfault will occur.
> 
> 
> Version info:
> 
>   openSUSE 42.1, Emacs 07ebcf1bd964ae64446c52fb5481e919ed577358 (latest from master branch)
> 
> Emacs compiled with: CLFAGS='O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type --with-rsvg --with-gif --with-xft --prefix=/home/zack/ins --with-gnutls --with-modules  --with-xwidgets
> 
> 
> GDB info:
> 

I forgot to `make install` when I compiled for use with debugging, unoptimised output follows:

xfaces.c:5449: Emacs fatal error: assertion failed: FRAME_FACE_CACHE (f)->faces_by_id[DEFAULT_FACE_ID]
Fatal error 6: Aborted
Backtrace:
/home/zack/ins/bin/emacs[0x550602]
/home/zack/ins/bin/emacs[0x53298f]
/home/zack/ins/bin/emacs[0x5996fe]
/home/zack/ins/bin/emacs[0x4f6c6e]
/home/zack/ins/bin/emacs[0x4f7aa8]
/home/zack/ins/bin/emacs[0x5babb8]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba4fd]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba4fd]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba63e]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5bc404]
/home/zack/ins/bin/emacs[0x5bacb9]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba63e]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba63e]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba63e]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba63e]
/home/zack/ins/bin/emacs[0x5ba983]
/home/zack/ins/bin/emacs[0x5fdd5d]
/home/zack/ins/bin/emacs[0x5ba63e]
/home/zack/ins/bin/emacs[0x5b978d]
/home/zack/ins/bin/emacs[0x5b9ae3]
/home/zack/ins/bin/emacs[0x5be27c]
/home/zack/ins/bin/emacs[0x532f52]
/home/zack/ins/bin/emacs[0x5b8ead]
/home/zack/ins/bin/emacs[0x532f2c]
/home/zack/ins/bin/emacs[0x5b8e5b]
/home/zack/ins/bin/emacs[0x532e66]
/home/zack/ins/bin/emacs[0x538b48]
/home/zack/ins/bin/emacs[0x538ea8]
/home/zack/ins/bin/emacs[0x41c2d8]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fffed8c1b05]
/home/zack/ins/bin/emacs[0x41cd75]
[New Thread 0x7fffe1911700 (LWP 13583)]
[New Thread 0x7fffe2cc2700 (LWP 13576)]

Program received signal SIGABRT, Aborted.
0x00007fffee49873b in raise () from /lib64/libpthread.so.0
(gdb) bt full
#0  0x00007fffee49873b in raise () at /lib64/libpthread.so.0
#1  0x0000000000532951 in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:395
#2  0x00000000005996fe in die (msg=msg@entry=0x65e718 "FRAME_FACE_CACHE (f)->faces_by_id[DEFAULT_FACE_ID]", file=file@entry=0x668c9b "xfaces.c", line=line@entry=5449) at alloc.c:7219
#3  0x00000000004f6c6e in realize_face (cache=0x19bc760, attrs=0x1377538) at xfaces.c:5449
        stipple = <optimized out>
        overline = <optimized out>
        strike_through = <optimized out>
        box = <optimized out>
        face = 0x1779730
        default_face = <optimized out>
        f = 0x1376220
        underline = <optimized out>
        face = <optimized out>
#4  0x00000000004f6c6e in realize_face (cache=cache@entry=0x19bc760, attrs=0x1377538, former_face_id=former_face_id@entry=0) at xfaces.c:5373
        face = <optimized out>
#5  0x00000000004f7aa8 in Finternal_merge_in_global_face (face=..., frame=...) at xfaces.c:3708
        c = 0x19bc760
        newface = <optimized out>
        oldface = <optimized out>
        attrs =
            {{i = 20688}, {i = 26918132}, {i = 9552708}, {i = 35952}, {i = 454}, {i = 35952}, {i = 35952}, {i = 0}, {i = 0}, {i = 26979972}, {i = 26980004}, {i = 0}, {i = 0}, {i = 0}, {i = 0}, {i = 20423909}, {i = 0}, {i = 2---Type <return> to continue, or q <return> to quit---
6956548}, {i = 48768}}
        i = <optimized out>
        global_lface = {i = 13756765}
        gvec = 0xd1e960
        lvec = <optimized out>
#6  0x00000000005babb8 in Ffuncall (nargs=3, args=<optimized out>) at eval.c:2704
        internal_argbuf =
            {{i = 0}, {i = 4462871}, {i = 45312}, {i = 5925832}, {i = 26980004}, {i = 0}, {i = 31536}, {i = 6040709}}
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 2
        val = <optimized out>
        internal_args = <optimized out>
        count = 25
#7  0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=nargs@entry=0, args=0x8d7b30 <re_max_failures>, args@entry=0x0) at bytecode.c:880
        targets =
        stack =
---Type <return> to continue, or q <return> to quit---
          {pc = 0xc18890 <pure+3393936> "0\202\"", byte_string = {i = 9829156}, byte_string_start = 0xc18876 <pure+3393910> "\306 \237\307\030\211\031\203*", next = 0x7fffffffb610}
        type = (unknown: 13040)
#8  0x00000000005ba4fd in funcall_lambda (fun=..., nargs=nargs@entry=2, arg_vector=arg_vector@entry=0x7fffffffb5b0) at eval.c:2929
        syms_left = {i = 0}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#9  0x00000000005ba983 in Ffuncall (nargs=3, args=0x7fffffffb5a8) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 2
        val = <optimized out>
        internal_args = <optimized out>
        count = 20
#10 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=nargs@entry=0, args=0x8d7b30 <re_max_failures>, args@entry=0x0) at bytecode.c:880
        targets =
de+911>, 0x5fddef <exec_byte_code+911>, 0x5fddef <exec_byte_code+911>, 0x5fe02a <exec_byte_code+1482> <repeats 64 times>}
        stack =
          {pc = 0xc18940 <pure+3394112> "\210\n\204W", byte_string = {i = 9828532}, byte_string_start = 0xc188f5 <pure+3394037> "\306\b!\020\307\b!\031\310\b\236\032\311\033ʉ\034\035\v\312\036\026\211\036\027\203\060", next = 0x7fffffffb7d0}
        type = (unknown: 13040)
#11 0x00000000005ba4fd in funcall_lambda (fun=..., nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffb788) at eval.c:2929
        syms_left = {i = 0}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#12 0x00000000005ba983 in Ffuncall (nargs=2, args=0x7fffffffb780) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 1
        val = <optimized out>
        internal_args = <optimized out>
        count = 12
#13 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0,
    nargs@entry=1, args=0x8d7b30 <re_max_failures>, args@entry=0x7fffffffba68) at bytecode.c:880
        targets =
---Type <return> to continue, or q <return> to quit---
        stack =
          {pc = 0x1495fdb "\207", byte_string = {i = 21897236}, byte_string_start = 0x1495fd8 "\300\001!\207", next = 0x7fffffffbb00}
        type = (unknown: 13040)
#14 0x00000000005ba63e in funcall_lambda (fun=..., nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffba68) at eval.c:2863
        size = <optimized out>
        syms_left = {i = 1030}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#15 0x00000000005ba983 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7fffffffba60) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 1
        val = <optimized out>
        internal_args = <optimized out>
---Type <return> to continue, or q <return> to quit---
        count = 11
#16 0x00000000005bc404 in Fapply (nargs=2, args=0x7fffffffba60) at eval.c:2286
        i = <optimized out>
        numargs = <optimized out>
        funcall_nargs = <optimized out>
        funcall_args = 0x0
        spread_arg = <optimized out>
        fun = {i = 20083605}
        retval = <optimized out>
        sa_avail = 16384
        sa_must_free = false
#17 0x00000000005bacb9 in Ffuncall (nargs=3, args=<optimized out>) at eval.c:2681
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 2
        val = <optimized out>
        internal_args = <optimized out>
        count = 10
#18 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0,
    nargs@entry=1, args=0x8d7b30 <re_max_failures>, args@entry=0x7fffffffbca0) at bytecode.c:880
        targets =
de+911>, 0x5fddef <exec_byte_code+911>, 0x5fddef <exec_byte_code+911>, 0x5fe02a <exec_byte_code+1482> <repeats 64 times>}
        stack =
          {pc = 0x154d1ed "\207", byte_string = {i = 18743892}, byte_string_start = 0x154d1c0 "\f\306\307\002\r\"\303\307\002\002\"\206)", next = 0x7fffffffbd10}
        type = (unknown: 13040)
#19 0x00000000005ba63e in funcall_lambda (fun=..., nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffbca0) at eval.c:2863
        size = <optimized out>
        syms_left = {i = 514}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#20 0x00000000005ba983 in Ffuncall (nargs=2, args=0x7fffffffbc98) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 1
        val = <optimized out>
        internal_args = <optimized out>
        count = 9
#21 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0,
    nargs@entry=1, args=0x8d7b30 <re_max_failures>, args@entry=0x7fffffffbe80) at bytecode.c:880
        targets =
---Type <return> to continue, or q <return> to quit---
        stack =
          {pc = 0xbda479 <pure+3138937> ")\262\001\326\001!\210\f\211\203", <incomplete sequence \323>, byte_string = {i = 10465772}, byte_string_start = 0xbda3d1 <pure+3138769> "\306\001\236A\307\002\236\203.", next = 0x7fffffffbef0}
        type = (unknown: 13040)
#22 0x00000000005ba63e in funcall_lambda (fun=..., nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffbe80) at eval.c:2863
        size = <optimized out>
        syms_left = {i = 1026}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#23 0x00000000005ba983 in Ffuncall (nargs=2, args=0x7fffffffbe78) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 1
        val = <optimized out>
---Type <return> to continue, or q <return> to quit---
        internal_args = <optimized out>
        count = 7
#24 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=nargs@entry=0, args=0x8d7b30 <re_max_failures>, args@entry=0x7fffffffc060) at bytecode.c:880
        targets =
        stack =
          {pc = 0xbdab66 <pure+3140710> "\211\026\022\026\023\315\v!\023\316\016\022\317\320\n\317\"#\210\321\n!\210ʉ\022\207", byte_string = {i = 10462236}, byte_string_start = 0xbdab3f <pure+3140671> "\b\205A", next = 0x7fffffffc140}
        type = (unknown: 13040)
#25 0x00000000005ba63e in funcall_lambda (fun=..., nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7fffffffc060) at eval.c:2863
        size = <optimized out>
        syms_left = {i = 2}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
---Type <return> to continue, or q <return> to quit---
#26 0x00000000005ba983 in Ffuncall (nargs=1, args=0x7fffffffc058) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 0
        val = <optimized out>
        internal_args = <optimized out>
        count = 6
#27 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=nargs@entry=0, args=0x8d7b30 <re_max_failures>, args@entry=0x7fffffffc2b8) at bytecode.c:880
        targets =
        stack =
          {pc = 0xbd61fd <pure+3121917> "\210\201\216", byte_string = {i = 10500868}, byte_string_start = 0xbd5efc <pure+3121148> "\306 \020\307\021\n\023\307\024\310\311!\211\307=\204\060", next = 0x7fffffffc350}
        type = (unknown: 13040)
#28 0x00000000005ba63e in funcall_lambda (fun=..., nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7fffffffc2b8) at eval.c:2863
        size = <optimized out>
        syms_left = {i = 2}
        next = <optimized out>
---Type <return> to continue, or q <return> to quit---
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#29 0x00000000005ba983 in Ffuncall (nargs=1, args=0x7fffffffc2b0) at eval.c:2762
        fun = <optimized out>
        funcar = <optimized out>
        numargs = 0
        val = <optimized out>
        internal_args = <optimized out>
        count = 5
#30 0x00000000005fdd5d in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=nargs@entry=0, args=0x8d7b30 <re_max_failures>, args@entry=0x7fffffffc410) at bytecode.c:880
        targets =
        stack =
          {pc = 0xbd6c01 <pure+3124481> "\210)\210\375\376\377\"\210\201H", byte_string = {i = 10496876}, byte_string_start = 0xbd6a8d <pure+3124109> "\b\203\b", next = 0x0}
        type = (unknown: 13040)
#31 0x00000000005ba63e in funcall_lambda (fun=fun@entry=..., nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x---Type <return> to continue, or q <return> to quit---
7fffffffc410) at eval.c:2863
        size = <optimized out>
        syms_left = {i = 2}
        next = <optimized out>
        lexenv = <optimized out>
        i = <optimized out>
        optional = <optimized out>
        rest = <optimized out>
#32 0x00000000005b978d in apply_lambda (fun=..., args=..., count=count@entry=3) at eval.c:2802
        args_left = <optimized out>
        i = <optimized out>
        tem = {i = 4611686019484352512}
        sa_avail = <optimized out>
        sa_must_free = false
#33 0x00000000005b9ae3 in eval_sub (form=..., form@entry=...) at eval.c:2249
        fun = <optimized out>
        val = <optimized out>
        original_fun = {i = 8962648}
        original_args = {i = 0}
        funcar = <optimized out>
        count = 3
        argvals =
            {{i = 124}, {i = 140733193388123}, {i = 0}, {i = 13492600}, {i = 13492600}, {i = 28944}, {i = 0}, {i = 22831536}}
#34 0x00000000005be27c in Feval (form=..., lexical=..., lexical@entry=...) at eval.c:1996
---Type <return> to continue, or q <return> to quit---
#35 0x0000000000532f52 in top_level_2 () at keyboard.c:1108
#36 0x00000000005b8ead in internal_condition_case (bfun=bfun@entry=0x532f40 <top_level_2>, handlers=...,
    handlers@entry=..., hfun=hfun@entry=0x539000 <cmd_error>) at eval.c:1310
        val = {i = 0}
        c = <optimized out>
#37 0x0000000000532f2c in top_level_1 (ignore=..., ignore@entry=...) at keyboard.c:1116
#38 0x00000000005b8e5b in internal_catch (tag=...,
    tag@entry=..., func=func@entry=0x532ed0 <top_level_1>, arg=..., arg@entry=...) at eval.c:1075
        val = {i = 0}
        c = <optimized out>
#39 0x0000000000532e66 in command_loop () at keyboard.c:1077
#40 0x0000000000538b48 in recursive_edit_1 () at keyboard.c:684
        val = <optimized out>
#41 0x0000000000538ea8 in Frecursive_edit () at keyboard.c:755
#42 0x000000000041c2d8 in main (argc=<optimized out>, argv=0x7fffffffc7c8) at emacs.c:1643
        dummy = {i = 140737488340608}
        stack_bottom_variable = -9 '\367'
        do_initial_setlocale = <optimized out>
        dumping = <optimized out>
        skip_args = 0
        rlim = {rlim_cur = 8720000, rlim_max = 18446744073709551615}
        no_loadup = false
        junk = 0x0
        dname_arg = 0x0
        ch_to_dir = 0x0
---Type <return> to continue, or q <return> to quit---
        original_pwd = 0x0
        sockfd = -1
(gdb)

-- 
Zack Piper <[email-masked]> https://apertron.net