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 1473747 - Segmentation fault when running thin_repair or thin_ls on thin_dump metadata
Summary: Segmentation fault when running thin_repair or thin_ls on thin_dump metadata
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: device-mapper-persistent-data
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Joe Thornber
QA Contact: Jakub Krysl
URL:
Whiteboard:
Depends On:
Blocks: 1469559
TreeView+ depends on / blocked
 
Reported: 2017-07-21 14:30 UTC by Jakub Krysl
Modified: 2021-09-03 12:04 UTC (History)
7 users (show)

Fixed In Version: device-mapper-persistent-data-0.7.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 13:17:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0776 0 None None None 2018-04-10 13:18:06 UTC

Description Jakub Krysl 2017-07-21 14:30:40 UTC
Description of problem:
Running thin_repair from metadata obtained from thin_dump leads to segmentation fault. This happens on both file and device output.

Version-Release number of selected component (if applicable):
device-mapper-persistent-data-0.7.0-0.1.rc6.el7

How reproducible:
100%

Steps to Reproduce:
1. thin_dump $metadata_device >> $metadata_file
2. thin_repair -i $metadata_file -o $whatever

Actual results:
Segmentation fault (core dumped)

Expected results:
metadata repaired or warning (metadata check)

Additional info:

reason:
pdata_tools killed by SIGSEGV

core_backtrace:
{   "signal": 11
,   "executable": "/usr/sbin/pdata_tools"
,   "stacktrace":
      [ {   "crash_thread": true
        ,   "frames":
              [ {   "address": 4301400
                ,   "build_id": "f2c65c6ba05eda53b370e8f896fec88373fbc877"
                ,   "build_id_offset": 107096
                ,   "function_name": "persistent_data::core_map::inc(unsigned long)"
                ,   "file_name": "/usr/sbin/pdata_tools"
                }
              , {   "address": 4857464
                ,   "build_id": "f2c65c6ba05eda53b370e8f896fec88373fbc877"
                ,   "build_id_offset": 663160
                ,   "function_name": "(anonymous namespace)::open_tm(boost::shared_ptr<persistent_data::block_manager<4096u> >)"
                ,   "file_name": "/usr/sbin/pdata_tools"
                }
              , {   "address": 4861181
                ,   "build_id": "f2c65c6ba05eda53b370e8f896fec88373fbc877"
                ,   "build_id_offset": 666877
                ,   "function_name": "thin_provisioning::metadata::metadata(boost::shared_ptr<persistent_data::block_manager<4096u> >, bool)"
                ,   "file_name": "/usr/sbin/pdata_tools"
                }
              , {   "address": 5042759
                ,   "build_id": "f2c65c6ba05eda53b370e8f896fec88373fbc877"
                ,   "build_id_offset": 848455
                ,   "function_name": "thin_provisioning::thin_repair_cmd::run(int, char**)"
                ,   "file_name": "/usr/sbin/pdata_tools"
                }
              , {   "address": 4236175
                ,   "build_id": "f2c65c6ba05eda53b370e8f896fec88373fbc877"
                ,   "build_id_offset": 41871
                ,   "function_name": "base::application::run(int, char**)"
                ,   "file_name": "/usr/sbin/pdata_tools"
                }
              , {   "address": 4232798
                ,   "build_id": "f2c65c6ba05eda53b370e8f896fec88373fbc877"
                ,   "build_id_offset": 38494
                ,   "function_name": "main"
                ,   "file_name": "/usr/sbin/pdata_tools"
                } ]
        } ]
}

Comment 2 Jakub Krysl 2017-07-31 14:33:06 UTC
thin_ls does the same:

[root@storageqe-21 thin]# thin_check /dev/mapper/vgtest-swapvol 
examining superblock
examining devices tree
examining mapping tree
checking space map counts
[root@storageqe-21 thin]# thin_check /tmp/metadata
Couldn't stat path
[root@storageqe-21 thin]# thin_dump /dev/mapper/vgtest-swapvol >> /tmp/metadata
[root@storageqe-21 thin]# thin_check /tmp/metadata
examining superblock
  superblock is corrupt
    block out of bounds (0 >= 0)

[root@storageqe-21 thin]# thin_ls /tmp/metadata
Segmentation fault (core dumped)

Comment 3 Joe Thornber 2017-09-29 10:05:56 UTC
As mentioned in another bz, you are trying to run thin_check and thin_ls on the XML exported from thin_dump, rather on the binary metadata that the kernel uses.

The segmentation fault should not occur, and has been fixed recently.  I've added the following test to make sure:

https://github.com/jthornber/thin-provisioning-tools/commit/331303fe03d99002934ae575fa6026490078d2e6

Comment 5 Jakub Krysl 2017-10-09 08:57:57 UTC
Fixed in device-mapper-persistent-data-0.7.3-1.el7.

Comment 8 errata-xmlrpc 2018-04-10 13:17:29 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.

https://access.redhat.com/errata/RHEA-2018:0776


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