Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 279979 - sys-fs/lvm2-2.02.49-r{1,2,3}: pvcreate segfault on md raid5 partition
Summary: sys-fs/lvm2-2.02.49-r{1,2,3}: pvcreate segfault on md raid5 partition
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Robin Johnson
Depends on:
Reported: 2009-08-02 00:45 UTC by Phil Turmel
Modified: 2009-08-27 18:01 UTC (History)
5 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Phil Turmel 2009-08-02 00:45:00 UTC
pvcreate from lvm2-2.02.49 segfaults on raid5 md device (all three .49 ebuilds).  pvcreate from lvm2-2.02.48 works fine.

Reproducible: Always

Steps to Reproduce:
1. I created a fresh MD raid5 device "/dev/md3" across three physical partitions.
2. Designate the MD device as an LVM physical volume: pvcreate /dev/md3
Actual Results:  
Stack trace is small....

# gdb --args pvcreate /dev/md3
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
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 "i686-pc-linux-gnu"...
(no debugging symbols found)
(gdb) run
Starting program: /sbin/pvcreate /dev/md3
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
File descriptor 3 (pipe:[211905]) leaked on pvcreate invocation. Parent PID 1530: gdb
File descriptor 4 (pipe:[211905]) leaked on pvcreate invocation. Parent PID 1530: gdb
File descriptor 5 (/sbin/lvm) leaked on pvcreate invocation. Parent PID 1530: gdb
[New Thread 0xb7db18d0 (LWP 1531)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7db18d0 (LWP 1531)]
0xb7e265db in strlen () from /lib/
(gdb) bt
#0  0xb7e265db in strlen () from /lib/
#1  0xb7df3ae8 in vfprintf () from /lib/
#2  0xb7e97c32 in __vsnprintf_chk () from /lib/
#3  0xb7f935c7 in dm_snprintf () from /lib/
#4  0x08086294 in _md_sysfs_attribute_scanf ()
#5  0x08086596 in dev_md_stripe_width ()
#6  0x080aa00d in set_pe_align ()
#7  0x080926f8 in _text_pv_setup ()
#8  0x080a8480 in pv_create ()
#9  0x080676b4 in pvcreate ()
#10 0x0805efe7 in lvm_run_command ()
#11 0x080615d8 in lvm2_main ()
#12 0x080773c2 in main ()

Expected Results:  
(after downgrading to lvm2-2.02.48-r2)

# pvcreate /dev/md3
  Physical volume "/dev/md3" successfully created

I've set aside a small (~300M) area on these three drives, configured as /dev/md4, to be used for further testing.

# emerge --info
Portage (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.30-gentoo-r1 i686)
System uname: Linux-2.6.30-gentoo-r1-i686-Intel-R-_Pentium-R-_D_CPU_2.80GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 30 Jul 2009 06:45:01 +0000
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.5.4-r3, 2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
CFLAGS="-O2 -march=i686 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
EMERGE_DEFAULT_OPTS="--keep-going --with-bdeps y"
FEATURES="distlocks fixpackages nostrip parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
LINGUAS="en_US en fr"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="3dnow X a52 aac aalib acl aiglx alsa amr amrnb amrwb apache2 berkdb bidi bzip2 cairo cddb cdparanoia cjk cli cpudetection cracklib crypt cups dbus dri dts dvdnav dvdread encode faac ffmpeg firefox flac fortran gdbm gpm hal iconv id3 id3tag ieee1394 imagemagick imlib ipod isdnlog ivtv java jpeg jpeg2k kde ladspa lame ldap libsamplerate midi mmx mmxext mng mozbranding mp3 mp4 mpeg mtp mudflap musepack mysql ncurses network nls nptl nptlonly nsplugin ogg opengl openmp pam pcre perl png postgres pppd python qt3 qt3support quicktime readline reflection replaygain schroedinger sdl session speex spl sse sse2 ssl svg sysfs tcpd theora threads tiff truetype unicode v4l v4l2 vorbis wmf x264 x86 xcb xorg xv xvid xvmc yv12 zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="itk" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US en fr" USERLAND="GNU" VIDEO_CARDS="nvidia"
Comment 1 sargastic 2009-08-19 11:21:45 UTC
Same crash on a RAID1 device with lvm2-2.02.49-r3.
Problem solved by downgrading to lvm2-2.02.48-r2.
Comment 2 David Klempner 2009-08-20 00:27:37 UTC
This is also fixed in CVS upstream.

I'm not sure if it's been fixed in one of the two releases since .49.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-27 01:02:58 UTC
Please test .51 then, I've put it in the tree.
Comment 4 David Klempner 2009-08-27 05:26:07 UTC
.51 works fine.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-27 18:01:32 UTC
Thanks, closing fully.