Bug 455698

Summary: /sbin/badblocks segfaults on RHEL4 x86_64
Product: Red Hat Enterprise Linux 4 Reporter: Morten Werner Forsbring <werner>
Component: e2fsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 4.6CC: sct
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-21 17:15:30 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:
Attachments:
Description Flags
mostly-static badblocks none

Description Morten Werner Forsbring 2008-07-17 08:30:06 UTC
Description of problem:

Running e.g. '/sbin/badblocks -b 512 /dev/sda 780132465' segfaults. with strace
it ends like this:

mprotect(0x33e862c000, 12288, PROT_READ) = 0
mprotect(0x33e8314000, 4096, PROT_READ) = 0
arch_prctl(ARCH_SET_FS, 0x2a95569320)   = 0
munmap(0x2a95557000, 66763)             = 0
brk(0)                                  = 0x505000
brk(0x526000)                           = 0x526000
open("/dev/sda", O_RDONLY)              = 3
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


Version-Release number of selected component (if applicable):

server# rpm -qf /sbin/badblocks 
e2fsprogs-1.35-12.11.el4_6.1
server#

How reproducible:

Every time. I've tested on two brand new Dell 2950's and one HP DL585 G5.

Steps to Reproduce:
1./sbin/badblocks -b 512 /dev/sda 780132465

Actual results:

server# /sbin/badblocks -b 512 /dev/sda 780132465
Segmentation fault
server#

Expected results:

Not segfaulting. :)

Additional info:

http://bugs.centos.org/view.php?id=2631

Works fine on a RHEL5 x86_64 installation.

Comment 1 Eric Sandeen 2008-07-17 14:39:52 UTC
This is probably a dup of:

* Thu Mar 20 2008 Eric Sandeen <esandeen> 1.35-12.15.EL4
- Fix aliasing violation causing dumpe2fs segfaults in ia64 (#433784)

see bug 433784 for more info; this should be part of the upcoming rhel4.7 update.

If you'd like, you can grab
http://people.redhat.com/esandeen/e2fsprogs-1.35-12.17.el4.src.rpm and rebuild
to verify that it's addressing your problem.

Thanks,
-Eric

Comment 2 Morten Werner Forsbring 2008-07-18 06:56:51 UTC
I'm not very familiar with building rpm-packages, but after running

rpmbuild --recompile e2fsprogs-1.35-12.17.el4.src.rpm

/var/tmp/e2fsprogs-root/sbin/badblocks -b 512 /dev/sda 780132465

still segfaults.

Comment 3 Eric Sandeen 2008-07-18 15:23:54 UTC
Created attachment 312149 [details]
mostly-static badblocks

that badblocks probably still links with the older problematic libraries.

Here's a badblocks from e2fsprogs-1.35-12.17.el4, statically linked with all
the e2fsprogs libraries.  Can you verify that it does not segfault?

Thanks,
-Eric

Comment 4 Morten Werner Forsbring 2008-07-21 07:07:21 UTC
The mostly-statically linked version does not segfault.

Comment 5 Eric Sandeen 2008-07-21 17:15:30 UTC
Thanks, I'll dup the bug, and the fix is in the update pipeline.

-Eric

*** This bug has been marked as a duplicate of 433784 ***