Skip to content

Instantly share code, notes, and snippets.

@kylemanna
Last active April 14, 2016 07:49
Show Gist options
  • Save kylemanna/fb7a054e6c3f77332b85 to your computer and use it in GitHub Desktop.
Save kylemanna/fb7a054e6c3f77332b85 to your computer and use it in GitHub Desktop.
lvchange segfault after cache policy mq->cleaner->mq
core:~/t/lvm2 git:master ❯❯❯ time sudo -E gdb ./zxcv/usr/bin/lvchange
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./zxcv/usr/bin/lvchange...done.
(gdb) r --cachepolicy mq vg0/home
Starting program: /home/nitro/tmp/lvm2/zxcv/usr/bin/lvchange --cachepolicy mq vg0/home
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff756c8ef in _clone_config_value (mem=0x5555559543a0, v=0x0) at libdm-config.c:1261
1261 new_cv->type = v->type;
(gdb) where
#0 0x00007ffff756c8ef in _clone_config_value (mem=0x5555559543a0, v=0x0) at libdm-config.c:1261
#1 0x00007ffff756cfde in _override_path (path=0x555555954330 "/policy_settings", node=0x555555983e18, baton=0x555555997420) at libdm-config.c:1343
#2 0x00007ffff756d1e3 in _enumerate (path=0x7ffff7580d2a "", cn=0x555555983e18, cb=0x7ffff756cf08 <_override_path>, baton=0x555555997420) at libdm-config.c:1360
#3 0x00007ffff756d36b in dm_config_flatten (cft=0x55555594ae60) at libdm-config.c:1382
#4 0x00005555555f5bfc in lv_cache_setpolicy (lv=0x5555559830b0, policy=0x55555597a6d0) at metadata/cache_manip.c:417
#5 0x000055555557bb62 in _lvchange_cachepolicy (cmd=0x555555900000, lv=0x5555559830b0) at lvchange.c:685
#6 0x000055555557d736 in _lvchange_single (cmd=0x555555900000, lv=0x5555559830b0, handle=0x555555940558) at lvchange.c:1102
#7 0x00005555555aa61f in process_each_lv_in_vg (cmd=0x555555900000, vg=0x555555982b80, arg_lvnames=0x7fffffffdbd0, tags_in=0x7fffffffdcc0, stop_on_error=0,
handle=0x555555940558, process_single_lv=0x55555557c836 <_lvchange_single>) at toollib.c:2072
#8 0x00005555555aaec0 in _process_lv_vgnameid_list (cmd=0x555555900000, flags=1048576, vgnameids_to_process=0x7fffffffdc80, arg_vgnames=0x7fffffffdcb0,
arg_lvnames=0x7fffffffdca0, arg_tags=0x7fffffffdcc0, handle=0x555555940558, process_single_lv=0x55555557c836 <_lvchange_single>) at toollib.c:2280
#9 0x00005555555ab27b in process_each_lv (cmd=0x555555900000, argc=1, argv=0x7fffffffdee0, flags=1048576, handle=0x555555940558,
process_single_lv=0x55555557c836 <_lvchange_single>) at toollib.c:2356
#10 0x000055555557e136 in lvchange (cmd=0x555555900000, argc=1, argv=0x7fffffffdee0) at lvchange.c:1260
#11 0x0000555555597bca in lvm_run_command (cmd=0x555555900000, argc=1, argv=0x7fffffffdee0) at lvmcmdline.c:1521
#12 0x000055555559921e in lvm2_main (argc=4, argv=0x7fffffffdec8) at lvmcmdline.c:1985
#13 0x00005555555b6cc0 in main (argc=4, argv=0x7fffffffdec8) at lvm.c:21
(gdb) frame 1
#1 0x00007ffff756cfde in _override_path (path=0x555555954330 "/policy_settings", node=0x555555983e18, baton=0x555555997420) at libdm-config.c:1343
1343 if (!(target->v = _clone_config_value(cft->mem, node->v)))
(gdb)
# Generated by LVM2 version 2.02.116(2) (2015-01-30): Sat May 2 16:58:24 2015
contents = "Text Format Volume Group"
version = 1
description = "Created *after* executing 'lvchange --cachepolicy cleaner vg0/home'"
creation_host = "core.hq" # Linux core.hq 4.0.1-1-ARCH #1 SMP PREEMPT Wed Apr 29 12:00:26 CEST 2015 x86_64
creation_time = 1430611104 # Sat May 2 16:58:24 2015
vg0 {
id = "9IhQDa-rGw2-kwQZ-z1iu-DekC-rHdA-aB5clm"
seqno = 85
format = "lvm2" # informational
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 65536 # 32 Megabytes
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "Iz9uln-DdxA-MbzE-HGS9-ffB9-mcWe-G6pk2c"
device = "/dev/sda1" # Hint only
status = ["ALLOCATABLE"]
flags = []
tags = ["spindle", "hdd"]
dev_size = 7773075456 # 3.61962 Terabytes
pe_start = 2048
pe_count = 118607 # 3.6196 Terabytes
}
pv1 {
id = "iOunVl-LmmO-GeSJ-6toZ-dWPe-8eGe-emaBAf"
device = "/dev/sdf3" # Hint only
status = ["ALLOCATABLE"]
flags = []
tags = ["ssd"]
dev_size = 195318270 # 93.135 Gigabytes
pe_start = 2048
pe_count = 2980 # 93.125 Gigabytes
}
}
logical_volumes {
home {
id = "iuqdZ3-AO3R-qCfl-Gh3U-nK9V-kiSK-QWgZk6"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
segment_count = 1
segment1 {
start_extent = 0
extent_count = 85568 # 2.61133 Terabytes
type = "cache"
cache_pool = "cache0"
origin = "home_corig"
}
}
swap {
id = "Mfbb0O-Olbx-Yfd2-yrKC-TPrI-D0nw-dSv6di"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_host = "core"
creation_time = 1398141985 # 2014-04-21 21:46:25 -0700
segment_count = 1
segment1 {
start_extent = 0
extent_count = 128 # 4 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 0
]
}
}
cache0 {
id = "2op44D-OhPr-4m29-9xZG-s4oM-Gwjx-VnDfki"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365638 # 2014-12-11 22:27:18 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 2848 # 89 Gigabytes
type = "cache-pool"
data = "cache0_cdata"
metadata = "cache0_cmeta"
chunk_size = 128
cache_mode = "writethrough"
policy = "cleaner"
policy_settings {
}
}
}
cache0_cmeta {
id = "IDic5B-wm1z-LH5s-7iwY-hyju-M9G0-MdjsZS"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365577 # 2014-12-11 22:26:17 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 4 # 128 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 128
]
}
}
cache0_cdata {
id = "zmCssw-QA9W-GrXg-0hl7-GtWG-3hxZ-IXZhzj"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365592 # 2014-12-11 22:26:32 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 2848 # 89 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 132
]
}
}
lvol0_pmspare {
id = "ExXcM9-EKJI-oZJk-AzAj-6SJn-2dhT-FE0KUK"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365638 # 2014-12-11 22:27:18 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 4 # 128 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 53568
]
}
}
home_corig {
id = "UVclcS-lN4A-yP00-CqkK-NPsN-kVNP-ymyFoB"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365729 # 2014-12-11 22:28:49 -0800
segment_count = 2
segment1 {
start_extent = 0
extent_count = 37568 # 1.14648 Terabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 16000
]
}
segment2 {
start_extent = 37568
extent_count = 48000 # 1.46484 Terabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 55488
]
}
}
}
}
# Generated by LVM2 version 2.02.116(2) (2015-01-30): Sat May 2 16:58:20 2015
contents = "Text Format Volume Group"
version = 1
description = "Created *before* executing 'lvchange --cachepolicy cleaner vg0/home'"
creation_host = "core.hq" # Linux core.hq 4.0.1-1-ARCH #1 SMP PREEMPT Wed Apr 29 12:00:26 CEST 2015 x86_64
creation_time = 1430611100 # Sat May 2 16:58:20 2015
vg0 {
id = "9IhQDa-rGw2-kwQZ-z1iu-DekC-rHdA-aB5clm"
seqno = 84
format = "lvm2" # informational
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 65536 # 32 Megabytes
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "Iz9uln-DdxA-MbzE-HGS9-ffB9-mcWe-G6pk2c"
device = "/dev/sda1" # Hint only
status = ["ALLOCATABLE"]
flags = []
tags = ["spindle", "hdd"]
dev_size = 7773075456 # 3.61962 Terabytes
pe_start = 2048
pe_count = 118607 # 3.6196 Terabytes
}
pv1 {
id = "iOunVl-LmmO-GeSJ-6toZ-dWPe-8eGe-emaBAf"
device = "/dev/sdf3" # Hint only
status = ["ALLOCATABLE"]
flags = []
tags = ["ssd"]
dev_size = 195318270 # 93.135 Gigabytes
pe_start = 2048
pe_count = 2980 # 93.125 Gigabytes
}
}
logical_volumes {
home {
id = "iuqdZ3-AO3R-qCfl-Gh3U-nK9V-kiSK-QWgZk6"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
segment_count = 1
segment1 {
start_extent = 0
extent_count = 85568 # 2.61133 Terabytes
type = "cache"
cache_pool = "cache0"
origin = "home_corig"
}
}
swap {
id = "Mfbb0O-Olbx-Yfd2-yrKC-TPrI-D0nw-dSv6di"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_host = "core"
creation_time = 1398141985 # 2014-04-21 21:46:25 -0700
segment_count = 1
segment1 {
start_extent = 0
extent_count = 128 # 4 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 0
]
}
}
cache0 {
id = "2op44D-OhPr-4m29-9xZG-s4oM-Gwjx-VnDfki"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365638 # 2014-12-11 22:27:18 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 2848 # 89 Gigabytes
type = "cache-pool"
data = "cache0_cdata"
metadata = "cache0_cmeta"
chunk_size = 128
cache_mode = "writethrough"
policy = "mq"
}
}
cache0_cmeta {
id = "IDic5B-wm1z-LH5s-7iwY-hyju-M9G0-MdjsZS"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365577 # 2014-12-11 22:26:17 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 4 # 128 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 128
]
}
}
cache0_cdata {
id = "zmCssw-QA9W-GrXg-0hl7-GtWG-3hxZ-IXZhzj"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365592 # 2014-12-11 22:26:32 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 2848 # 89 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 132
]
}
}
lvol0_pmspare {
id = "ExXcM9-EKJI-oZJk-AzAj-6SJn-2dhT-FE0KUK"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365638 # 2014-12-11 22:27:18 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 4 # 128 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 53568
]
}
}
home_corig {
id = "UVclcS-lN4A-yP00-CqkK-NPsN-kVNP-ymyFoB"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365729 # 2014-12-11 22:28:49 -0800
segment_count = 2
segment1 {
start_extent = 0
extent_count = 37568 # 1.14648 Terabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 16000
]
}
segment2 {
start_extent = 37568
extent_count = 48000 # 1.46484 Terabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 55488
]
}
}
}
}
# Generated by LVM2 version 2.02.116(2) (2015-01-30): Sat May 2 16:59:26 2015
contents = "Text Format Volume Group"
version = 1
description = "Created *before* executing 'lvchange --cachepolicy mq vg0/home'"
creation_host = "core.hq" # Linux core.hq 4.0.1-1-ARCH #1 SMP PREEMPT Wed Apr 29 12:00:26 CEST 2015 x86_64
creation_time = 1430611166 # Sat May 2 16:59:26 2015
vg0 {
id = "9IhQDa-rGw2-kwQZ-z1iu-DekC-rHdA-aB5clm"
seqno = 85
format = "lvm2" # informational
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 65536 # 32 Megabytes
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "Iz9uln-DdxA-MbzE-HGS9-ffB9-mcWe-G6pk2c"
device = "/dev/sda1" # Hint only
status = ["ALLOCATABLE"]
flags = []
tags = ["spindle", "hdd"]
dev_size = 7773075456 # 3.61962 Terabytes
pe_start = 2048
pe_count = 118607 # 3.6196 Terabytes
}
pv1 {
id = "iOunVl-LmmO-GeSJ-6toZ-dWPe-8eGe-emaBAf"
device = "/dev/sdf3" # Hint only
status = ["ALLOCATABLE"]
flags = []
tags = ["ssd"]
dev_size = 195318270 # 93.135 Gigabytes
pe_start = 2048
pe_count = 2980 # 93.125 Gigabytes
}
}
logical_volumes {
home {
id = "iuqdZ3-AO3R-qCfl-Gh3U-nK9V-kiSK-QWgZk6"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
segment_count = 1
segment1 {
start_extent = 0
extent_count = 85568 # 2.61133 Terabytes
type = "cache"
cache_pool = "cache0"
origin = "home_corig"
}
}
swap {
id = "Mfbb0O-Olbx-Yfd2-yrKC-TPrI-D0nw-dSv6di"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_host = "core"
creation_time = 1398141985 # 2014-04-21 21:46:25 -0700
segment_count = 1
segment1 {
start_extent = 0
extent_count = 128 # 4 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 0
]
}
}
cache0 {
id = "2op44D-OhPr-4m29-9xZG-s4oM-Gwjx-VnDfki"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365638 # 2014-12-11 22:27:18 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 2848 # 89 Gigabytes
type = "cache-pool"
data = "cache0_cdata"
metadata = "cache0_cmeta"
chunk_size = 128
cache_mode = "writethrough"
policy = "cleaner"
policy_settings {
}
}
}
cache0_cmeta {
id = "IDic5B-wm1z-LH5s-7iwY-hyju-M9G0-MdjsZS"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365577 # 2014-12-11 22:26:17 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 4 # 128 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 128
]
}
}
cache0_cdata {
id = "zmCssw-QA9W-GrXg-0hl7-GtWG-3hxZ-IXZhzj"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365592 # 2014-12-11 22:26:32 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 2848 # 89 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv1", 132
]
}
}
lvol0_pmspare {
id = "ExXcM9-EKJI-oZJk-AzAj-6SJn-2dhT-FE0KUK"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365638 # 2014-12-11 22:27:18 -0800
segment_count = 1
segment1 {
start_extent = 0
extent_count = 4 # 128 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 53568
]
}
}
home_corig {
id = "UVclcS-lN4A-yP00-CqkK-NPsN-kVNP-ymyFoB"
status = ["READ", "WRITE"]
flags = []
creation_host = "core.hq"
creation_time = 1418365729 # 2014-12-11 22:28:49 -0800
segment_count = 2
segment1 {
start_extent = 0
extent_count = 37568 # 1.14648 Terabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 16000
]
}
segment2 {
start_extent = 37568
extent_count = 48000 # 1.46484 Terabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 55488
]
}
}
}
}
@kylemanna
Copy link
Author

Last commit:

commit 75aa3e951f2e22a790fe2425f3b3ef71f292be2e (HEAD, origin/master, origin/HEAD, master)
Author: Zdenek Kabelac <zkabelac@redhat.com>
Date:   Sun May 3 01:06:20 2015 +0200

    tests: dd needs to fail in this case

Configure line:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin \
  --with-udev-prefix=/usr --with-systemdsystemunitdir=/usr/lib/systemd/system \
  --with-default-pid-dir=/run --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm \
  --enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \
  --enable-udev_sync --enable-udev_rules --with-default-locking-dir=/run/lock/lvm \
  --enable-lvmetad --with-thin=internal --with-cache=internal --enable-debug

@kylemanna
Copy link
Author

core:~ ❯❯❯ sudo lvs -o +cache_policy,cache_settings vg0/home
  LV   VG   Attr       LSize Pool     Origin       Data%  Meta%  Move Log Cpy%Sync Convert Cache Policy Cache Settings
  home vg0  Cwi-aoC--- 2.61t [cache0] [home_corig] 100.00 13.25           0.00             cleaner                    

@lnxbil
Copy link

lnxbil commented Apr 14, 2016

Hi,

just for future reference:
I just run into the same problem on Debian Jessie and could solve it by booting a recent version of arch linux (April 2016) and issuing the lvchange command there. Afterwards my system was able to boot.

Best,
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment