Red Hat Bugzilla – Bug 1473747
Segmentation fault when running thin_repair or thin_ls on thin_dump metadata
Last modified: 2018-04-10 09:18:07 EDT
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" } ] } ] }
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)
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
Fixed in device-mapper-persistent-data-0.7.3-1.el7.
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