Bug 433784

Summary: aliasing violation causes dumpe2fs segfaults in ia64.
Product: Red Hat Enterprise Linux 4 Reporter: Flavio Leitner <fleitner>
Component: e2fsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.6CC: sct, tao, vgoyal, werner
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0732 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-24 19:58:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 438356    
Attachments:
Description Flags
patch to workaround gcc inline bug
none
backported upstream patch none

Description Flavio Leitner 2008-02-21 14:00:51 UTC
Description of problem:

# /sbin/dumpe2fs -f -h /dev/mapper/myvg-rootvol > /dev/null
dumpe2fs 1.35 (28-Feb-2004)
Segmentation fault

backtrace:
#0  ext2fs_u32_list_iterate_begin (bb=0x0, ret=0x60000fffffffb2f8) at
badblocks.c:242
242             EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);

(gdb) bt
#0  ext2fs_u32_list_iterate_begin (bb=0x0, ret=0x60000fffffffb2f8) at
badblocks.c:242
#1  0x20000000000556c0 in ext2fs_badblocks_list_iterate_begin (bb=0x0,
ret=0x60000fffffffb2f8) at badblocks.c:258

#2  0x4000000000001930 in list_bad_blocks (fs=0x6000000000009000, dump=0) at
dumpe2fs.c:195

#3  0x4000000000002240 in main (argc=4, argv=0x60000fffffffba18) at dumpe2fs.c:353

#4  0x20000000000fd430 in __libc_start_main () from /lib/tls/libc.so.6.1
#5  0x4000000000001440 in _start ()

The macro is expanded to:
#define EXT2_CHECK_MAGIC(struct, code) \
         if ((struct)->magic != (code)) return (code)

and the variable 'struct' in this case is a NULL pointer.

Compiling with:
# CFLAGS="-O2  -fno-inline" ./configure --enable-elf-shlibs --enable-nls

does not reproduce anymore:
[root@rx1620 e2fsprogs-1.35]# LD_PRELOAD=lib/libext2fs.so.2 misc/dumpe2fs -f -h
/dev/mapper/myvg-rootvol > /dev/null
dumpe2fs 1.35 (28-Feb-2004)
#

Version-Release number of selected component (if applicable):
e2fsprogs-1.35-12.11.el4_6.1

How reproducible:
Always

Additional info:
It's a known problem on ARM:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=397044

Although this is actually a gcc bug would be great if we workaround this
problem while gcc is not fixed.

Flavio

Comment 1 Flavio Leitner 2008-02-21 14:00:52 UTC
Created attachment 295505 [details]
patch to workaround gcc inline bug

Comment 3 RHEL Program Management 2008-02-21 14:07:59 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 Flavio Leitner 2008-02-21 18:15:49 UTC
Actually, it's a aliasing violation that causes dumpe2fs segfault and
building with CFLAGS="-O2 -fno-strict-aliasing" does indeed fix the problem.

Check the cloned bug that I've missed before at:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398316


Comment 6 Flavio Leitner 2008-02-21 18:35:50 UTC
Upstream patch fixing the issue:
http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=2694f31946f0c168cc8d098f3970f0ae08d94e7b


Comment 7 Flavio Leitner 2008-02-21 18:37:04 UTC
Created attachment 295548 [details]
backported upstream patch

Attached backported patch from upstream.
Flavio

Comment 8 Eric Sandeen 2008-02-21 18:42:09 UTC
Flavio, thanks for all the legwork on this one.  :)

-Eric

Comment 9 Eric Sandeen 2008-02-21 22:41:24 UTC
It looks like RHEL5 should have the same problem... can you confirm?

Or, I'll go looking for an ia64 somewhere... :)

Comment 10 Flavio Leitner 2008-02-22 14:21:07 UTC
I have not tested but yes, it looks like rhel-5 should have the same problem
and unfortunately, the test box is not mine so I can't respin with rhel5.

Flavio

Comment 13 Eric Sandeen 2008-03-20 14:54:39 UTC
I've built this into 2fsprogs-1.35-12.15.el4

Mind giving it a test for verification?

Thanks,
-Eric

Comment 18 Bryn M. Reeves 2008-05-02 11:11:35 UTC
Reproducible on x86_64 as well:

# uname -a
Linux timmy.example.com 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007
x86_64 x86_64 x86_64 GNU/Linux
# dumpe2fs -f -h /dev/mapper/VolGroup00-LogVol00 > /dev/null
dumpe2fs 1.35 (28-Feb-2004)
Segmentation fault


Comment 22 Eric Sandeen 2008-07-21 17:15:31 UTC
*** Bug 455698 has been marked as a duplicate of this bug. ***

Comment 23 errata-xmlrpc 2008-07-24 19:58:32 UTC
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-2008-0732.html