Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58798 - LVM2 tools segfault unless /dev/md* is filtered out
Summary: LVM2 tools segfault unless /dev/md* is filtered out
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Everything (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Max Kalika (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-29 10:23 UTC by Randall Nortman
Modified: 2005-05-24 00:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randall Nortman 2004-07-29 10:23:44 UTC
When booting the 2004.2 amd64 Universal LiveCD, then trying to create/activate LVM volumes, the LVM tools will crash (segmentation fault) the first time you run one (I have tried both vgscan and pvcreate), and then all subsequent invocations of any LVM tool will hang, consuming 100% of CPU until killed.  If the /dev/md devices are filtered out in /etc/lvm/lvm.conf with 'devices { filter=["r/md/"] }', then everything works fine.  This is true whether I have md devices activated or not.  (The problem is that I want to put LVM on an md device, so I can't just filter out those devices and proceed).

I have tried this with the x86 (32-bit) LiveCD and it works fine.  I have also used a Debian From Scratch boot CD with an amd64 kernel, and its LVM tools work fine.  (DFS CD images available from http://people.debian.org/~jgoerzen/dfs/).  Therefore, it seems apparent that this is a Gentoo-specific bug.  (Though I suppose the DFS CD might be using 32-bit LVM binaries, whereas perhaps the Gentoo CD has 64-bit binaries, but I'm not sure about that.)



Reproducible: Always
Steps to Reproduce:
1. Boot 2004.2 amd64 Universal LiveCD on amd64 platform
2. Execute 'vgscan' (or 'pvcreate').  It will segfault.
3. Execute 'vgscan' or any other LVM tool.  It will hang, consuming 100% of CPU until it is killed.

Actual Results:  
See above -- first invocation segfaults, subsequent tries hang.

Expected Results:  
'vgscan' should have found no LVM volumes.  I should then be able to create
volumes with pvcreate, vgcreate, and lvcreate.


My hardware:

CPU: Athlon64 3000+
RAM: 2x512MB PC3200 ECC RAM (1GB total)
Mobo: MSI K8N Neo Platinum (nVidia nForce3 250Gb chipset, most recent BIOS from
MSI -- v1.1)
Disk: 2x120GB SATA (Samsung SpinPoint), attached to onboard SATA controller
(these show up as /dev/hde and /dev/hdg, but only after I've loaded the ide-disk
module)
CDROM: Generic ATAPI drive on IDE0 (/dev/hda)

I can't paste 'emerge info' output, because I haven't gotten that far in the
installation yet.
Comment 1 Randall Nortman 2004-07-29 18:56:12 UTC
I have built a version of lvm2 with debugging symbols, to track down where the segfault is.  It occurs at line 71 of lib/filters/filter.c, which is:

[...]
  if (!(((int *) f->private)[MAJOR(dev->dev)])) {
[...]

I don't know what this means, but I might dive into the code a bit to find out, if I have time.  I'll keep this report updated with any new information I discover.
Comment 2 Randall Nortman 2004-07-30 07:47:23 UTC
Looks like it dies when the scan of /dev gets to /dev/mdd128, and I think I know why: they hardcode 255 as the highest device major number, and I think that's not a valid assumption when devfs is in use.  (That explains why it didn't happen on my Debian boot CD, since they don't use devfs.)  So this appears to be an upstream bug, not a Gentoo bug.  I will go submit it to the LVM maintainers and see what they make of it.  In the meantime, I may create a patch of my own.
Comment 3 Alasdair Kergon 2004-07-30 13:58:38 UTC
What does 'lvm version' return?

It was meant to be fixed in 2.00.20 / dm 1.00.19
Comment 4 Randall Nortman 2004-07-30 14:03:54 UTC
Output of 'lvm version':

  LVM version:     2.00.08 (2003-11-14)
  Library version: 1.00.17-ioctl (2004-04-19)
  Driver version:  4.1.0

So it looks like the problem will be fixed if Gentoo updates to the newer version.  I'd be happy to test this on my system, once an ebuild is available.
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2004-08-02 09:35:54 UTC
Assigning to maintainer
Comment 6 Peter J. Dohm 2004-08-02 21:54:07 UTC
fyi, this is happening to me on an AMD 32-bit CPU running the SMP kernel as well...
Comment 7 Peter J. Dohm 2004-08-02 21:55:22 UTC
fyi, this is happening to me on an AMD 32 bit CPU with an SMP kernel as well (off the livecd)
Comment 8 Daniel Palmer 2004-09-28 01:01:50 UTC
FYI - I was having this issue under initrds - upgraded to LVM 2.00.24 - all good :)
Comment 9 Fred Frigerio 2004-11-20 12:26:36 UTC
If anyone stumbles on this problem before it is fixed upstream, the workaround is:

/etc/lvm/lvm.conf

devices {
    filter=["r|cdrom|, "r|^/dev/md|"]
    }

BTW: I am having this problem with a clean install of 2004.3 on x86 following the installation manual and the LVM2 documents from gentoo. Maybe it should be mentioned there.
Comment 10 Max Kalika (RETIRED) gentoo-dev 2004-12-13 21:57:34 UTC
So people using .25 confirm all is good and we'll mark this as done and bump to stable.  Better yet verify that .31 is happy (just copy .25 to .31 -- there's no build changes, just some man page updates and some minor other fixes).
Comment 11 Tiago Freire 2005-01-28 04:37:16 UTC
I am installing gentoo on an Athlon 64 using 2004.3 and used LVM on top of a RAID partition and it went out without problems so far. (the installation is not finished yet).
Comment 12 Henry Bauer 2005-02-09 08:22:01 UTC
Success confirmation - using .08, I had segfaults; using .25 or .33 I do not (.31 isn't available any more).
CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"

I couldn't filter out /dev/md because that's what I'm trying to LVM. :)

Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2005-05-24 00:07:41 UTC
The required packages to have this fixed are marked stable (as per the user
comments). Closing. Re-open if it's still an issue.