Bug 433784 - aliasing violation causes dumpe2fs segfaults in ia64.
aliasing violation causes dumpe2fs segfaults in ia64.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: e2fsprogs (Show other bugs)
4.6
All Linux
high Severity high
: rc
: ---
Assigned To: Eric Sandeen
:
: 455698 (view as bug list)
Depends On:
Blocks: 438356
  Show dependency treegraph
 
Reported: 2008-02-21 09:00 EST by Flavio Leitner
Modified: 2010-10-22 18:41 EDT (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2008-0732
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-24 15:58:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to workaround gcc inline bug (745 bytes, patch)
2008-02-21 09:00 EST, Flavio Leitner
no flags Details | Diff
backported upstream patch (1.71 KB, patch)
2008-02-21 13:37 EST, Flavio Leitner
no flags Details | Diff

  None (edit)
Description Flavio Leitner 2008-02-21 09:00:51 EST
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 09:00:52 EST
Created attachment 295505 [details]
patch to workaround gcc inline bug
Comment 3 RHEL Product and Program Management 2008-02-21 09:07:59 EST
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 13:15:49 EST
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 13:35:50 EST
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 13:37:04 EST
Created attachment 295548 [details]
backported upstream patch

Attached backported patch from upstream.
Flavio
Comment 8 Eric Sandeen 2008-02-21 13:42:09 EST
Flavio, thanks for all the legwork on this one.  :)

-Eric
Comment 9 Eric Sandeen 2008-02-21 17:41:24 EST
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 09:21:07 EST
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 10:54:39 EDT
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 07:11:35 EDT
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 13:15:31 EDT
*** Bug 455698 has been marked as a duplicate of this bug. ***
Comment 23 errata-xmlrpc 2008-07-24 15:58:32 EDT
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

Note You need to log in before you can comment on or make changes to this bug.