Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 91751 - fsck.ext2 segfaults while checking a partition on a USB drive
Summary: fsck.ext2 segfaults while checking a partition on a USB drive
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-06 17:32 UTC by Christopher Cowart
Modified: 2005-08-06 23:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gdb backtrace (backtrace,8.15 KB, text/plain)
2005-05-06 17:36 UTC, Christopher Cowart
Details
A backtrace from 1.37-r1 (backtrace-e2fsprogs-1.37-r1,8.01 KB, text/plain)
2005-05-06 18:57 UTC, Christopher Cowart
Details
my `emerge info' (eminfo.txt,2.80 KB, text/plain)
2005-07-18 15:58 UTC, Ben Schwartz
Details
The patch I applied (e2fsprogs-1.38-inode.patch,2.08 KB, patch)
2005-08-06 22:38 UTC, Christopher Cowart
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Cowart 2005-05-06 17:32:40 UTC
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
Comment 1 Christopher Cowart 2005-05-06 17:36:05 UTC
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.
Comment 2 Christopher Cowart 2005-05-06 17:42:05 UTC
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)
Comment 3 Christopher Cowart 2005-05-06 18:57:12 UTC
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...
Comment 4 SpanKY gentoo-dev 2005-05-21 19:49:50 UTC
you'll have to emerge e2fsprogs like this to get anything useful:
FEATURES=nostrip CFLAGS="-g -pipe" emerge e2fsprogs
Comment 5 Christopher Cowart 2005-05-22 22:31:36 UTC
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) 
Comment 6 Christopher Cowart 2005-05-22 22:34:12 UTC
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
Comment 7 Ben Schwartz 2005-07-18 15:58:08 UTC
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.
Comment 8 Ben Schwartz 2005-08-06 19:05:16 UTC
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.
Comment 9 SpanKY gentoo-dev 2005-08-06 20:54:34 UTC
did you test the patch and see if it fixed your prob ?  if so, i'll add it to
1.38 ...
Comment 10 Christopher Cowart 2005-08-06 22:36:57 UTC
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.
Comment 11 Christopher Cowart 2005-08-06 22:38:15 UTC
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.
Comment 12 Christopher Cowart 2005-08-06 22:39:25 UTC
No real nead to attach the ebuild. I just added an epatch line pointing to the
patch. Thanks.
Comment 13 SpanKY gentoo-dev 2005-08-06 23:36:46 UTC
thanks guys, added patch to 1.38