Bug 503485 - gfs2_edit segfault
Summary: gfs2_edit segfault
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils
Version: 5.4
Hardware: ia64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Robert Peterson
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-01 10:23 UTC by Jaroslav Kortus
Modified: 2010-03-30 08:53 UTC (History)
2 users (show)

Fixed In Version: gfs2-utils-0.1.62-2.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:53:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix the problem (2.69 KB, patch)
2009-06-01 19:09 UTC, Robert Peterson
no flags Details | Diff
Patch to fix the problem (revised) (4.14 KB, patch)
2009-06-01 21:10 UTC, Robert Peterson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0287 0 normal SHIPPED_LIVE gfs2-utils bug fix update 2010-03-29 14:05:15 UTC

Description Jaroslav Kortus 2009-06-01 10:23:09 UTC
Description of problem:
When browsing list of indirect links for 200M+ file the gfs2_edit tool exits with segfault.

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


How reproducible:
Create file with enough indirect links in it (enough > screen height). When browsing using pg-up and pg-down everything works as expected. But if you browse to the bottom using arrow keys and then go back by pg-up, on the last page the segfault occurs.

Steps to Reproduce:
1. Create file with so many indirect links that it fills up your screen in gfs2_edit
2. browse to the list (switch mode until you see directories/files) and jump to the file with enough links
3. go to the bottom using down key, go at the beginning using pg-up
  
Actual results:
segfault on last page

Expected results:
no segfault

Additional info:
Core was generated by `gfs2_edit /dev/sdc1'.
Program terminated with signal 11, Segmentation fault.
[New process 18903]
#0  0x400000000001b4b0 in display_indirect (ind=0x20000000003b4010, indblocks=120, level=0, startoff=0) at hexedit.c:1447
1447                    print_gfs2("0x%llx / %lld", ind->ii[pndx].block,
(gdb) bt full
#0  0x400000000001b4b0 in display_indirect (ind=0x20000000003b4010, indblocks=120, level=0, startoff=0) at hexedit.c:1447
        file_offset = 18446744073692807168
        start_line = 7
        total_dirents = 0
        i = 2
        cur_height = 0
        pndx = -7
        factor = {1, 511, 261121, 0, 0}
        offsets = {-8, 0, 0, 0, 0}
        __FUNCTION__ = "display_indirect"
#1  0x400000000001d990 in display_extended () at hexedit.c:1674
        tmp_inode = (struct gfs2_inode *) 0x6000000000004f88
        tmp_bh = (struct gfs2_buffer_head *) 0x60000fffffe1b6c0
#2  0x400000000001fce0 in display (identify_only=0) at hexedit.c:1897
        blk = 66222
        __FUNCTION__ = "display"
#3  0x4000000000026790 in interactive_mode () at hexedit.c:2636
        ch = 339
        Quit = 0
#4  0x400000000002f990 in main (argc=2, argv=0x60000fffffe1ba08) at hexedit.c:3507
        i = 256
        j = 3
        fd = 3
(gdb)
# rpm -q gfs2-utils
gfs2-utils-0.1.57-1.el5

Comment 1 Robert Peterson 2009-06-01 19:08:13 UTC
Recreated; Requesting ack flags to get this fixed.

Comment 2 Robert Peterson 2009-06-01 19:09:59 UTC
Created attachment 346125 [details]
Patch to fix the problem

This patch fixes the scrolling problem.

Comment 3 Robert Peterson 2009-06-01 21:10:10 UTC
Created attachment 346142 [details]
Patch to fix the problem (revised)

I found additional scrolling problems during testing.  For example,
if you have an indirect block list or a directory list of 50 items,
if you arrow down past item 25 (more than half-way) and hit page
down, it displays the wrong list and your highlighted entry disappears.
This is a revised patch that covers those corner cases.

Comment 4 Robert Peterson 2009-06-01 22:14:33 UTC
I pushed the patch to the master branch of the gfs2-utils git tree
and the STABLE2 and STABLE3 branches of the cluster.git tree.
I haven't pushed to the RHEL5 yet because I'm waiting for ack flags.

Comment 5 Robert Peterson 2009-06-02 19:17:09 UTC
The patch has now been pushed to the RHEL5 branch of the cluster
git tree for inclusion into 5.5.  It was tested on system roth-01.
Changing status to Modified.

Comment 6 Robert Peterson 2009-08-17 16:24:01 UTC
Pushed to the RHEL55 branch of cluster.git.  Changing status to POST.

Comment 7 Robert Peterson 2009-08-19 14:06:40 UTC
Built according to the new procedure.  Changing to Modified.

Comment 12 errata-xmlrpc 2010-03-30 08:53:55 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-2010-0287.html


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