Bug 433787 - gcc inline bug causes dumpe2fs segfault in ia64
gcc inline bug causes dumpe2fs segfault in ia64
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
ia64 Linux
high Severity high
: rc
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2008-02-21 09:13 EST by Flavio Leitner
Modified: 2008-02-21 13:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-02-21 13:11:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Flavio Leitner 2008-02-21 09:13:06 EST
Description of problem:
# /sbin/dumpe2fs -f -h /dev/mapper/myvg-rootvol > /dev/null
dumpe2fs 1.35 (28-Feb-2004)
Segmentation fault

#0  ext2fs_u32_list_iterate_begin (bb=0x0, ret=0x60000fffffffb2f8) at

(gdb) bt
#0  ext2fs_u32_list_iterate_begin (bb=0x0, ret=0x60000fffffffb2f8) at
#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

#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):

How reproducible:

Steps to Reproduce:
1. Compile using CFLAGS="-O2" 
2. Run dumpe2fs command as described above
3. segfault

Additional info:
It's a known problem on ARM too, check the report below:

Comment 1 Jakub Jelinek 2008-02-21 09:27:29 EST
If you read the debian bug carefully, you'll find it wasn't a gcc bug, but
e2fsprogs aliasing violation.
Try to build with CFLAGS="-O2 -fno-strict-aliasing", if that helps, find out
which exact function is miscompiled with -O2 (with default -fstrict-aliasing)
and post here preprocessed source of the CU containing that function, I guess I
can then show you the aliasing violation (if there is any).
Comment 2 RHEL Product and Program Management 2008-02-21 09:27:51 EST
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 3 RHEL Product and Program Management 2008-02-21 09:48:06 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
Comment 4 Flavio Leitner 2008-02-21 13:11:25 EST
Yes, building with CFLAGS="-O2 -fno-strict-aliasing" does indeed fix the problem.
I've missed the cloned ticket at

e2fsprogs ticket is bz#433784 then I'm closing this one.
thanks much!

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