Summary: | vim segfaults for no reason | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alex <jnagyjr> |
Component: | Current packages | Assignee: | Vim Maintainers <vim> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | CC: | tseng |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Alex
2004-07-17 04:46:37 UTC
Finally, someone submits a bug report for this :) A few questions... What headers are you running? Can you rebuild without the -fomit-frame-pointer and with -g to get a better gdb stacktrace? * sys-kernel/linux-headers Latest version available: 2.4.22 Latest version installed: 2.4.22 Size of downloaded files: [no/bad digest] Homepage: http://www.kernel.org/ http://www.gentoo.org/ Description: Linux 2.4.22 headers from kernel.org I imagine I should update my linux headers (doing so now). updated traceback: GNU gdb 6.1.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /usr/bin/vim warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Program received signal SIGSEGV, Segmentation fault. gettail (fname=0x3 <Address 0x3 out of bounds>) at misc1.c:4027 4027 misc1.c: No such file or directory. in misc1. fixing headers now Rebooted into kernel 2.6.8-rc1 compiled with the 2.6.6 headers, vim still segfaults and returns the following gdb output: joseph-a-nagy-jr root # gdb vim GNU gdb 6.1.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /usr/bin/vim warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Program received signal SIGSEGV, Segmentation fault. gettail (fname=0x3 <Address 0x3 out of bounds>) at misc1.c:4027 4027 misc1.c: No such file or directory. in misc1.c FEATURES="nostrip noclean" CFLAGS="-g -O2 -march=pentium4" semerge vim (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /usr/bin/vim stack warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Program received signal SIGSEGV, Segmentation fault. gettail (fname=0x3 <Address 0x3 out of bounds>) at misc1.c:4027 4027 in misc1.c (gdb) backtrace #0 gettail (fname=0x3 <Address 0x3 out of bounds>) at misc1.c:4027 #1 0x080c1351 in main (argc=2, argv=0xbffff1c0) at main.c:484 Relevant bits from emerge info: Portage 2.0.51_pre13 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.4.20040619-r0, 2.6.8-rc1 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz) ================================================================= System uname: 2.6.8-rc1 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.5.1 ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" <snip> MAKEOPTS="-j2" <snip> USE="X alsa apm avi berkdb cdr cdrw crypt cups dvd encode flac foomaticdb gdbm gif gnome gpm gtk gtk2 imlib jpeg libg++ libwww mad mikmod motif mozilla mpeg ncurses oggvorbis opengl oss pam pdflib perl png python quicktime readline sdl slang spell ssl svga tcpd truetype x86 xine xml2 xv zlib" Other relevant bits: Less -march=pentium4, I get a working vim. Gvim with the full set of cflags works as expected. linux-headers are 2.6.5 So, we have gettail being called with a duff pointer. The caller is: initstr = gettail((char_u *)argv[0]); so argv[0] is broken? Surely not... Alex -- if you remove the -march from your CFLAGS, does it go away? Here's another gdb session Ciaran and I attempted. GNU gdb 6.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break main.c:407 Breakpoint 1 at 0x80c1224: file main.c, line 407. (gdb) run Starting program: /usr/bin/vim warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Breakpoint 1, main (argc=1, argv=0xbffff1bc) at main.c:408 (gdb) run Starting program: /usr/bin/vim warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Breakpoint 1, main (argc=1, argv=0xbffff1bc) at main.c:408 408 main.c: No such file or directory. in main.c (gdb) print argv[0] $1 = 0x8097e36 "\211]U\211WVS\203\034E|\035\bE\006" (gdb) (gdb) break main Breakpoint 1 at 0x80c10c8: file main.c, line 137. (gdb) run Starting program: /usr/bin/vim warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Breakpoint 1, main (argc=1, argv=0x40275088) at main.c:137 137 main.c: No such file or directory. in main.c (gdb) watch argv Watchpoint 2: argv (gdb) watch argv[0] Watchpoint 3: argv[0] (gdb) continue Continuing. Watchpoint 2: argv Old value = (char **) 0x40275088 New value = (char **) 0xbffff334 Watchpoint 3: argv[0] Old value = 0x108f3c <Address 0x108f3c out of bounds> New value = 0xbffff4d7 "/usr/bin/vim" main (argc=1, argv=0xbffff334) at main.c:95 95 in main.c Continuing for a bit more to try and hit the segfault: Old value = (char **) 0x401c9e05 New value = (char **) 0x40275088 0x401c9e0b in _IO_str_pbackfail () from /lib/libc.so.6 (gdb) continue Continuing. Error evaluating expression for watchpoint 2 Previous frame identical to this frame (corrupt stack?) Watchpoint 2 deleted. 0x402176dc in getpagesize () from /lib/libc.so.6 (gdb) continue Continuing. Program received signal SIGSEGV, Segmentation fault. gettail (fname=0x3 <Address 0x3 out of bounds>) at misc1.c:4027 4027 misc1.c: No such file or directory. in misc1.c (gdb) continue Continuing. Watchpoint 2: argv Old value = (char **) 0x401c9e05 New value = (char **) 0x40275088 0x401c9e0b in _IO_str_pbackfail () from /lib/libc.so.6 (gdb) backtrace #0 0x401c9e0b in _IO_str_pbackfail () from /lib/libc.so.6 #1 0x401ca260 in __libc_malloc_pthread_startup () from /lib/libc.so.6 #2 0x401ca8dc in __libc_malloc_pthread_startup () from /lib/libc.so.6 #3 0x401cbf43 in malloc () from /lib/libc.so.6 #4 0x081041b9 in mch_early_init () at os_unix.c:2629 #5 0x080c118e in main (argc=1, argv=0x40275088) at main.c:162 (gdb) continue Continuing. Error evaluating expression for watchpoint 2 Previous frame identical to this frame (corrupt stack?) Watchpoint 2 deleted. 0x402176dc in getpagesize () from /lib/libc.so.6 (gdb) backtrace #0 0x402176dc in getpagesize () from /lib/libc.so.6 #1 0xbffff150 in ?? () #2 0x401c9e38 in _IO_str_pbackfail () from /lib/libc.so.6 So, something outside of vim is overwriting *argv. Ouch. In reply to comment #6: Trying that now. In reply to comment #11: Ouch indeed. I have recompiled vim-core and vim and it still segfaults: (gdb) run Starting program: /usr/bin/vim warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Program received signal SIGSEGV, Segmentation fault. gettail (fname=0x3 <Address 0x3 out of bounds>) at misc1.c:4027 4027 misc1.c: No such file or directory. in misc1.c (gdb) continue Continuing. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. (gdb) backtrace No stack. Kids, dont try debugging when you are stripping away the debug symbols. It doesnt work. (Hint, build it like me). I've told it /not/ to strip the debug symbols, yet it does anyways. )': Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.4.20040619-r0, 2.6.8-rc1) ================================================================= System uname: 2.6.8-rc1 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.5.1 Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-Os -pipe -g" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-Os -pipe -g" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs buildpkg ccache digest nostrip sandbox userpriv usersandbox" GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://128.213.5.34/gentoo/ http://mirror.datapipe.net/gentoo ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X aalib acl acpi aim alsa apache2 apm arts audiofile avi berkdb bidi bonobo canna caps cdr cjk crypt cscope cups curl debug directfb divx4linux doc dvd encode esd evo f77 fbcon fftw flac flash foomaticdb freetds freewnn gb gcj gd gdbm gif gimp gimpprint gnome gpm gtk gtk2 gtkhtml icq imagemagick imap imlib innodb ipv6 jabber jack java joystick jpeg kde lcms ldap libg++ libwww mad maildir mailwrapper mbox mikmod mmx mng motif mozilla mpeg msn mysql nas ncurses nls objc odbc offensive oggvorbis opengl oscar oss pam pdflib perl pic png postgres python qt quickline quicktime readline realplayer samba sasl scanner sdl slang slp snmp spell sse ssl svg svga tcltk tcpd tetex theora tiff truetype unicode usb vhosts videos x86 xml xml2 xmms xv xvid yahoo zlib" debug is even in my use flags! notice the "nostrip" in my FEATURES as well. Hi. I have the same problem! But for me it was first not clear if it was the updated system or the kernel or a change I did at my useflags... BUT now I am quiet sure that it is the kernel, because: I updated and recompiled my complete system from scratch (emerge -e world). Everything (I used so far;-) works fine. gvim works. But vim gives a segmentation fault. I don't now much about debugging... I tried once a strace... ;-) I now tried gdb and it also says: SIGSEGV in gettail() for me. The problem occured after updating from: 2.6.5-rc3-mm4 to 2.6.7-mm1 and stayed with 2.6.7-mm4 and 2.6.7-mm6 until today... So if I reboot with the 2.6.5er Kernel it WORKS! But with the other kernels it doesn't. Maybe this helps... cause I begin to really miss my little neat VIM... ;-) Ah by the way: I only have installed "linux-headers" so nothing with "linux26-headers" (<<< do I need them?... I have them with my kernel-sources, or???) Greetings, tormen. _____ emerge info: Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-mm6) ================================================================= System uname: 2.6.7-mm6 i686 Intel(R) Pentium(R) 4 CPU 2.53GHz Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium4 -pipe -fomit-frame-pointer -O3" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/init.d /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -pipe -fomit-frame-pointer -O3" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS=" http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo http://212.219.247.11/sites/www.ibiblio.org/gentoo/ http://212.219.247.12/sites/www.ibiblio.org/gentoo/ " MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X aac aalib acl acpi acpi4linux aim alsa amd apache2 apm arts audiofile avi berkdb bonobo cdr crypt cups dga directfb divx4linux dv dvd dvdr emacs emacs-w3 encode esd ethereal faac faad fam fax fbcon ffmpeg firebird flac foomaticdb gb gdbm geoip ggi gif gimp gimpprint gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hbci icq imagemagick imap imlib ipv6 jabber jack java jce jikes jp2 jpeg kde kerberos ladcca lcms libcaca libg++ libsamplerate libwww lirc live mad maildir matroska matrox memlimit mikmod mldonkeypango mmx motif mozdomi mozilla mozxmlterm mpeg mpeg4 mplayer msn mysql nas ncurses nls ntlm odbc ofx oggvorbis opengl oscar oss pam pcap pcre pdflib perl php png posix postgres ppds pthreads python qt quicktime readline ruby samba scanner sdl silc slang speex spell spl sqlite sse ssl svga tcltk tcpd tetex theora tiff transcode truetype unicode usb v4l v4l2 videos wmf x86 xemacs xml xml2 xmms xosd xprint xv xvid yahoo yv12 zlib zvbi" Hm, have any of you tried 2.6.8rc2? Problem is gone on 2.6.8-rc2 and -march=pentium4 restored Ok, looks like this is a kernel bug (seems to be the same one giving people problems with Java), so closing this as CANTFIX. The workaround is to use <2.6.7 or >=2.6.8_rc2. |