RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1020438 - xfs_repair segfaults in VM for 60T device when using ag_stride option.
Summary: xfs_repair segfaults in VM for 60T device when using ag_stride option.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: xfsprogs
Version: 6.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Eric Sandeen
QA Contact: Eryu Guan
URL:
Whiteboard:
Depends On: 893904
Blocks: 1023566
TreeView+ depends on / blocked
 
Reported: 2013-10-17 16:24 UTC by Boris Ranto
Modified: 2014-10-14 07:49 UTC (History)
7 users (show)

Fixed In Version: xfsprogs-3.1.1-15.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 893904
Environment:
Last Closed: 2014-10-14 07:49:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1564 0 normal SHIPPED_LIVE xfsprogs bug update 2014-10-14 01:27:44 UTC

Comment 1 Boris Ranto 2013-10-17 16:25:57 UTC
This one is for the segfault xfs_repair in the VM.

Reproduction steps:
# truncate -s 60T xfs.img
# losetup /dev/loop0 xfs.img
# mkfs.xfs /dev/loop0
# xfs_repair -m 9000 -o ag_stride=32 -t 60 /dev/loop0
...
Segfault here

Comment 2 Eric Sandeen 2013-10-17 16:55:13 UTC
The core file is attached to the cloned bug, correct?

Why -m 9000?

Thanks,
-Eric

Comment 3 Eric Sandeen 2013-10-17 17:23:19 UTC
(gdb) bt
#0  0x0000000000426962 in progress_rpt_thread (p=0x67ad20) at progress.c:234
#1  0x0000003b98a07851 in start_thread (arg=0x7f19d8e47700) at pthread_create.c:301
#2  0x0000003b982e767d in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) p msgp
$1 = (msg_block_t *) 0x67ad20
(gdb) p msgp->format
$2 = (progress_rpt_t *) 0x0
(gdb)

Comment 4 Eric Sandeen 2013-10-17 17:30:23 UTC
Ok, easy enough to repro locally w/ a faster reporting interval:

# mkfs.xfs -d size=60t,file,name=fsfile
# xfs_repair -m 9000 -o ag_stride=32 -t 10 fsfile 
Phase 1 - find and verify superblock...
        - reporting progress in intervals of 10 seconds
Phase 2 - using internal log
        - zero log...
Segmentation fault

Comment 5 Eric Sandeen 2013-10-17 17:31:21 UTC
Bug persists upstream.

Comment 6 Eric Sandeen 2013-10-17 17:56:31 UTC
Ok, patch sent upstream.  Probably needs a RHEL7 bug too...

Comment 7 Eric Sandeen 2014-05-05 17:21:32 UTC
commit 7f2d6b811755b6b91f18aa5bd9d5980848a81267
Author: Eric Sandeen <sandeen>
Date:   Thu Oct 17 17:50:16 2013 +0000

    xfs_repair: avoid segfault if reporting progress early in repair
    
    For a very large filesystem, zeroing the log may take some time.
    
    If we ask for progress reports frequently enough that one fires
    before we finish with log zeroing, we try to use a progress format
    which has not yet been set up, and segfault:
    
    # mkfs.xfs -d size=60t,file,name=fsfile
    # xfs_repair -m 9000 -o ag_stride=32 -t 1 fsfile
    Phase 1 - find and verify superblock...
            - reporting progress in intervals of 1 seconds
    Phase 2 - using internal log
            - zero log...
    Segmentation fault
    
    (gdb) bt
    #0  0x0000000000426962 in progress_rpt_thread (p=0x67ad20) at progress.c:234
    #1  0x0000003b98a07851 in start_thread (arg=0x7f19d8e47700) at pthread_create.c:301
    #2  0x0000003b982e767d in ?? ()
    #3  0x0000000000000000 in ?? ()
    (gdb) p msgp
    $1 = (msg_block_t *) 0x67ad20
    (gdb) p msgp->format
    $2 = (progress_rpt_t *) 0x0
    (gdb)
    
    I suppose we could rig up progress reports for log zeroing, but
    that won't usually take terribly long; for now, be defensive
    and init the message->format to NULL, and just return early
    from the progress thread if we've not yet set up any message.
    
    (Sure, global_msgs is global, and ->format is already NULL,
    but to me it's worth being explicit since we will test it).
    
    Signed-off-by: Eric Sandeen <sandeen>
    Reviewed-by: Christoph Hellwig <hch>
    Signed-off-by: Rich Johnston <rjohnston>

Comment 9 Eryu Guan 2014-07-21 03:20:02 UTC
Reproduced with xfsprogs-3.1.1-14.el6

[root@hp-dl388g8-03 tmp]# mkfs.xfs -d size=60t,file,name=/mnt/xfs/fsfile
meta-data=/mnt/xfs/fsfile        isize=256    agcount=60, agsize=268435455 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=16106127300, imaxpct=1
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@hp-dl388g8-03 tmp]# xfs_repair -m 9000 -o ag_stride=32 -t 1 /mnt/xfs/fsfile
Phase 1 - find and verify superblock...
        - reporting progress in intervals of 1 second
Phase 2 - using internal log
        - zero log...
Segmentation fault (core dumped)
[root@hp-dl388g8-03 tmp]# rpm -q xfsprogs
xfsprogs-3.1.1-14.el6.x86_64

Verified with xfsprogs-3.1.1-16.el6, xfs_repair could repair the image with no segfault.

Set to VERIFIED.

Comment 10 errata-xmlrpc 2014-10-14 07:49:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1564.html


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