I have an external, USB 2.0 Maxtor hard drive. It works like a charm. I'm trying to fsck the filesystem on one of the partitions, but fsck segfaults. Reproducible: Always Steps to Reproduce: 1. # fsck.ext2 /dev/usb/maxtor5 Actual Results: It segfaulted and dumped core. Expected Results: It should have finished checking the file system. [12:12 root@howie portage]# emerge --info Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3, glibc-2.3.5-r0, 2.6.11.7 i686) ================================================================= System uname: 2.6.11.7 i686 Intel(R) Pentium(R) M processor 1200MHz Gentoo Base System version 1.6.11 Python: dev-lang/python-2.3.5 [2.3.5 (#1, May 1 2005, 15:56:48)] dev-lang/python: 2.3.5 sys-apps/sandbox: [Not Present] sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.9.5, 1.5, 1.8.5-r3, 1.7.9-r1, 1.6.3, 1.4_p6 sys-devel/binutils: 2.15.92.0.2-r7 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium-m -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium-m -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" LANG="en_US.UTF-8" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X a52 aac acpi aim alsa apm audiofile avi berkdb bitmap-fonts bonobo cdparanoia cdr crypt cups curl divx4linux dvd emboss encode fam ffmpeg flac foomaticdb fortran gdbm gif gpm gtk2 gtkhtml guile ieee1394 imagemagick imlib java javascript joystick jpeg libg++ libwww mad maildir mikmod mmx motif mp3 mpeg msn ncurses nls offensive ogg oggvorbis opengl oscar oss pam pcmcia pcre pdflib perl png pnp python qt quicktime readline sdl sndfile speex spell sse ssl svg svga sysfs sysvipc tcpd tiff truetype truetype-fonts trusted type1-fonts usb vcd vorbis wifi win32codecs xml xml2 xmms xv xvid yahoo zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CBUILD, CTARGET, LC_ALL, LDFLAGS, LINGUAS
Created attachment 58229 [details] gdb backtrace You'll notice I was running fsck on a mounted file system. It was, however, mounted read-only. I don't think that has anything to do with it as it also crashed when not mounted at all. I remerged e2fsprogs with USE="debug" before generating this backtrace.
One more thing: I'm using the masked version, e2fsprogs-1.36. [17:41 root@howie ~]# equery list e2fsprogs [ Searching for package 'e2fsprogs' in all categories among: ] * installed packages [I--] [ ] sys-fs/e2fsprogs-1.36 (0)
Created attachment 58234 [details] A backtrace from 1.37-r1 I tried upgrading to e2fsprogs-1.37-r1. It still segfaults in the same place... this backtrace also has a lot of ?? for symbols. I don't know how useful it will be...
you'll have to emerge e2fsprogs like this to get anything useful: FEATURES=nostrip CFLAGS="-g -pipe" emerge e2fsprogs
Good backtrace: [22:29 root@howie ~]# gdb fsck.ext2 core GNU gdb 6.3 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". Core was generated by `fsck.ext2 -y /dev/usb/maxtor5'. Program terminated with signal 11, Segmentation fault. warning: current_sos: Can't read pathname for load map: Input/output error Reading symbols from /lib/libext2fs.so.2...done. Loaded symbols for /lib/libext2fs.so.2 Reading symbols from /lib/libcom_err.so.2...done. Loaded symbols for /lib/libcom_err.so.2 Reading symbols from /lib/libblkid.so.1...done. Loaded symbols for /lib/libblkid.so.1 Reading symbols from /lib/libuuid.so.1...done. Loaded symbols for /lib/libuuid.so.1 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0xb7fc536b in ext2fs_unmark_generic_bitmap (bitmap=0x0, bitno=917517) at gen_bitmap.c:43 43 gen_bitmap.c: No such file or directory. in gen_bitmap.c (gdb) bt #0 0xb7fc536b in ext2fs_unmark_generic_bitmap (bitmap=0x0, bitno=917517) at gen_bitmap.c:43 #1 0xb7fc7dbf in ext2fs_unmark_inode_bitmap (bitmap=0x0, inode=917517) at bitops.h:411 #2 0x08059432 in e2fsck_process_bad_inode (ctx=0x806e468, dir=0, ino=917517, buf=0x80905b8 "") at pass2.c:1306 #3 0x0805b540 in e2fsck_pass4 (ctx=0x806e468) at pass4.c:138 #4 0x0804f1a1 in e2fsck_run (ctx=0x806e468) at e2fsck.c:193 #5 0x0804e973 in main (argc=3, argv=0xbffff694) at unix.c:1105 (gdb)
I also had an strace attached when it crashed. These were the last few actions: write(1, "i_faddr ", 8) = 8 write(1, "for ", 4) = 4 write(1, "inode", 5) = 5 write(1, " ", 1) = 1 write(1, "917517", 6) = 6 write(1, " (", 2) = 2 write(1, ".", 1) = 1 write(1, ".", 1) = 1 write(1, ".", 1) = 1 write(1, ") is", 4) = 4 write(1, " ", 1) = 1 write(1, "3893592363", 10) = 10 write(1, ", ", 2) = 2 write(1, "should be", 9) = 9 write(1, " zero.\n", 7) = 7 write(1, "Clear? yes\n\n", 12) = 12 write(1, "i_frag ", 7) = 7 write(1, "for ", 4) = 4 write(1, "inode", 5) = 5 write(1, " ", 1) = 1 write(1, "917517", 6) = 6 write(1, " (", 2) = 2 write(1, ".", 1) = 1 write(1, ".", 1) = 1 write(1, ".", 1) = 1 write(1, ") is", 4) = 4 write(1, " ", 1) = 1 write(1, "154", 3) = 3 write(1, ", ", 2) = 2 write(1, "should be", 9) = 9 write(1, " zero.\n", 7) = 7 write(1, "Clear? yes\n\n", 12) = 12 write(1, "i_fsize ", 8) = 8 write(1, "for ", 4) = 4 write(1, "inode", 5) = 5 write(1, " ", 1) = 1 write(1, "917517", 6) = 6 write(1, " (", 2) = 2 write(1, ".", 1) = 1 write(1, ".", 1) = 1 write(1, ".", 1) = 1 write(1, ") is", 4) = 4 write(1, " ", 1) = 1 write(1, "9", 1) = 1 write(1, ", ", 2) = 2 write(1, "should be", 9) = 9 write(1, " zero.\n", 7) = 7 write(1, "Clear? yes\n\n", 12) = 12 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 11677 detached
Created attachment 63741 [details] my `emerge info' I experience the exact same problem under the exact same circumstances. I am using the stable e2fsprogs, 1.37-r1. I recompiled e2fsprogs "-O1 -pipe" for stability after it started happening, with no effect. Also, see https://www.redhat.com/archives/fedora-list/2005-May/msg01816.html for what appears to be the same problem. That post has no replies.
This bug appears to have been fixed upstream in CVS. See http://sourceforge.net/tracker/?group_id=2406&atid=102406&func=detail&aid=1235930 and http://thunk.org/hg/e2fsprogs/?cmd=changeset;node=0502b63a5be9cb490c0c9086fa05edc1b1712a78 Additionally, it appears that the flaw was introduced in 1.36, so downgrading below 1.36 should be a temporary solution if you don't want to apply the patch.
did you test the patch and see if it fixed your prob ? if so, i'll add it to 1.38 ...
The patch fixes the problem. Awesome. I'm attaching the ebuild I used. I also put the patch in files/e2fsprogs-1.38-inode.patch.
Created attachment 65287 [details, diff] The patch I applied I cut out all the extra stuff and fixed the directory names (took off the a and b leading directories). This works.
No real nead to attach the ebuild. I just added an epatch line pointing to the patch. Thanks.
thanks guys, added patch to 1.38