Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 286352

Summary: app-editors/nvi-1.81.6-r2 fails on execution with "unexpected file type or format" for /var/tmp/vi.recover/vi.*
Product: Gentoo Linux Reporter: Max Kresch <mkresch>
Component: Current packagesAssignee: Harald van Dijk (RETIRED) <truedfx>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: output of "strace -f -o strace_nvi nvi"

Description Max Kresch 2009-09-25 02:57:28 UTC
A few days ago, after performing:

$ emerge -aDNu world
 ...
$ emerge --deep --depclean
 ...
$ revdep-rebuild
 ...
nvi stopped working.  When I try to run the program, instead of getting the text editor I know and love, I receive error messages about /var/tmp/vi.recover and /tmp/vi.*.

Reproducible: Always

Steps to Reproduce:
1.type "vi"
2.
3.

Actual Results:  
$ vi
fop_read_meta: /var/tmp/vi.recover/vi.BD76yy: unexpected file type or format
/var/tmp/vi.recover/vi.BD76yy: Invalid type 5 specified
fop_read_meta: /var/tmp/vi.recover/vi.JuVKFr: unexpected file type or format
/var/tmp/vi.recover/vi.JuVKFr: Invalid type 5 specified
ex/vi: Error: /tmp/vi.pg1gcg: Invalid argument
ex/vi: Error: /tmp/vi.Hd1Qi9: Invalid argument


Expected Results:  
nvi should be launched.  

Note:
$ which vi
/usr/bin/vi
$ ll /usr/bin/vi
lrwxrwxrwx 1 root root 13 Sep 23 21:44 /usr/bin/vi -> //usr/bin/nvi*


The output of "emerge --info nvi" is given at the bottom of this section.

I have the same problems on my x86 (32 bit) machine after a similar update; however, I've only performed the following on my 64 bit box:

1) I've tried downgrading to 1.81.6-r1 and 1.81.6 with no luck.
2) I've tried removing and/or emptying /var/tmp/vi.recover and also all vi.* files in /tmp -- no luck.  
3) The output of "strace -f -o strace_nvi nvi" is attached. This seems the most promising path forward, but I don't know enough to take it.
4) I tried to use gdb with no luck.  First, I re-emerged using:
 
$ FEATURES="nostrip" USE="debug" CFLAGS="-01 -pipe -ggdb" CXXFLAGS="-01 -pipe -ggdb" emerge nvi

and then I ran

$ gdb vi
GNU gdb 6.8
Copyright (C) 2008 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-pc-linux-gnu"...
(gdb) run
Starting program: /usr/bin/vi 
[Thread debugging using libthread_db enabled]
fop_read_meta: /var/tmp/vi.recover/vi.SGWeAC: unexpected file type or format
/var/tmp/vi.recover/vi.SGWeAC: Invalid type 5 specified
fop_read_meta: /var/tmp/vi.recover/vi.w1blpm: unexpected file type or format
/var/tmp/vi.recover/vi.w1blpm: Invalid type 5 specified
ex/vi: Error: /tmp/vi.surfjn: Invalid argument
ex/vi: Error: /tmp/vi.aJKh86: Invalid argument

Program exited with code 01.
(gdb) quit

$ emerge --info nvi
Portage 2.1.6.13 (default/linux/amd64/2008.0/desktop, gcc-4.4.1, glibc-2.10.1-r0, 2.6.31 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.31-x86_64-Intel-R-_Core-TM-2_CPU_T7600_@_2.33GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 25 Sep 2009 02:05:01 +0000
app-shells/bash:     4.0_p33
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r2, 3.1.1-r1
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/use/amd64-linux/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt cups dbus dri dts dvd dvdr eds emboss encode esd evo fam firefox flac fortran gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 isdnlog jpeg kde ldap libnotify mad mikmod mmx modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection sdl session spell spl sse sse2 ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb vorbis x264 xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-editors/nvi-1.81.6-r2 was built with the following:
USE="(multilib) perl unicode (-tcl)"
CFLAGS="-pipe -ggdb -D_PATH_MSGCAT="\"/usr/share/vi/catalog/\"""
CXXFLAGS="-pipe -ggdb -D_PATH_MSGCAT="\"/usr/share/vi/catalog/\"""
Comment 1 Max Kresch 2009-09-25 02:58:30 UTC
Created attachment 205180 [details]
output of "strace -f -o strace_nvi nvi"
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2009-09-25 05:20:09 UTC
Could you please check which version of db your nvi is using? `ldd /usr/bin/nvi` should be enough.
Comment 3 Max Kresch 2009-09-25 11:28:20 UTC
Sure thing...

$ ldd /usr/bin/nvi
	linux-vdso.so.1 =>  (0x00007fff395ff000)
	libvi.so.0 => /usr/lib/libvi.so.0 (0x00007fa7eeae3000)
	libperl.so.1 => /usr/lib/libperl.so.1 (0x00007fa7ee7bf000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa7ee5a3000)
	libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa7ee38b000)
	libdl.so.2 => /lib/libdl.so.2 (0x00007fa7ee187000)
	libm.so.6 => /lib/libm.so.6 (0x00007fa7edf04000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007fa7edccc000)
	libutil.so.1 => /lib/libutil.so.1 (0x00007fa7edac9000)
	libc.so.6 => /lib/libc.so.6 (0x00007fa7ed76e000)
	libncursesw.so.5 => /lib/libncursesw.so.5 (0x00007fa7ed511000)
	libdb-4.8.so => /usr/lib/libdb-4.8.so (0x00007fa7ed19d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa7eed8c000)
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2009-09-26 08:50:04 UTC
Thanks. I've added a nvi-1.81.6-r3 which makes sure it's linked to db 4.7 or older. I'll keep this bug open because it's not really fixed until nvi is modified to work with 4.8 as well.
Comment 5 Max Kresch 2009-09-26 11:30:08 UTC
1.81.6-r3 works. Thank you! :)
Comment 6 Harald van Dijk (RETIRED) gentoo-dev 2009-10-05 18:58:53 UTC
The short story is that DB 4.8 no longer allows DB_CREATE | DB_TRUNCATE to overwrite existing empty files, and I'm not sure if this is a bug or a feature. Such questions should go to Oracle's DB forum, but registration there requires business name and phone number, personal home address, and the likes. If anyone else wants to make sure DB 4.8 is supported, step right in, but I'm going to leave this forced at DB 4.7 or lower.
Comment 7 Harald van Dijk (RETIRED) gentoo-dev 2010-05-11 23:11:58 UTC
Re-opening to...
Comment 8 Harald van Dijk (RETIRED) gentoo-dev 2010-05-11 23:14:58 UTC
...close this properly, db 4.8.30 reverts to the older behaviour that nvi expects, and that version is now allowed in the nvi ebuild. Thanks to Debian's Sean Finney and Oracle's George Feinberg for seeing to it that this got fixed.