the function do_show_super_stats in EL's e4fsprogs and upstream's e2fsprogs does not check to see there is an open file system before referencing current_fs, causing a segfault. do_features seems to behave better. Attached is a patch to check for an open fs before referencing the structure. Tested on RHEL 5.3. ## for example ## # /sbin/debuge4fs debuge4fs 1.41.1 (01-Sep-2008) debuge4fs: stats Segmentation fault # gdb /sbin/debuge4fs (gdb) run ... debuge4fs: features features: Filesystem not open debuge4fs: stats /dev/sdb1 Program received signal SIGSEGV, Segmentation fault. do_show_super_stats (argc=2, argv=0x104943d0) at debugfs.c:294 294 gdt_csum = EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super, (gdb) ## patched ## ]# /sbin/debugfs debugfs 1.39 (29-May-2006) debugfs: stats stats: Filesystem not open debugfs:
Created attachment 330267 [details] check for open fs before referencing
I didn't check fedora's sources, I'd guess the issue is there too.
It appears that this is a regression: [root@mythbox ~]# debugfs debugfs 1.40.4 (31-Dec-2007) debugfs: stats stats: Filesystem not open debugfs: but: [root@mythbox2 ~]# debugfs sdebugfs 1.41.3 (12-Oct-2008) debugfs: stats Segmentation fault Thanks for the report Andrew! Patch seems about right, I think this change: commit 8fdf29117f922419bd5b3f741e5d554b1d5b8893 Author: Jose R. Santos <jrs.com> Date: Sun Oct 21 21:03:57 2007 -0500 Make debugfs uninit block group aware which added the: + gdt_csum = EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super, + EXT4_FEATURE_RO_COMPAT_GDT_CSUM); before the open fs check is what broke it. Needs upstream fixing too. -Eric
oh geez, I didn't even notice the check was later. ...lunch time patching. Thanks Eric.
I've sent a patch upstream & committed to rawhide so far. Thanks Andrew!
s/b fixed in e2fsprogs-1.41.4-2.el5
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1413.html