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 984754 - lvs -a -o +device segfaults
Summary: lvs -a -o +device segfaults
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-15 21:40 UTC by Corey Marthaler
Modified: 2021-09-08 20:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-16 09:14:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2013-07-15 21:40:38 UTC
Description of problem:
I accidentally forgot the "s" on the "devices" and found that it caused a segfault.

[root@qalvm-01 ~]# lvs -a -o +device
[...]
Segmentation fault (core dumped)

Jul 15 16:33:19 qalvm-01 kernel: [  158.890138] lvs[829]: segfault at 10 ip 00000036cb624667 sp 00007fff007426b0 error 4 in libdevmapper.so.1.02[36cb600000+45000]


(gdb) bt
#0  0x00000036cb624667 in _display_fields (rh=0x14962c0) at libdm-report.c:276
#1  0x00000036cb62532f in _parse_fields (rh=0x14962c0, format=0x14552e8 "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv,device", 
    report_type_only=1) at libdm-report.c:526
#2  0x00000036cb62585e in dm_report_init (report_types=0x7fff00742840, types=0x72b580 <_report_types>, fields=0x72b660 <_fields>, 
    output_fields=0x14552e8 "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv,device", output_separator=0x4f7c0b " ", output_flags=7, 
    sort_keys=0x4f7c35 "vg_name,lv_name", private_data=0x1400060) at libdm-report.c:626
#3  0x00000000004bd580 in report_init (cmd=0x1400060, format=0x14552e8 "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv,device", 
    keys=0x4f7c35 "vg_name,lv_name", report_type=0x7fff00742840, separator=0x4f7c0b " ", aligned=1, buffered=1, headings=1, field_prefixes=0, quoted=1, columns_as_rows=0) at report/report.c:1335
#4  0x00000000004373c5 in _report (cmd=0x1400060, argc=0, argv=0x7fff00742ab8, report_type=LVS) at reporter.c:320
#5  0x0000000000437779 in lvs (cmd=0x1400060, argc=0, argv=0x7fff00742ab8) at reporter.c:406
#6  0x000000000042ccd0 in lvm_run_command (cmd=0x1400060, argc=0, argv=0x7fff00742ab8) at lvmcmdline.c:1145
#7  0x000000000042e1f2 in lvm2_main (argc=4, argv=0x7fff00742a98) at lvmcmdline.c:1581
#8  0x00000000004462f0 in main (argc=4, argv=0x7fff00742a98) at lvm.c:21


Version-Release number of selected component (if applicable):
3.10.0-0.rc5.61.el7.x86_64

lvm2-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
lvm2-libs-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
lvm2-cluster-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-libs-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-event-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-event-libs-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
cmirror-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013


How reproducible:
Everytime

Comment 2 Peter Rajnoha 2013-07-16 09:14:45 UTC
This was caused by new report type LVCREATE_PARAMS introduced with https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=4d5de8322b3a6050def60542b167b46d97b2824d

However, this one has been reverted later on with https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=dd302daf646f680531bf76ab13a9dafd06f63220.


Tony, there was missing proper registration of the new report type here in this struct:

static const struct dm_report_object_type _report_types[] = {
        { VGS, "Volume Group", "vg_", _obj_get_vg },
        { LVS, "Logical Volume", "lv_", _obj_get_lv },
        { PVS, "Physical Volume", "pv_", _obj_get_pv },
        { LABEL, "Physical Volume Label", "pv_", _obj_get_pv },
        { SEGS, "Logical Volume Segment", "seg_", _obj_get_seg },
        { PVSEGS, "Physical Volume Segment", "pvseg_", _obj_get_pvseg },
        { 0, "", "", NULL },
};

There should have been a new line, e.g.:

        { LV_CREATE_PARAMS, "LV Creation Params", "lvcreate_params_", _obj_get_lvcreate_params },

Anyway, I'm closing this report now as the patch is not used with current upstream at the moment. But if you're going to resubmit the patch, this needs to be fixed then...


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