Bug 870534

Summary: LVM tool aborted while using --config to override existing use_lvmetad setting
Product: Red Hat Enterprise Linux 6 Reporter: Peter Rajnoha <prajnoha>
Component: lvm2Assignee: Petr Rockai <prockai>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: agk, cmarthal, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, zkabelac
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: lvm2-2.02.98-2.el6 Doc Type: Bug Fix
Doc Text:
Running an LVM command in a way to prevent it from using the lvmetad cache caused it to abort instead of proceeding with scanning-based metadata discovery. The problem was due to a bad initialisation sequence.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:14:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Peter Rajnoha 2012-10-26 18:36:33 UTC
Description of problem:
(applicable to all LVM commands, not just pvs)
# pvs --config "global{use_lvmetad=0}"
WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
PV         VG   Fmt  Attr PSize   PFree  
/dev/sda        lvm2 a--  128.00m 128.00m
*** Error in `pvs': corrupted double-linked list: 0x0000000001fae8f0 ***
======= Backtrace: =========
Aborted (core dumped)

The exact backtrace:
(gdb) bt
#0  0x0000003797236ca5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x0000003797238458 in __GI_abort () at abort.c:90
#2  0x000000379727872b in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x3797384360 "*** Error in `%s': %s: 0x%s ***\n") at	../sysdeps/unix/sysv/linux/libc_fatal.c:196
#3  0x000000379727f6bd in malloc_printerr (ptr=0x73f8f0, str=0x3797380ae8 "corrupted double-linked list", action=3) at malloc.c:4916
#4  malloc_consolidate (av=av@entry=0x37975be740 <main_arena>) at malloc.c:4093
#5  0x0000003797280992 in _int_malloc (av=av@entry=0x37975be740 <main_arena>, bytes=bytes@entry=1057) at malloc.c:3364
#6  0x000000379728241b in _int_realloc (av=av@entry=0x37975be740 <main_arena>, oldp=oldp@entry=0x852cb0, oldsize=oldsize@entry=48, nb=nb@entry=1072) at malloc.c:4211
#7  0x000000379728352d in __GI___libc_realloc (oldmem=0x852cc0,	bytes=1056) at malloc.c:2988
#8  0x00000000004cdef8 in buffer_realloc (buf=0x7fffffffde38, needed=1024) at config-util.c:284
#9  0x00000000004ceb8e in buffer_read (fd=5, buffer=0x7fffffffde38) at daemon-io.c:45
#10 0x00000000004ce5b4 in daemon_send (h=..., rq=...) at daemon-client.c:86
#11 0x00000000004ce73f in daemon_send_simple_v (h=..., id=0x4f86a2 "hello", ap=0x7fffffffdf48) at daemon-client.c:117
#12 0x00000000004ce834 in daemon_send_simple (h=..., id=0x4f86a2 "hello") at daemon-client.c:129
#13 0x00000000004ce22f in daemon_open (i=...) at daemon-client.c:44
#14 0x00000000004c2ba1 in lvmetad_open (socket=0x4e05ee "/run/lvm/lvmetad.socket") at ../include/lvmetad-client.h:73
#15 0x00000000004c2cad in lvmetad_init (cmd=0x733090) at cache/lvmetad.c:47
#16 0x000000000044dc3e in _process_config (cmd=0x733090) at commands/toolcontext.c:423
#17 0x00000000004512c2 in refresh_toolcontext (cmd=0x733090) at commands/toolcontext.c:1607
#18 0x00000000004282ad in lvm_run_command (cmd=0x733090, argc=0, argv=0x7fffffffe4e0) at lvmcmdline.c:1135
#19 0x00000000004295b1 in lvm2_main (argc=3, argv=0x7fffffffe4c8) at lvmcmdline.c:1556
#20 0x0000000000442f94 in main (argc=3, argv=0x7fffffffe4c8) at lvm.c:21

Version-Release number of selected component (if applicable):
lvm2-2.02.98-2.el6 (current upstream head as well:	bbff143d54b890f3b9c91b302f0322469ba56ef6) 

How reproducible:
Always while having use_lvmetad=1 in lvm.conf and using use_lvmetad=0 in --config and vice versa (so redefining it to an opposite value).

Comment 1 Petr Rockai 2012-10-30 21:42:55 UTC
Pushed a fix and a test upstream. 7c59199..09d77d0

Comment 2 Peter Rajnoha 2012-10-31 14:56:13 UTC
Just a note: lvmetad must be already running (service lvm2-lvmetad start) to trigger this error.

Comment 4 Corey Marthaler 2013-01-24 23:18:04 UTC
Fix verified in the latest rpms.

[root@qalvm-01 ~]# ps -ef | grep lvmetad
root      3771     1  0 17:09 ?        00:00:00 lvmetad
root      6491  1926  0 17:16 pts/0    00:00:00 grep lvmetad
[root@qalvm-01 ~]# pvs --config "global{use_lvmetad=0}"
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  PV         VG         Fmt  Attr PSize    PFree   
  /dev/sda2  vg_qalvm01 lvm2 a--    19.51g       0 
  /dev/vdc1  snapper    lvm1 a--  1024.00g 1023.70g
  /dev/vdg1  snapper    lvm1 a--  1024.00g 1024.00g

lvm2-2.02.98-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
lvm2-libs-2.02.98-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
lvm2-cluster-2.02.98-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
udev-147-2.43.el6    BUILT: Thu Oct 11 05:59:38 CDT 2012
device-mapper-1.02.77-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
device-mapper-libs-1.02.77-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
device-mapper-event-1.02.77-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
device-mapper-event-libs-1.02.77-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013
cmirror-2.02.98-9.el6    BUILT: Wed Jan 23 10:06:55 CST 2013

Comment 5 errata-xmlrpc 2013-02-21 08:14:46 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.