Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 217644

Summary: sys-fs/lvm2-2.02.33-r1: lvcreate: symbol lookup error during dlopen call
Product: Gentoo Linux Reporter: Jimmy.Jazz
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: agk, cardoe, drobbins, dschridde+gentoobugs, idl0r, robbat2
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to lvm2 ebuild which makes non-static builds work and filters --as-needed ldflags
non-static builds work and --as-needed ldflags are filtered
patch to lvm2 ebuild which makes non-static builds work and filters --as-needed ldflags
non-static builds work and --as-needed ldflags are filtered
emerge-info
build.log
as-needed.patch (doesn't solve the issue)
as-needed.patch
as-needed.patch
patch.diff

Description Jimmy.Jazz 2008-04-14 13:37:39 UTC
lvcreate is unable to resolve dm_event_register_handler.

# lvcreate --size 50m --snapshot --name snap /dev/vg/export
  Rounding up size to full physical extent 52,00 MB
  vg-snap: event registration failed: 17847:3 libdevmapper-event-lvm2snapshot.so dlopen failed: /usr/lib/liblvm2cmd.so.2.02: undefined symbol: dm_event_register_handler
  vg/snapshot0: snapshot segment monitoring function failed.
  Logical volume "snap" created
# lvremove /dev/vg/snap 
Do you really want to remove active logical volume "snap"? [y/n]: y
  Logical volume "snap" successfully removed




Reproducible: Always

Steps to Reproduce:
1.emerge -a device-mapper
2.USE="readline static" emerge -a lvm2
3./etc/init.d/dmeventd start
4.lvcreate --size 50m --snapshot --name snap /dev/vg/export
5.lvremove /dev/vg/snap 

Actual Results:  
lvcreate cannot register events.



# nm /usr/src/crossdev/usr/lib/debug/usr/lib64/liblvm2cmd.so.2.02.debug | grep  dm_event_register_handler
                 U dm_event_register_handler

#nm /usr/lib/debug/lib64/libdevmapper-event.so.1.02.debug | grep  dm_event_register_handler
0000000000002ad0 T dm_event_register_handler

# nm /usr/lib64/debug/usr/lib64/libdevmapper-event-lvm2snapshot.so.2.02.debug
0000000000000000 A Base
0000000000201df0 a _DYNAMIC
0000000000201fe8 a _GLOBAL_OFFSET_TABLE_
                 w _Jv_RegisterClasses
00000000002020b8 a __bss_start
                 w __cxa_finalize@@GLIBC_2.2.5
00000000002020a8 d __dso_handle
                 w __gmon_start__
00000000002020b8 a _edata
0000000000202148 a _end
0000000000202120 b _event_mutex
0000000000001178 t _fini
0000000000000b08 t _init
0000000000202118 b _lvm_handle
0000000000202110 b _mem_pool
0000000000202108 b _register_count
00000000002020e0 b _register_mutex
0000000000000ec0 t _temporary_log_fn
                 U dm_event_handler_create
                 U dm_event_handler_destroy
                 U dm_event_handler_set_dev_name
                 U dm_event_handler_set_event_mask
                 U dm_event_unregister_handler
                 U dm_get_next_target@@Base
                 U dm_pool_create@@Base
                 U dm_pool_destroy@@Base
                 U dm_task_get_name@@Base
                 U lvm2_exit@@Base
                 U lvm2_init@@Base
                 U lvm2_log_fn@@Base
                 U lvm2_log_level@@Base
                 U lvm2_run@@Base
0000000000000f20 T process_event
                 U pthread_mutex_lock@@GLIBC_2.2.5
                 U pthread_mutex_trylock
                 U pthread_mutex_unlock@@GLIBC_2.2.5
0000000000000db0 T register_device
                 U strchr@@GLIBC_2.2.5
                 U strtol@@GLIBC_2.2.5
                 U syslog@@GLIBC_2.2.5
0000000000000d20 T unregister_device
Comment 1 Alasdair Kergon 2008-04-14 18:51:31 UTC
check both lvm2 and device-mapper had --enable-dmeventd

(BTW give lvm2 2.02.34 a miss as it can segfault - wait for 2.02.35)
Comment 2 Alasdair Kergon 2008-04-14 18:55:17 UTC
and confirm which device-mapper version it is (use 1.02.24 or later)
Comment 3 Jimmy.Jazz 2008-04-15 12:49:56 UTC
(In reply to comment #1)
> check both lvm2 and device-mapper had --enable-dmeventd
> 
> (BTW give lvm2 2.02.34 a miss as it can segfault - wait for 2.02.35)
> 
They have.

For device-mapper,

 * econf: updating device-mapper.1.02.24/autoconf/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --sbindir=/sbin --enable-dmeventd --disable-selinux CLDFLAGS=-Wl,-O1 -Wl,--as-needed --libdir=/usr/lib64 --build=x86_64-pc-linux-gnu
checking build system type... x86_64-pc-linux-gnu

and for lvm2

 * econf: updating LVM2.2.02.33/autoconf/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-readline --disable-selinux --libdir=/usr/lib64 --enable-dmeventd --enable-cmdlib --enable-static_link --with-mirrors=internal --with-snapshots=internal --with-lvm1=none --with-clvmd=none --with-cluster=none --sbindir=/sbin --with-staticdir=/sbin CLDFLAGS=-Wl,-O1 --build=x86_64-pc-linux-gnu

Comment 4 Jimmy.Jazz 2008-04-15 12:53:59 UTC
(In reply to comment #2)
> and confirm which device-mapper version it is (use 1.02.24 or later)
> 

That was the last 1.02.24 device-mapper version. I will as you suggest install the 1.02.25 and report any improvement.

I will leave the "-Wl,--as-needed" LDFLAGS as well.
Comment 5 Jimmy.Jazz 2008-04-16 17:34:01 UTC
Hi,

It works with LDFLAGS=-Wl,-z,now set. Actually you should filter the LDFLAGS. I didn't test it with LDFLAGS=-Wl,-O1 to see if it works as well.
Comment 6 SpanKY gentoo-dev 2008-04-16 18:17:20 UTC
filtering flags ignores the problem, it doesnt fix things

post your `emerge --info` as an attachment when it worked, and when it didnt
Comment 7 Jimmy.Jazz 2008-04-16 19:16:05 UTC
(In reply to comment #6)
> filtering flags ignores the problem, it doesnt fix things
> 
> post your `emerge --info` as an attachment when it worked, and when it didnt
> 

Sorry I forgot to join the info. Both of my computers have the problem. Please, take in account I made a full update of the packages for the Athlon 64 today. So, the info isn't really accurate for the last one.

Phenom,

Portage 2.1.5_rc4 (default-linux/amd64/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.25-rc9 x86_64)
=================================================================
System uname: 2.6.25-rc9 x86_64 AMD Phenom(tm) 9500 Quad-Core Processor
Timestamp of tree: Wed, 16 Apr 2008 12:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="-march=k8 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac acl acpi alsa amd64 bash-completion bluetooth boost bzip2 cairo caps cli cracklib crypt cups curl dbus dga dlloader dri dts dv dvb dvdr encode exif expat fam fastcgi ffmpeg firefox flac fontconfig fuse gdbm gmp gnome gnutls gphoto2 gpm gsl gstreamer gtk hal iconv icu ieee1394 imap imlib isdnlog jack jpeg jpeg2k lame lcms libedit libnotify libwww lirc logrotate lzo mad maildir mailwrapper matroska midi mmap mmx mng mp3 mpeg mudflap musepack mysql ncurses network-cron newspr nls nptl nptlonly ogg openal openexr opengl openmp pam pcre pdf perl png posix pppd pulseaudio python qt4 quicktime readline reflection ruby sasl sdl session slang speex spl sse sse2 ssl startup-notification svg sysvipc tcpd theora threads tiff truetype udev unicode urandom usb userlocales v4l v4l2 vhosts vim-syntax vorbis wmf wxwindows x264 xcb xinetd xml xorg xpm xulrunner xv xvid zlib" ALSA_CARDS="hda-intel usb-audio virmidi" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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="worker" CAMERAS="ptp2" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" LIRC_DEVICES="devinput userspace" USERLAND="GNU" VIDEO_CARDS="radeonhd radeon r300"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Athlon 64,

Portage 2.1.5_rc4 (default-linux/amd64/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.25-rc8 x86_64)
=================================================================
System uname: 2.6.25-rc8 x86_64 AMD Athlon(tm) 64 Processor 3200+
Timestamp of tree: Wed, 16 Apr 2008 16:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/splash/livecd-2007.0/1280x1024.cfg /lib/rcscripts/addons /sbin/rc /sbin/splash-functions-bl1.sh /sbin/splash-functions.sh /usr/local/share/cursors/xorg-x11/default/index.theme /usr/share/hddtemp/hddtemp.db /usr/src/linux/.config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac acl acpi alsa amd64 bash-completion bluetooth boost bzip2 cairo caps cli cracklib crypt cups curl dbus dga dlloader dri dts dv dvb dvdr exif expat fam fastcgi ffmpeg firefox flac fontconfig gdbm gmp gnome gnutls gphoto2 gpm gsl gstreamer gtk hal iconv icu ieee1394 imap imlib isdnlog jack jpeg jpeg2k lame lcms libedit libnotify libwww lirc logrotate lzo mad maildir mailwrapper matroska midi mmap mmx mng mp3 mpeg mudflap musepack mysql ncurses network-cron newspr nls nptl nptlonly ogg openal openexr opengl openmp pam pcre pdf perl png posix pppd pulseaudio python qt4 quicktime readline reflection ruby sasl sdl session slang speex spl sse sse2 ssl startup-notification svg sysvipc tcpd theora threads tiff truetype udev unicode urandom usb userlocales v4l v4l2 vhosts vim-syntax vorbis wmf wxwindows x264 xcb xinetd xml xorg xpm xulrunner xv xvid zlib" ALSA_CARDS="intel8x0 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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="worker" CAMERAS="ptp2" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" LIRC_DEVICES="devinput userspace" USERLAND="GNU" VIDEO_CARDS="radeon r300"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Comment 8 Jimmy.Jazz 2008-04-19 22:08:21 UTC
(In reply to comment #6)
> filtering flags ignores the problem, it doesnt fix things
> 
> post your `emerge --info` as an attachment when it worked, and when it didnt
> 

To be precise, it has never worked until i changed the LDFLAGS. See info above. However, i didn't have activated dmeventd daemon before.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-06-08 19:38:26 UTC
vapier: I don't think he gave you the info you wanted, could you clarify it for him.
Comment 10 Jimmy.Jazz 2008-06-08 20:42:00 UTC
(In reply to comment #9)
> vapier: I don't think he gave you the info you wanted, could you clarify it for
> him.
> 

As far as i understood, Spanky asked me for the emerge --info. They didn't changed before and after the issue on both computers, only /etc/portage/bashrc has been altered like i said comment #5.

[snap]

    "sys-fs/device-mapper")
        export LDFLAGS="-Wl,-z,now"
        ;;
    "sys-fs/lvm2")
        export LDFLAGS="-Wl,-z,now"

[/snap]

My settings has since evolved a lot but i didn't changed bashrc.

I'm now using,
sys-fs/device-mapper-1.02.25
sys-fs/lvm2-2.02.36
Comment 11 Jimmy.Jazz 2008-07-21 21:17:51 UTC
Hello,

same issue with  sys-fs/lvm2-2.02.39 and sys-fs/device-mapper-1.02.27.

I don't follow why lvm2 doesn't contain lvm2_run.

Flags used,
sys-fs/lvm2-2.02.39  USE="readline static

although the object file /usr/lib64/liblvm2cmd.so.2.02 has lvm2_run 

nm /./usr/lib/debug/usr/lib64/liblvm2cmd.so.2.02.debug | grep lvm2_run
000000000005d890 T lvm2_run

or

nm /usr/lib64/liblvm2cmd.a | grep lvm2_run
0000000000000030 T lvm2_run

but lvcreate alias lvm doesn't even if it has been statically linked.

21-juil. 21:57 gentoo-dir JobId 912: BeforeJob: Create snapshot for www
21-juil. 21:57 gentoo-dir JobId 912: BeforeJob:   vg-snap--bacula--www: event registration failed: 16376:3 libdevmapper-event-lvm2snapshot.so dlopen failed: /usr/lib/libdevmapper-event-lvm2snapshot.so: undefined symbol: lvm2_run
21-juil. 21:57 gentoo-dir JobId 912: BeforeJob:   vg/snapshot0: snapshot segment monitoring function failed.

As usual, emerge --info

Portage 2.2_rc1 (default/linux/amd64/2008.0, gcc-4.3.1, glibc-2.8_p20080602-r0, 2.6.26 x86_64)
=================================================================
System uname: Linux-2.6.26-x86_64-AMD_Athlon-tm-_64_Processor_3200+-with-glibc2.2.5
Timestamp of tree: Mon, 21 Jul 2008 05:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.5.2-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.12
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.62-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r4
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/splash/livecd-2007.0/1280x1024.cfg /lib/rcscripts/addons /sbin/rc /sbin/splash-functions-bl1.sh /sbin/splash-functions.sh /usr/local/share/cursors/xorg-x11/default/index.theme /usr/share/hddtemp/hddtemp.db /usr/src/linux/.config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch preserve-libs sandbox sfperms splitdebug strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/layman/zumastor /usr/portage/local/overlay"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 bash-completion bluetooth boost bzip2 cairo caps cli cracklib crypt css cups curl dbus dga dlloader dri dts dv dvb dvd dvdr exif expat fam fastcgi ffmpeg firefox flac fontconfig gdbm gmp gnome gnutls gphoto2 gpm gsl gstreamer gtk hal iconv icu ieee1394 imap imlib isdnlog jack jpeg jpeg2k lame lcms libedit libnotify libwww lirc logrotate lzo mad maildir mailwrapper matroska midi mmap mmx mng mp3 mpeg mudflap multilib musepack mysql ncurses network-cron newspr nls nptl nptlonly ogg openal openexr opengl openmp pam pcre pdf perl png posix pppd pulseaudio python qt4 quicktime readline reflection ruby sasl sdl session slang speex spl sse sse2 ssl startup-notification svg sysvipc tcpd theora threads tiff truetype udev unicode urandom usb userlocales v4l v4l2 vhosts vim-syntax vorbis wmf wxwindows x264 xcb xinetd xml xorg xpm xulrunner xv xvid zlib" ALSA_CARDS="intel8x0 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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="worker" CAMERAS="ptp2" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" LIRC_DEVICES="devinput userspace" USERLAND="GNU" VIDEO_CARDS="radeon r300"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Comment 12 Jimmy.Jazz 2008-07-24 14:24:21 UTC
Hello,

I have found an quikly and lazy way to correct temporarily that embarrassing issue by adding some LIBS to emake. I hope someone will dig more deeply to find a more acceptable solution to that problem as I have. Please have a look at it.

# diff -ruN /usr/portage/sys-fs/lvm2/lvm2-2.02.39.ebuild lvm2-2.02.39.ebuild
--- /usr/portage/sys-fs/lvm2/lvm2-2.02.39.ebuild	2008-06-28 11:17:12.000000000 +0200
+++ lvm2-2.02.39.ebuild	2008-07-24 16:14:25.000000000 +0200
@@ -93,7 +93,7 @@
 		--libdir=/usr/$(get_libdir) \
 		${myconf} \
 		CLDFLAGS="${LDFLAGS}" || die
-	emake || die "compile problem"
+	emake LIBS="-lrt -lreadline -ldevmapper-event -llvm2cmd -ldl" || die "compile problem"
 }
 
 src_install() {
Comment 13 Robert A. 2008-08-17 17:40:24 UTC
(In reply to comment #12)

your patch to the ebuild and unsetting LDFLAGS (i guess it was --as-needed) made it work for me.
Comment 14 Robert A. 2008-09-11 21:11:16 UTC
i also need to add --libdir=/lib to myconf. otherwise liblvm2cmd.so.2.02 is placed in /usr/lib and lvm can not start in the boot runlevel because /usr not mounted.
Comment 15 Robert A. 2008-09-12 07:56:49 UTC
Created attachment 165241 [details, diff]
patch to lvm2 ebuild which makes non-static builds work and filters --as-needed ldflags
Comment 16 Robert A. 2008-09-12 07:57:29 UTC
Created attachment 165242 [details]
non-static builds work and --as-needed ldflags are filtered
Comment 17 Robert A. 2008-09-12 15:17:23 UTC
i apparently did not add "-llvm2cmd" to emake
Comment 18 Robert A. 2008-09-12 15:18:30 UTC
Created attachment 165279 [details, diff]
patch to lvm2 ebuild which makes non-static builds work and filters --as-needed ldflags
Comment 19 Robert A. 2008-09-12 15:19:13 UTC
Created attachment 165281 [details]
non-static builds work and --as-needed ldflags are filtered
Comment 20 SpanKY gentoo-dev 2008-10-26 06:32:14 UTC
so lets review ... this issue only comes up when using -static or --as-needed ?
Comment 21 Robert A. 2008-10-26 10:23:22 UTC
(In reply to comment #20)
> so lets review ... this issue only comes up when using -static or --as-needed ?

the --as-needed filter and emake update is necessary for using snapshots (otherwise you get the undefined symbol errors).

the non-static issue is a different one i stumbled across while looking at this (but should be fixed imo, because the dynamically linked lvm binary does not work in the boot runlevel if you have / and /usr on different volumes).


Comment 22 Jeff Mitchell 2009-04-06 23:05:19 UTC
If lvm2 does not already exist on your system, this patch breaks compile, because lvm2cmd library is not found.

I should mention that, also, there are dependences on glibc and readline that are not in DEPEND (although this isn't due to your patch).

The good news is that if lvm2 does exist on the system already, the patch does work, and still does with 2.02.42.

I'm a bit confused as to why this problem exists in 2.02.42 at all though; the LVM guys seem to think it's fixed.  WHATS_NEW in the official source location ( ftp://sources.redhat.com/pub/lvm2/WHATS_NEW ) says in the notes for 2.02.40: "Fix dmeventd monitoring libraries to link against liblvm2cmd again (2.02.39)", suggesting this bug was introduced in 2.02.39.  Unless it's a different linking error...
Comment 23 r1k0 2009-04-13 11:07:36 UTC
(In reply to comment #22)
> If lvm2 does not already exist on your system, this patch breaks compile,
> because lvm2cmd library is not found.
> 
> I should mention that, also, there are dependences on glibc and readline that
> are not in DEPEND (although this isn't due to your patch).
> 
> The good news is that if lvm2 does exist on the system already, the patch does
> work, and still does with 2.02.42.
> 
> I'm a bit confused as to why this problem exists in 2.02.42 at all though; the
> LVM guys seem to think it's fixed.  WHATS_NEW in the official source location (
> ftp://sources.redhat.com/pub/lvm2/WHATS_NEW ) says in the notes for 2.02.40:
> "Fix dmeventd monitoring libraries to link against liblvm2cmd again (2.02.39)",
> suggesting this bug was introduced in 2.02.39.  Unless it's a different linking
> error...
> 

I experience the same "ld: cannot find -llvm2cmd" error bootstrapping a basic lvm ~gentoo system from stage3. This happens for me only on unstable x86 and compiles fine on stable. 

Comment 24 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-05-09 23:40:50 UTC
Please try 2.02.45-r1, I tried a totally different fix.
Comment 25 Dennis Schridde 2009-06-21 16:44:13 UTC
I do not want to spoil the party, but I am still having this issue.

"lvcreate -L500M -s -n backup_home /dev/volume1/home" responds with:
  volume1-backup_home: event registration failed: 21749:3 libdevmapper-event-lvm2snapshot.so dlopen failed: /lib/liblvm2cmd.so.: undefined symbol: dm_event_register_handler
  volume1/snapshot0: snapshot segment monitoring function failed.
  Logical volume "backup_home" created

I am using sys-fs/lvm2-2.02.45-r2.

Portage 2.2_rc33 (hardened/linux/ia64/2008.0/server, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.29-hardened ia64)
=================================================================                                            
System uname: Linux-2.6.29-hardened-ia64-31-with-gentoo-2.0.1                                                
Timestamp of tree: Tue, 16 Jun 2009 06:45:01 +0000                                                           
app-shells/bash:     3.2_p39                                                                                 
dev-lang/python:     2.6.2-r1                                                                                
dev-python/pycrypto: 2.0.1-r8                                                                                
dev-util/cmake:      2.6.4                                                                                   
sys-apps/baselayout: 2.0.1                                                                                   
sys-apps/openrc:     0.4.3-r3                                                                                
sys-apps/sandbox:    1.6-r2                                                                                  
sys-devel/autoconf:  2.63                                                                                    
sys-devel/automake:  1.7.9-r1, 1.10.2                                                                        
sys-devel/binutils:  2.19.1-r1                                                                               
sys-devel/gcc-config: 1.4.1                                                                                  
sys-devel/libtool:   1.5.26                                                                                  
virtual/os-headers:  2.6.27-r2                                                                               
ACCEPT_KEYWORDS="ia64"                                                                                       
CBUILD="ia64-unknown-linux-gnu"                                                                              
CFLAGS="-pipe -mtune=mckinley -O2 -ftree-vectorize"                                                          
CHOST="ia64-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /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/udev/rules.d"
CXXFLAGS="-pipe -mtune=mckinley -O2 -ftree-vectorize"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--include='/x11-libs/' --include='/x11-libs/qt*/' --exclude='/x11-libs/*/' --exclude='/games*/' --exclude='/gnome*/' --exclude='/gnustep*/' --exclude='/gpe*/' --exclude='/kde*/' --exclude='/lxde*/' --exclude='/rox*/' --exclude='/sci*/' --exclude='/x11*/' --exclude='/xfce*/'"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cache/portage/gentoo"
PORTDIR_OVERLAY="/var/cache/portage/local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl apache2 berkdb bzip2 caps cli cracklib crypt cups dri gdbm gpm ia64 iconv ipv6 isdnlog ldap mailwrapper midi mudflap mysql ncurses nptl nptlonly pam pcre perl pic pppd python readline reflection session snmp spl ssl sysfs tcpd truetype unicode urandom vhosts xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 authn_alias authn_anon 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 deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage tdfx vesa vga voodoo"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS_FLAGS
Comment 26 Christian Ruppert (idl0r) gentoo-dev 2009-06-30 22:30:46 UTC
Created attachment 196213 [details]
emerge-info

There are still unresolved symbols, in sys-fs/lvm2-2.02.36 and 2.02.45-r2.

lvcreate -s -L500M -nfoo /dev/vg/test
  vg-backup: event registration failed: 21326:3 libdevmapper-event-lvm2snapshot.so dlopen failed: /lib/libdevmapper-event-lvm2snapshot.so: undefined symbol: lvm2_run
  vg/snapshot0: snapshot segment monitoring function failed.
  Logical volume "foo" created
Comment 27 Christian Ruppert (idl0r) gentoo-dev 2009-06-30 22:33:54 UTC
Created attachment 196215 [details]
build.log
Comment 28 Christian Ruppert (idl0r) gentoo-dev 2009-06-30 22:38:36 UTC
Created attachment 196217 [details, diff]
as-needed.patch (doesn't solve the issue)

So thats what i thought might help but it didn't :(
It based on lvm 2.02.36, maybe somebody else has further ideas.
Comment 29 Christian Ruppert (idl0r) gentoo-dev 2009-06-30 22:38:55 UTC
Reopen
Comment 30 Robert A. 2009-06-30 22:46:03 UTC
if you do not need dmeventd you can just comment
mirror_library = "libdevmapper-event-lvm2mirror.so"
and
snapshot_library = "libdevmapper-event-lvm2snapshot.so"
in /etc/lvm/lvm.conf
Comment 31 Christian Ruppert (idl0r) gentoo-dev 2009-07-01 00:59:06 UTC
Created attachment 196219 [details, diff]
as-needed.patch

Ok, next try.. Got a "working" patch now which has "just" a parallel build issue.
So we must ensure that liblvm.a has been build first then it should work as expected.

I tested just some basic stuff so I'm not sure if there are still issues left.
I bet Alasdair is more familiar with lvm2 so I hope he can help with the rest :)
Comment 32 Christian Ruppert (idl0r) gentoo-dev 2009-07-01 21:37:07 UTC
Created attachment 196294 [details, diff]
as-needed.patch

Adds also 2 missing -lpthread for the mirror and snapshot plugin.
Comment 33 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-07-05 22:32:09 UTC
Merged in 2.02.48 now, along with a new parallel fix.
Comment 34 Chris Coleman 2009-07-14 22:34:57 UTC
(In reply to comment #33)
> Merged in 2.02.48 now, along with a new parallel fix.
> 

The patch in portage (lvm2-2.02.48-as-needed.patch) causes emerge to fail with a linking error when lvm2 is not already installed and MAKEOPTS="-j1".

"ld: cannot find -ldevmapper-event"
Comment 35 Christian Ruppert (idl0r) gentoo-dev 2009-07-17 09:24:55 UTC
Created attachment 198267 [details, diff]
patch.diff

That should fix the linker issue.
Its a patch for files/lvm2-2.02.48-as-needed.patch.
Comment 36 Christian Ruppert (idl0r) gentoo-dev 2009-07-19 18:10:08 UTC
(In reply to comment #34)
> (In reply to comment #33)
> > Merged in 2.02.48 now, along with a new parallel fix.
> > 
> 
> The patch in portage (lvm2-2.02.48-as-needed.patch) causes emerge to fail with
> a linking error when lvm2 is not already installed and MAKEOPTS="-j1".
> 
> "ld: cannot find -ldevmapper-event"
> 

Fixed in cvs, thanks!
Comment 37 Daniel Robbins 2009-07-24 03:57:49 UTC
From what I can tell, 2.02.48+ is not unmasked for any stable arches, and I would not consider this bug truly "resolved" until this is done, as the bug still exists in all stable gentoo installs.
Comment 38 Dennis Schridde 2009-08-17 17:39:42 UTC
I am having a similar issue with sys-fs/lvm2-2.02.49-r3:

vg-part: event registration failed: 28128:3 libdevmapper-event-lvm2snapshot.so dlopen failed: /lib/libdevmapper-event.so.1.02: symbol dm_log_with_errno, version Base not defined in file libdevmapper.so.1.02 with link time reference                                                                                                                                                                                   
vg/snapshot0: snapshot segment monitoring function failed.                                                                                                                                                    
Logical volume "part" created                                                                                                                                                                              
Comment 39 Dennis Schridde 2009-08-17 17:46:25 UTC
(In reply to comment #38)
> I am having a similar issue with sys-fs/lvm2-2.02.49-r3:
> 
> vg-part: event registration failed: 28128:3 libdevmapper-event-lvm2snapshot.so
> dlopen failed: /lib/libdevmapper-event.so.1.02: symbol dm_log_with_errno,
> version Base not defined in file libdevmapper.so.1.02 with link time reference  
> vg/snapshot0: snapshot segment monitoring function failed.                      
> Logical volume "part" created                                                   
P.S: I tried recompiling several times, but it did not help.
Comment 40 Dale Pontius 2009-11-15 16:58:04 UTC
I'm getting the same "ld: cannot find -ldevmapper-event" error on the x86 stable sys-fs/lvm2-2.02.51* ebuilds.  I've masked ">=sys-fs/lvm2-2.02.49" and set "=sys-fs/lvm2-2.02.48* ~x86", and finally have a clean lvm2 install, after removing device-mapper because of the e2fsprogs blocks.

Tried to reopen, but can't.  Still a bug for stable, as others have said.
Comment 41 Christian Ruppert (idl0r) gentoo-dev 2009-11-15 17:08:30 UTC
(In reply to comment #40)
> I'm getting the same "ld: cannot find -ldevmapper-event" error on the x86
> stable sys-fs/lvm2-2.02.51* ebuilds.  I've masked ">=sys-fs/lvm2-2.02.49" and
> set "=sys-fs/lvm2-2.02.48* ~x86", and finally have a clean lvm2 install, after
> removing device-mapper because of the e2fsprogs blocks.
> 
> Tried to reopen, but can't.  Still a bug for stable, as others have said.
> 

Please file a new bug and attach the build.log.
Comment 42 Petre Rodan 2009-11-16 20:52:34 UTC
(In reply to comment #41)
> Please file a new bug and attach the build.log.
 
have a look at bug #293272