Bug#909328: More information and new backtrace

Bernhard Übelacker bernhardu at mailbox.org
Tue Sep 25 00:20:22 BST 2018


Hello all,
in my first attempt I assumed this happens with xorg.

In this attempt I could reproduce the issue within a
gnome wayland session inside a amd64 buster VM.

As far as I see for both terminals there is just one
process gnome-terminal-server - therefore if that fails
both windows disappear.

In "journalctl -f" appears following:
    gnome-shell[4936]: Could not import pending buffer: Failed to create texture 2d due to size/format constraints
    gnome-shell[4936]: WL: error in client communication (pid 5736)
    gnome-terminal-[5736]: Error 71 (Protokollfehler) dispatching to Wayland display.

This I assume is kind of a "clean" shutdown of the gnome-terminal-server process.
An attached debugger does not trap.


Because of the terminal disasspearing the vim process receives now
following signals:

Program received signal SIGHUP, Hangup.
Program received signal SIGCONT, Continued.
Program received signal SIGSEGV, Segmentation fault.
Program received signal SIGABRT, Aborted.
Program received signal SIGSEGV, Segmentation fault.
Program terminated with signal SIGSEGV, Segmentation fault.

A core dump recorded by systemd-coredump shows just the last SIGSEGV.
See attached file for the stacks on each signal.

So I assume there are really two problems:

- gnome-terminal-server requests some situation that gnome-shell could not deliver,
  therefore it should possibly avoid such a request.

- vim seems to have a problem to handle SIGHUPs while currently reacting to user input.
  Sending a SIGHUP while vim is idle does not produce a SIGSEGV.
  Also I thought inside a signal handler should be done just the absolute necessary,
  at least stdio/printf or malloc is forbidden - does this apply to sprintf too?

Kind regards,
Bernhard
-------------- next part --------------

apt update
apt install mc htop weston systemd-coredump strace valgrind gdb debian-goodies lz4 dpkg-dev devscripts tmux vim gnome-session gnome-terminal

systemctl start gdm3


mkdir vim/orig -p
cd    vim/orig
apt source vim
cd ../..


mkdir ncurses/orig -p
cd    ncurses/orig
apt source ncurses
cd ../..


mkdir libc6/orig -p
cd    libc6/orig
apt source libc6
cd ../..


# login

# open terminal
# open second terminal


root at debian:~# ps aux | grep -i gnome-term
benutzer  5736  1.7  1.3 407636 42924 tty2     Sl+  22:53   0:00 /usr/lib/gnome-terminal/gnome-terminal-server


vim test.txt
set lines=999

Sep 24 22:54:39 debian gnome-shell[4936]: Could not import pending buffer: Failed to create texture 2d due to size/format constraints
Sep 24 22:54:39 debian gnome-shell[4936]: WL: error in client communication (pid 5736)
Sep 24 22:54:39 debian gnome-terminal-[5736]: Error 71 (Protokollfehler) dispatching to Wayland display.
Sep 24 22:54:39 debian systemd[1]: Started Process Core Dump (PID 5777/UID 0).
Sep 24 22:54:39 debian systemd-coredump[5778]: Process 5776 (vim) of user 1000 dumped core.
                                               
                                               Stack trace of thread 5776:
                                               #0  0x00007effd8d5a717 tcache_get (libc.so.6)
                                               #1  0x00007effd8d45bbb __fopen_internal (libc.so.6)
                                               #2  0x000056262a4b8c29 n/a (vim.basic)
                                               #3  0x000056262a62cfec n/a (vim.basic)
                                               #4  0x000056262a56964b n/a (vim.basic)
                                               #5  0x00007effd8d0cfc0 __restore_rt (libc.so.6)
                                               #6  0x00007effd8d0cf3b __GI_raise (libc.so.6)
                                               #7  0x00007effd8d0e2f1 __GI_abort (libc.so.6)
                                               #8  0x00007effd8d4f867 __libc_message (libc.so.6)
                                               #9  0x00007effd8d55e0a malloc_printerr (libc.so.6)
                                               #10 0x00007effd8d5636c munmap_chunk (libc.so.6)
                                               #11 0x00007effd8d45ca2 __fopen_internal (libc.so.6)
                                               #12 0x000056262a4b8c29 n/a (vim.basic)
                                               #13 0x000056262a62cfec n/a (vim.basic)
                                               #14 0x00007effd8d0cfc0 __restore_rt (libc.so.6)
                                               #15 0x00007effd8d25356 _IO_vfprintf_internal (libc.so.6)
                                               #16 0x00007effd8ddd94f ___vsprintf_chk (libc.so.6)



cat /var/lib/systemd/coredump/core.vim.1000.64142658a3b9454598e120cd13728d3c.5776.1537822479000000.lz4 | unlz4 > /tmp/core.5776

root at debian:~# find-dbgsym-packages /tmp/core.5776
libacl1-dbgsym libattr1-dbgsym libgpm2-dbgsym libpcre3-dbg libselinux1-dbgsym libtinfo6-dbg vim-dbgsym

apt install libacl1-dbgsym libattr1-dbgsym libgpm2-dbgsym libpcre3-dbg libselinux1-dbgsym libtinfo6-dbg vim-dbgsym


set width 0
set height 0
set pagination off
directory /home/benutzer/vim/orig/vim-8.1.0320/src
directory /home/benutzer/libtinfo6/orig/ncurses-6.1+20180714/ncurses/tinfo
directory /home/benutzer/libc6/orig/glibc-2.27/debug
directory /home/benutzer/libc6/orig/glibc-2.27/stdio-common

root at debian:~# coredumpctl gdb 5776
           PID: 5776 (vim)
           UID: 1000 (benutzer)
           GID: 1000 (benutzer)
        Signal: 11 (SEGV)
     Timestamp: Mon 2018-09-24 22:54:39 CEST (23min ago)
  Command Line: vim test.txt
    Executable: /usr/bin/vim.basic
 Control Group: /user.slice/user-1000.slice/session-4.scope
          Unit: session-4.scope
         Slice: user-1000.slice
       Session: 4
     Owner UID: 1000 (benutzer)
       Boot ID: 64142658a3b9454598e120cd13728d3c
    Machine ID: 32f43b50ac8c4b21941bc0b02f8e7811
      Hostname: debian
       Storage: /var/lib/systemd/coredump/core.vim.1000.64142658a3b9454598e120cd13728d3c.5776.1537822479000000.lz4
       Message: Process 5776 (vim) of user 1000 dumped core.
                
                Stack trace of thread 5776:
                #0  0x00007effd8d5a717 tcache_get (libc.so.6)
                #1  0x00007effd8d45bbb __fopen_internal (libc.so.6)
                #2  0x000056262a4b8c29 n/a (vim.basic)
                #3  0x000056262a62cfec n/a (vim.basic)
                #4  0x000056262a56964b n/a (vim.basic)
                #5  0x00007effd8d0cfc0 __restore_rt (libc.so.6)
                #6  0x00007effd8d0cf3b __GI_raise (libc.so.6)
                #7  0x00007effd8d0e2f1 __GI_abort (libc.so.6)
                #8  0x00007effd8d4f867 __libc_message (libc.so.6)
                #9  0x00007effd8d55e0a malloc_printerr (libc.so.6)
                #10 0x00007effd8d5636c munmap_chunk (libc.so.6)
                #11 0x00007effd8d45ca2 __fopen_internal (libc.so.6)
                #12 0x000056262a4b8c29 n/a (vim.basic)
                #13 0x000056262a62cfec n/a (vim.basic)
                #14 0x00007effd8d0cfc0 __restore_rt (libc.so.6)
                #15 0x00007effd8d25356 _IO_vfprintf_internal (libc.so.6)
                #16 0x00007effd8ddd94f ___vsprintf_chk (libc.so.6)

GNU gdb (Debian 8.1-4) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/vim.basic...Reading symbols from /usr/lib/debug/.build-id/83/62b47ca643b4ae5ff3b82e878ea6b2eeb0a032.debug...done.
done.

warning: core file may not match specified executable file.
[New LWP 5776]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `vim test.txt'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  tcache_get (tc_idx=33) at malloc.c:2943
2943    malloc.c: Datei oder Verzeichnis nicht gefunden.
(gdb) set width 0
(gdb) set height 0
(gdb) set pagination off
(gdb) directory /home/benutzer/vim/orig/vim-8.1.0320/src
Source directories searched: /home/benutzer/vim/orig/vim-8.1.0320/src:$cdir:$cwd
(gdb) bt
#0  tcache_get (tc_idx=33) at malloc.c:2943
#1  __GI___libc_malloc (bytes=bytes at entry=552) at malloc.c:3050
#2  0x00007effd8d45bbb in __fopen_internal (filename=filename at entry=0x56262bd56eb0 "/home/benutzer/.viminfo", mode=mode at entry=0x56262a658595 "r", is32=is32 at entry=1) at iofopen.c:65
#3  0x00007effd8d45cba in _IO_new_fopen (filename=filename at entry=0x56262bd56eb0 "/home/benutzer/.viminfo", mode=mode at entry=0x56262a658595 "r") at iofopen.c:89
#4  0x000056262a4b8c29 in write_viminfo (file=<optimized out>, forceit=0) at ex_cmds.c:1923
#5  0x000056262a62cfec in getout (exitval=exitval at entry=1) at main.c:1477
#6  0x000056262a56964b in deathtrap (sigarg=6) at os_unix.c:1205
#7  <signal handler called>
#8  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#9  0x00007effd8d0e2f1 in __GI_abort () at abort.c:79
#10 0x00007effd8d4f867 in __libc_message (action=action at entry=do_abort, fmt=fmt at entry=0x7effd8e59273 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#11 0x00007effd8d55e0a in malloc_printerr (str=str at entry=0x7effd8e5ab90 "munmap_chunk(): invalid pointer") at malloc.c:5350
#12 0x00007effd8d5636c in munmap_chunk (p=<optimized out>) at malloc.c:2846
#13 0x00007effd8d45ca2 in __fopen_internal (filename=filename at entry=0x56262bd46e60 "/home/benutzer/.viminfo", mode=mode at entry=0x56262a658595 "r", is32=is32 at entry=1) at iofopen.c:82
#14 0x00007effd8d45cba in _IO_new_fopen (filename=filename at entry=0x56262bd46e60 "/home/benutzer/.viminfo", mode=mode at entry=0x56262a658595 "r") at iofopen.c:89
#15 0x000056262a4b8c29 in write_viminfo (file=<optimized out>, forceit=0) at ex_cmds.c:1923
#16 0x000056262a62cfec in getout (exitval=1) at main.c:1477
#17 <signal handler called>
#18 0x00007effd8d25356 in _IO_vfprintf_internal (s=s at entry=0x56262bb27260, format=format at entry=0x7effd94f8204 "%.*s", ap=ap at entry=0x56262bb273a0) at vfprintf.c:1275
#19 0x00007effd8ddd94f in ___vsprintf_chk (s=0x56262bb274d0 "", flags=1, slen=18446744073709551615, format=0x7effd94f8204 "%.*s", args=0x56262bb273a0) at vsprintf_chk.c:83
#20 0x0000000000000000 in ?? ()







############
############
############





# open gnome-terminal
vim


root at debian:~# ps aux | grep -i vim
benutzer  6528  0.0  0.2  19816  7724 pts/4    S+   23:35   0:00 vim



set width 0
set height 0
set pagination off
directory /home/benutzer/vim/orig/vim-8.1.0320/src
directory /home/benutzer/libtinfo6/orig/ncurses-6.1+20180714/ncurses/tinfo
directory /home/benutzer/libc6/orig/glibc-2.27/debug
directory /home/benutzer/libc6/orig/glibc-2.27/stdio-common

# handle SIGHUP nostop
# handle SIGCONT nostop



root at debian:~# gdb -q --pid 6528
Attaching to process 6528
Reading symbols from /usr/bin/vim.basic...Reading symbols from /usr/lib/debug/.build-id/83/62b47ca643b4ae5ff3b82e878ea6b2eeb0a032.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...Reading symbols from /usr/lib/debug/.build-id/fa/b2857727406caccd7ab22e1729b09ccf2c3eb7.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libtinfo.so.6...Reading symbols from /usr/lib/debug/.build-id/13/63374c7f2779852f798b1021141d3d9f17b637.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libselinux.so.1...Reading symbols from /usr/lib/debug/.build-id/1a/4dec72d8f14eee29719a9dcc42e187876919f4.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libacl.so.1...Reading symbols from /usr/lib/debug/.build-id/c3/ae8538005a97d3e3b56baafb2c4b7f55bf04b9.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libgpm.so.2...Reading symbols from /usr/lib/debug/.build-id/52/66a286acbe5655a354dd50713aef34ffe45a14.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug/.build-id/b7/883b3fc771cfa5fcb452861bbb97a5b646259b.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug/.build-id/dc/87cd1e2b171a4c51139cb4e1f2ec630e711de3.debug...done.
done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug/.build-id/dc/5cb16f5e644116cac64a4c3f5da4d081b81a4f.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libpcre.so.3...Reading symbols from /usr/lib/debug/.build-id/fe/f5a63d991ad093b4e18d0723aad3d373117f5c.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libattr.so.1...Reading symbols from /usr/lib/debug/.build-id/29/bb412cf7f7fd5d2bdc9a1425ce4f49389e9eeb.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug/.build-id/c1/969b6ac0e7a64f9cd88fdce8b584ccfc16623d.debug...done.
done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from /usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so...Reading symbols from /usr/lib/debug/.build-id/ef/4caeedd86dc6013cef73edf326b10cc140df5c.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libnss_files.so.2...Reading symbols from /usr/lib/debug/.build-id/d7/54e01a03186c5d2e728a528c09e32ee8388d48.debug...done.
done.
0x00007f0ddd5aea87 in __GI___select (nfds=1, readfds=readfds at entry=0x7ffd4748ef80, writefds=writefds at entry=0x7ffd4748f000, exceptfds=exceptfds at entry=0x7ffd4748f080, timeout=0x0)
    at ../sysdeps/unix/sysv/linux/select.c:41
41      ../sysdeps/unix/sysv/linux/select.c: Datei oder Verzeichnis nicht gefunden.
(gdb) set width 0
(gdb) set height 0
(gdb) set pagination off
(gdb) directory /home/benutzer/vim/orig/vim-8.1.0320/src
Source directories searched: /home/benutzer/vim/orig/vim-8.1.0320/src:$cdir:$cwd
(gdb) cont
Continuing.

Program received signal SIGHUP, Hangup.
0x000055c2be6c8bce in screen_fill (start_row=<optimized out>, end_row=998, start_col=0, end_col=80, c1=c1 at entry=126, c2=c2 at entry=32, attr=<optimized out>) at screen.c:8729
8729                            ScreenLinesUC[off] = 0;
(gdb) bt
#0  0x000055c2be6c8bce in screen_fill (start_row=<optimized out>, end_row=998, start_col=0, end_col=80, c1=c1 at entry=126, c2=c2 at entry=32, attr=<optimized out>) at screen.c:8729
#1  0x000055c2be6c92a0 in win_draw_end (wp=wp at entry=0x55c2bf727070, c1=c1 at entry=126, c2=c2 at entry=32, row=row at entry=1, endrow=998, hl=hl at entry=HLF_EOB) at screen.c:2475
#2  0x000055c2be6d4840 in win_update (wp=wp at entry=0x55c2bf727070) at screen.c:2317
#3  0x000055c2be6d64b9 in update_screen (type_arg=<optimized out>) at screen.c:777
#4  0x000055c2be757bd7 in main_loop (cmdwin=0, noexmode=0) at main.c:1242
#5  0x000055c2be758701 in vim_main2 () at main.c:919
#6  0x000055c2be5913f5 in main (argc=<optimized out>, argv=<optimized out>) at main.c:443
(gdb) cont
Continuing.

Program received signal SIGCONT, Continued.
deathtrap (sigarg=1) at os_unix.c:1083
1083        if (lc_active)
(gdb) bt
#0  deathtrap (sigarg=1) at os_unix.c:1083
#1  <signal handler called>
#2  0x000055c2be6c8bce in screen_fill (start_row=<optimized out>, end_row=998, start_col=0, end_col=80, c1=c1 at entry=126, c2=c2 at entry=32, attr=<optimized out>) at screen.c:8729
#3  0x000055c2be6c92a0 in win_draw_end (wp=wp at entry=0x55c2bf727070, c1=c1 at entry=126, c2=c2 at entry=32, row=row at entry=1, endrow=998, hl=hl at entry=HLF_EOB) at screen.c:2475
#4  0x000055c2be6d4840 in win_update (wp=wp at entry=0x55c2bf727070) at screen.c:2317
#5  0x000055c2be6d64b9 in update_screen (type_arg=<optimized out>) at screen.c:777
#6  0x000055c2be757bd7 in main_loop (cmdwin=0, noexmode=0) at main.c:1242
#7  0x000055c2be758701 in vim_main2 () at main.c:919
#8  0x000055c2be5913f5 in main (argc=<optimized out>, argv=<optimized out>) at main.c:443
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007f0ddd50d356 in _IO_vfprintf_internal (s=s at entry=0x55c2bf721260, format=format at entry=0x7f0dddce0204 "%.*s", ap=ap at entry=0x55c2bf7213a0) at vfprintf.c:1275
1275    vfprintf.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x00007f0ddd50d356 in _IO_vfprintf_internal (s=s at entry=0x55c2bf721260, format=format at entry=0x7f0dddce0204 "%.*s", ap=ap at entry=0x55c2bf7213a0) at vfprintf.c:1275
#1  0x00007f0ddd5c594f in ___vsprintf_chk (s=0x55c2bf7214d0 "", flags=1, slen=18446744073709551615, format=0x7f0dddce0204 "%.*s", args=args at entry=0x55c2bf7213a0) at vsprintf_chk.c:83
#2  0x00007f0ddd5c587a in ___sprintf_chk (s=s at entry=0x55c2bf7214d0 "", flags=flags at entry=1, slen=slen at entry=18446744073709551615, format=format at entry=0x7f0dddce0204 "%.*s") at sprintf_chk.c:31
#3  0x00007f0dddcd54a6 in sprintf (__fmt=0x7f0dddce0204 "%.*s", __s=0x55c2bf7214d0 "") at /usr/include/x86_64-linux-gnu/bits/stdio2.h:33
#4  _nc_read_entry2 (name=0x55c2bf73cc80 "xterm-256color", filename=filename at entry=0x55c2bf7214d0 "", tp=tp at entry=0x55c2bf764f80) at ../../ncurses/tinfo/read_entry.c:843
#5  0x00007f0dddcce889 in _nc_setup_tinfo (tn=<optimized out>, tp=0x55c2bf764f80) at ../../ncurses/tinfo/lib_setup.c:482
#6  0x00007f0dddccebef in _nc_setupterm (tname=0x55c2bf73cc80 "xterm-256color", Filedes=2, Filedes at entry=1, errret=errret at entry=0x55c2bf722544, reuse=reuse at entry=1) at ../../ncurses/tinfo/lib_setup.c:730
#7  0x00007f0dddccf0f3 in tgetent_sp (sp=0x0, bufp=bufp at entry=0x55c2bf7225b0 "", name=<optimized out>) at ../../ncurses/tinfo/lib_termcap.c:103
#8  0x00007f0dddccf795 in tgetent (bufp=bufp at entry=0x55c2bf7225b0 "", name=<optimized out>) at ../../ncurses/tinfo/lib_termcap.c:210
#9  0x000055c2be7121be in tgetent_error (tbuf=0x55c2bf7225b0 "", term=<optimized out>) at term.c:2178
#10 0x000055c2be71240b in getlinecol (cp=cp at entry=0x55c2bf722de8, rp=rp at entry=0x55c2bf722de0) at term.c:2234
#11 0x000055c2be695024 in mch_get_shellsize () at os_unix.c:4069
#12 0x000055c2be722186 in ui_get_shellsize () at ui.c:345
#13 0x000055c2be713535 in set_shellsize (width=0, height=0, mustset=0) at term.c:3424
#14 0x000055c2be691d2f in handle_resize () at os_unix.c:534
#15 mch_inchar (buf=buf at entry=0x55c2be7eb2e1 <typebuf_init+65> "", maxlen=66, wtime=wtime at entry=0, tb_change_cnt=36) at os_unix.c:417
#16 0x000055c2be721f92 in ui_inchar (buf=buf at entry=0x55c2be7eb2e1 <typebuf_init+65> "", maxlen=maxlen at entry=66, wtime=wtime at entry=0, tb_change_cnt=tb_change_cnt at entry=36) at ui.c:190
#17 0x000055c2be628422 in inchar (buf=0x55c2be7eb2e1 <typebuf_init+65> "", maxlen=199, wait_time=0) at getchar.c:3099
#18 0x000055c2be629c1c in vgetorpeek (advance=advance at entry=0) at getchar.c:2881
#19 0x000055c2be62b597 in vpeekc () at getchar.c:1876
#20 0x000055c2be7122f7 in check_for_codes_from_term () at term.c:6590
#21 0x000055c2be713d44 in check_for_codes_from_term () at term.c:6581
#22 settmode (tmode=2) at term.c:3470
#23 0x000055c2be691690 in after_sigcont () at os_unix.c:1243
#24 sigcont_handler (sigarg=<optimized out>) at os_unix.c:1282
#25 <signal handler called>
#26 deathtrap (sigarg=1) at os_unix.c:1083
#27 <signal handler called>
#28 0x000055c2be6c8bce in screen_fill (start_row=<optimized out>, end_row=998, start_col=0, end_col=80, c1=c1 at entry=126, c2=c2 at entry=32, attr=<optimized out>) at screen.c:8729
#29 0x000055c2be6c92a0 in win_draw_end (wp=wp at entry=0x55c2bf727070, c1=c1 at entry=126, c2=c2 at entry=32, row=row at entry=1, endrow=998, hl=hl at entry=HLF_EOB) at screen.c:2475
#30 0x000055c2be6d4840 in win_update (wp=wp at entry=0x55c2bf727070) at screen.c:2317
#31 0x000055c2be6d64b9 in update_screen (type_arg=<optimized out>) at screen.c:777
#32 0x000055c2be757bd7 in main_loop (cmdwin=0, noexmode=0) at main.c:1242
#33 0x000055c2be758701 in vim_main2 () at main.c:919
#34 0x000055c2be5913f5 in main (argc=<optimized out>, argv=<optimized out>) at main.c:443
(gdb) cont
Continuing.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f0ddd4f62f1 in __GI_abort () at abort.c:79
#2  0x00007f0ddd537867 in __libc_message (action=action at entry=do_abort, fmt=fmt at entry=0x7f0ddd641273 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007f0ddd53de0a in malloc_printerr (str=str at entry=0x7f0ddd642b90 "munmap_chunk(): invalid pointer") at malloc.c:5350
#4  0x00007f0ddd53e36c in munmap_chunk (p=<optimized out>) at malloc.c:2846
#5  0x00007f0ddd52dca2 in __fopen_internal (filename=filename at entry=0x55c2bf9526e0 "/home/benutzer/.viminfo", mode=mode at entry=0x55c2be782595 "r", is32=is32 at entry=1) at iofopen.c:82
#6  0x00007f0ddd52dcba in _IO_new_fopen (filename=filename at entry=0x55c2bf9526e0 "/home/benutzer/.viminfo", mode=mode at entry=0x55c2be782595 "r") at iofopen.c:89
#7  0x000055c2be5e2c29 in write_viminfo (file=<optimized out>, forceit=0) at ex_cmds.c:1923
#8  0x000055c2be756fec in getout (exitval=1) at main.c:1477
#9  <signal handler called>
#10 0x00007f0ddd50d356 in _IO_vfprintf_internal (s=s at entry=0x55c2bf721260, format=format at entry=0x7f0dddce0204 "%.*s", ap=ap at entry=0x55c2bf7213a0) at vfprintf.c:1275
#11 0x00007f0ddd5c594f in ___vsprintf_chk (s=0x55c2bf7214d0 "", flags=1, slen=18446744073709551615, format=0x7f0dddce0204 "%.*s", args=0x55c2bf7213a0) at vsprintf_chk.c:83
#12 0x0000000000000000 in ?? ()
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
tcache_get (tc_idx=33) at malloc.c:2943
2943    malloc.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  tcache_get (tc_idx=33) at malloc.c:2943
#1  __GI___libc_malloc (bytes=bytes at entry=552) at malloc.c:3050
#2  0x00007f0ddd52dbbb in __fopen_internal (filename=filename at entry=0x55c2bf73d7c0 "/home/benutzer/.viminfo", mode=mode at entry=0x55c2be782595 "r", is32=is32 at entry=1) at iofopen.c:65
#3  0x00007f0ddd52dcba in _IO_new_fopen (filename=filename at entry=0x55c2bf73d7c0 "/home/benutzer/.viminfo", mode=mode at entry=0x55c2be782595 "r") at iofopen.c:89
#4  0x000055c2be5e2c29 in write_viminfo (file=<optimized out>, forceit=0) at ex_cmds.c:1923
#5  0x000055c2be756fec in getout (exitval=exitval at entry=1) at main.c:1477
#6  0x000055c2be69364b in deathtrap (sigarg=6) at os_unix.c:1205
#7  <signal handler called>
#8  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#9  0x00007f0ddd4f62f1 in __GI_abort () at abort.c:79
#10 0x00007f0ddd537867 in __libc_message (action=action at entry=do_abort, fmt=fmt at entry=0x7f0ddd641273 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#11 0x00007f0ddd53de0a in malloc_printerr (str=str at entry=0x7f0ddd642b90 "munmap_chunk(): invalid pointer") at malloc.c:5350
#12 0x00007f0ddd53e36c in munmap_chunk (p=<optimized out>) at malloc.c:2846
#13 0x00007f0ddd52dca2 in __fopen_internal (filename=filename at entry=0x55c2bf9526e0 "/home/benutzer/.viminfo", mode=mode at entry=0x55c2be782595 "r", is32=is32 at entry=1) at iofopen.c:82
#14 0x00007f0ddd52dcba in _IO_new_fopen (filename=filename at entry=0x55c2bf9526e0 "/home/benutzer/.viminfo", mode=mode at entry=0x55c2be782595 "r") at iofopen.c:89
#15 0x000055c2be5e2c29 in write_viminfo (file=<optimized out>, forceit=0) at ex_cmds.c:1923
#16 0x000055c2be756fec in getout (exitval=1) at main.c:1477
#17 <signal handler called>
#18 0x00007f0ddd50d356 in _IO_vfprintf_internal (s=s at entry=0x55c2bf721260, format=format at entry=0x7f0dddce0204 "%.*s", ap=ap at entry=0x55c2bf7213a0) at vfprintf.c:1275
#19 0x00007f0ddd5c594f in ___vsprintf_chk (s=0x55c2bf7214d0 "", flags=1, slen=18446744073709551615, format=0x7f0dddce0204 "%.*s", args=0x55c2bf7213a0) at vsprintf_chk.c:83
#20 0x0000000000000000 in ?? ()
(gdb) cont
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.






############
############
############




Inspecting the first SIGSEGV in more detail:

Program received signal SIGSEGV, Segmentation fault.
0x00007fd20d124356 in _IO_vfprintf_internal (s=s at entry=0x561f0ef8e260, format=format at entry=0x7fd20d8f7204 "%.*s", ap=ap at entry=0x561f0ef8e3a0) at vfprintf.c:1275
1275    vfprintf.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x00007fd20d124356 in _IO_vfprintf_internal (s=s at entry=0x561f0ef8e260, format=format at entry=0x7fd20d8f7204 "%.*s", ap=ap at entry=0x561f0ef8e3a0) at vfprintf.c:1275
#1  0x00007fd20d1dc94f in ___vsprintf_chk (s=0x561f0ef8e4d0 "", flags=1, slen=18446744073709551615, format=0x7fd20d8f7204 "%.*s", args=args at entry=0x561f0ef8e3a0) at vsprintf_chk.c:83
#2  0x00007fd20d1dc87a in ___sprintf_chk (s=s at entry=0x561f0ef8e4d0 "", flags=flags at entry=1, slen=slen at entry=18446744073709551615, format=format at entry=0x7fd20d8f7204 "%.*s") at sprintf_chk.c:31
#3  0x00007fd20d8ec4a6 in sprintf (__fmt=0x7fd20d8f7204 "%.*s", __s=0x561f0ef8e4d0 "") at /usr/include/x86_64-linux-gnu/bits/stdio2.h:33
#4  _nc_read_entry2 (name=0x561f0efa9c80 "xterm-256color", filename=filename at entry=0x561f0ef8e4d0 "", tp=tp at entry=0x561f0f1c6e10) at ../../ncurses/tinfo/read_entry.c:843
#5  0x00007fd20d8e5889 in _nc_setup_tinfo (tn=<optimized out>, tp=0x561f0f1c6e10) at ../../ncurses/tinfo/lib_setup.c:482
#6  0x00007fd20d8e5bef in _nc_setupterm (tname=0x561f0efa9c80 "xterm-256color", Filedes=2, Filedes at entry=1, errret=errret at entry=0x561f0ef8f544, reuse=reuse at entry=1) at ../../ncurses/tinfo/lib_setup.c:73
...






(gdb) down
#0  0x00007fd20d124356 in _IO_vfprintf_internal (s=s at entry=0x561f0ef8e260, format=format at entry=0x7fd20d8f7204 "%.*s", ap=ap at entry=0x561f0ef8e3a0) at vfprintf.c:1275
1275      int save_errno = errno;

(gdb) up
#1  0x00007fd20d1dc94f in ___vsprintf_chk (s=0x561f0ef8e4d0 "", flags=1, slen=18446744073709551615, format=0x7fd20d8f7204 "%.*s", args=args at entry=0x561f0ef8e3a0) at vsprintf_chk.c:83
83        ret = _IO_vfprintf (&f._sbf._f, format, args);

(gdb) 
#2  0x00007fd20d1dc87a in ___sprintf_chk (s=s at entry=0x561f0ef8e4d0 "", flags=flags at entry=1, slen=slen at entry=18446744073709551615, format=format at entry=0x7fd20d8f7204 "%.*s") at sprintf_chk.c:31
31        done = __vsprintf_chk (s, flags, slen, format, arg);

(gdb) 
#3  0x00007fd20d8ec4a6 in sprintf (__fmt=0x7fd20d8f7204 "%.*s", __s=0x561f0ef8e4d0 "") at /usr/include/x86_64-linux-gnu/bits/stdio2.h:33
warning: Source file is more recent than executable.
33        return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
34                                        __bos (__s), __fmt, __va_arg_pack ());

(gdb) 
#4  _nc_read_entry2 (name=0x561f0efa9c80 "xterm-256color", filename=filename at entry=0x561f0ef8e4d0 "", tp=tp at entry=0x561f0f1c6e10) at ../../ncurses/tinfo/read_entry.c:843
843         _nc_SPRINTF(filename, _nc_SLIMIT(PATH_MAX)
844                     "%.*s", PATH_MAX - 1, name);



(gdb) list vfprintf.c:1241,1280
1241    /* The function itself.  */
1242    int
1243    vfprintf (FILE *s, const CHAR_T *format, va_list ap)
1244    {
1245      /* The character used as thousands separator.  */
1246      THOUSANDS_SEP_T thousands_sep = 0;
1247
1248      /* The string describing the size of groups of digits.  */
1249      const char *grouping;
1250
1251      /* Place to accumulate the result.  */
1252      int done;
1253
1254      /* Current character in format string.  */
1255      const UCHAR_T *f;
1256
1257      /* End of leading constant string.  */
1258      const UCHAR_T *lead_str_end;
1259
1260      /* Points to next format specifier.  */
1261      const UCHAR_T *end_of_spec;
1262
1263      /* Buffer intermediate results.  */
1264      CHAR_T work_buffer[WORK_BUFFER_SIZE];
1265      CHAR_T *workstart = NULL;
1266      CHAR_T *workend;
1267
1268      /* We have to save the original argument pointer.  */
1269      va_list ap_save;
1270
1271      /* Count number of specifiers we already processed.  */
1272      int nspecs_done;
1273
1274      /* For the %m format we may need the current `errno' value.  */
1275      int save_errno = errno;
1276
1277      /* 1 if format is in read-only memory, -1 if it is in writable memory,
1278         0 if unknown.  */
1279      int readonly_format = 0;
1280




(gdb) disassemble /m 0x00007fd20d124319,0x7fd20d124356+0x10
Dump of assembler code from 0x7fd20d124319 to 0x7fd20d124366:
1244    {
   0x00007fd20d124320 <_IO_vfprintf_internal+0>:        push   %rbp
   0x00007fd20d124321 <_IO_vfprintf_internal+1>:        mov    %rsp,%rbp
   0x00007fd20d124324 <_IO_vfprintf_internal+4>:        push   %r15
   0x00007fd20d124326 <_IO_vfprintf_internal+6>:        push   %r14
   0x00007fd20d124328 <_IO_vfprintf_internal+8>:        push   %r13
   0x00007fd20d12432a <_IO_vfprintf_internal+10>:       push   %r12
   0x00007fd20d12432c <_IO_vfprintf_internal+12>:       mov    %rdi,%r14
   0x00007fd20d12432f <_IO_vfprintf_internal+15>:       push   %rbx
   0x00007fd20d124330 <_IO_vfprintf_internal+16>:       mov    %rdx,%r12
   0x00007fd20d124333 <_IO_vfprintf_internal+19>:       mov    %rsi,%rbx
   0x00007fd20d124336 <_IO_vfprintf_internal+22>:       sub    $0x548,%rsp
   0x00007fd20d12433d <_IO_vfprintf_internal+29>:       mov    %fs:0x28,%rax
   0x00007fd20d124346 <_IO_vfprintf_internal+38>:       mov    %rax,-0x38(%rbp)
   0x00007fd20d12434a <_IO_vfprintf_internal+42>:       xor    %eax,%eax

1245      /* The character used as thousands separator.  */
1246      THOUSANDS_SEP_T thousands_sep = 0;
1247
1248      /* The string describing the size of groups of digits.  */
1249      const char *grouping;
1250
1251      /* Place to accumulate the result.  */
1252      int done;
1253
1254      /* Current character in format string.  */
1255      const UCHAR_T *f;
1256
1257      /* End of leading constant string.  */
1258      const UCHAR_T *lead_str_end;
1259
1260      /* Points to next format specifier.  */
1261      const UCHAR_T *end_of_spec;
1262
1263      /* Buffer intermediate results.  */
1264      CHAR_T work_buffer[WORK_BUFFER_SIZE];
1265      CHAR_T *workstart = NULL;
1266      CHAR_T *workend;
1267
1268      /* We have to save the original argument pointer.  */
1269      va_list ap_save;
1270
1271      /* Count number of specifiers we already processed.  */
1272      int nspecs_done;
1273
1274      /* For the %m format we may need the current `errno' value.  */
1275      int save_errno = errno;
   0x00007fd20d12434c <_IO_vfprintf_internal+44>:       mov    0x168b15(%rip),%rax        # 0x7fd20d28ce68
   0x00007fd20d124353 <_IO_vfprintf_internal+51>:       mov    %fs:(%rax),%eax
=> 0x00007fd20d124356 <_IO_vfprintf_internal+54>:       mov    %eax,-0x4c8(%rbp)

1276
1277      /* 1 if format is in read-only memory, -1 if it is in writable memory,
1278         0 if unknown.  */
1279      int readonly_format = 0;
1280
1281      /* Orient the stream.  */
1282    #ifdef ORIENT
1283      ORIENT;
   0x00007fd20d12435c <_IO_vfprintf_internal+60>:       mov    0xc0(%rdi),%eax
   0x00007fd20d124362 <_IO_vfprintf_internal+66>:       test   %eax,%eax
   0x00007fd20d124364 <_IO_vfprintf_internal+68>:       jne    0x7fd20d124548 <_IO_vfprintf_internal+552>
   0x00007fd20d12436a <_IO_vfprintf_internal+74>:       movl   $0xffffffff,0xc0(%rdi)

End of assembler dump.




(gdb) display/i $pc
1: x/i $pc
=> 0x7fd20d124356 <_IO_vfprintf_internal+54>:   mov    %eax,-0x4c8(%rbp)

(gdb) print/x 0x00007fd20d124353 + 0x168b15
$18 = 0x7fd20d28ce68

(gdb) print/x $rax
$12 = 0x5
(gdb) print/x $fs
$14 = 0x0

(gdb) print/x $eax
$5 = 0x5

(gdb) print/x $rbp
$21 = 0x561f0ef8e250
(gdb) print/x $rbp -0x4c8
$22 = 0x561f0ef8dd88
(gdb) x/1xw 0x561f0ef8dd88
0x561f0ef8dd88: Cannot access memory at address 0x561f0ef8dd88

(gdb) print errno
Cannot access memory at address 0x561f0ef8dc5f
(gdb) print &errno
$20 = (int *) 0x7fd20ce3b298





More information about the pkg-gnome-maintainers mailing list