Bug 523123 - pvcreate does not work with --config 'log{command_names=0}'
pvcreate does not work with --config 'log{command_names=0}'
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Fedora Extras Quality Assurance
Depends On: 522315
  Show dependency treegraph
Reported: 2009-09-14 04:19 EDT by Marek Grac
Modified: 2010-04-28 21:36 EDT (History)
15 users (show)

See Also:
Fixed In Version: 2.02.64
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 522315
Last Closed: 2010-04-28 21:36:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marek Grac 2009-09-14 04:19:22 EDT
+++ This bug was initially created as a clone of Bug #522315 +++

Description of problem:

system-config-lvm fails when using pvcreate - initialize partition to use lvm

seems like the --config option is not working...

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1.start system-config-lvm in a gnome-terminal
2.Try to initialize a partition for LVM use.
Actual results:

This fails:

/sbin/pvcreate --config 'log{command_names=0}' -M 2 /dev/sdb1

Expected results:

This works:

/sbin/pvcreate -M 2 /dev/sdb1

Additional info:

python script to fix:

--- Additional comment from jvillain@shaw.ca on 2009-09-10 22:13:16 EDT ---

vgcreate has the same problem. I started creating my vg in system-config-lvs and failed which led me to this bug report. Thanks for pointing out the issue rwhalb.

This fails:
/sbin/vgcreate --config 'log{command_names=0}' -M2 -l 256 -p 256 -s 8m -c n vg_data /dev/md0

This works:
/sbin/vgcreate  -M2 -l 256 -p 256 -s 8m -c n vg_data /dev/md0


--- Additional comment from mgrac@redhat.com on 2009-09-14 04:15:55 EDT ---

It looks like this problem is in lvm2, but we don't need this arg in *create so I'm removing it. 

Comment 1 Alasdair Kergon 2009-09-14 07:31:49 EDT
Please be more specific!  What do you mean by 'This fails'?
Comment 2 Milan Broz 2009-09-14 07:51:42 EDT
Hehe. That was my request to have a bug for this. Anyway, I have reproducer, simply this segfaults for example segfaults

vgcreate --config 'log{command_names=0}' -M2 vg_test /dev/sdb
Comment 3 Bug Zapper 2010-04-28 06:20:59 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 4 Milan Broz 2010-04-28 07:33:48 EDT
backtrace from comment #2:

Starting program: vgcreate --config log\{command_names=0\} -M2 vg_test /dev/sdb

Program received signal SIGSEGV, Segmentation fault.
0x080aa2b3 in vg_create (cmd=0x81ad6a8, vg_name=0xbffff736 "vg_test") at metadata/metadata.c:924
924             if (!(vg->fid = cmd->fmt->ops->create_instance(cmd->fmt, vg_name,
(gdb) bt
#0  0x080aa2b3 in vg_create (cmd=0x81ad6a8, vg_name=0xbffff736 "vg_test") at metadata/metadata.c:924
#1  0x0806a70e in vgcreate (cmd=0x81ad6a8, argc=1, argv=0xbffff5ac) at vgcreate.c:57
#2  0x0805782c in lvm_run_command (cmd=0x81ad6a8, argc=2, argv=0xbffff5a8) at lvmcmdline.c:1071
#3  0x08058634 in lvm2_main (argc=6, argv=0xbffff598) at lvmcmdline.c:1423
#4  0x08071493 in main (argc=7, argv=0xbffff594) at lvm-static.c:22

(gdb) p cmd->fmt->ops
$4 = (struct format_handler *) 0x0
Comment 5 Alasdair Kergon 2010-04-28 08:16:21 EDT
Also --config and --type similar problem.

Fix: remove arg_ptr_value entirely, store string instead, and lookup+revalidate each time it's accessed.
Comment 6 Alasdair Kergon 2010-04-28 21:36:35 EDT
Fixed upstream.

(Code was storing pointer to format/segtype during cmdline arg processing which could become invalid if config was refreshed.  Now it delays converting the names into pointers until after the config is processed.)

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