App-perlbrew
App-perlbrew copied to clipboard
"perlbrew use" crashes. "unset PERL5LIB" before sourcing the bashrc fixes it. unsure what to do
One of our servers uses a distro called SME (we're on v7.6), which is based on CentOS ~4.9. A lot of things are different in SME than in CentOS but hopefully this is an easy one...as I'm more or less competent in bash but not terribly perl savvy.
When I run perlbrew use 5.16.0 (which has been installed already without error) I get this:
[root@host ~]# perlbrew use 5.16.0
perl: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_Tstack_sp_ptr
I've noticed so far from some searching online that $PERL5LIB is set on this host, but it is not set when I log into other hosts (which do not have a problem with perlbrew).
Unsetting PERL5LIB before sourcing perlbrew's bashrc fixes the issue for the given session, so I've been able to install-cpanm and install what I needed (Brackup). I feel more or less certain that this would not have done any damage to the system perl so far. I'm just not fully aware of the implication here and I don't want to start explicitly unsetting this variable all the time until things are more clear.
So is this a perlbrew issue or my issue? If it is my issue...I'd certainly welcome any hints.
TIA!
Suddenly I remember reading that symbol lookup error can be caused by mixing thread/non-thread components, and also people complaining about forgetting to use -Dusethreads.
So I should add that I did not enable threads when installing. Would that suffice or is there still a larger issue?
Based on the description, I'd guess that somewhere in your PERL5LIB, there's a Time::HiRes installed that is incompatible with another version of Time::HiRess that installed under /usr/lib/perl5/vendor_perl/
.
This might be an issue after you use/switch between binary-incompatible perl versions because perlbrew
executable itself failed to execute. If you do suffer from this, one thing I'd like you to try, is to modify the shebang line of perlbrew to #!/usr/bin/perl
. Currently it is #!/usr/bin/env perl
. This should solve that praticular problem.
That seems to get perlbrew running normally again. However, it seems like I'll have the same problem if I ever try to run something through perlbrew's perl that uses Time:HiRes, which seems to break the concept of having completely separate perls installed. I tried a test below and also included a lot more interaction with this environment:
(I should note that everything I'm pasting into this post was done when I had perl-5.16.0 installed with -Dusethreads. It seemed to make no difference whatsoever, but previous posts were from an install that did not use any added flags.)
[root@host ~]# which perl
/usr/bin/perl
[root@host ~]# perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
Platform:
osname=linux, osvers=2.6.18-53.el5, archname=i386-linux-thread-multi
uname='linux builder10.centos.org 2.6.18-53.el5 #1 smp mon nov 12 02:14:55 est 2007 i686 athlon i386 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -Dversion=5.8.5 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux-thread-multi -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-11)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Dec 9 2011 03:12:31
%ENV:
PERL5LIB="/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.5:/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/vendor_perl/5.8.5"
@INC:
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl
.
[root@host ~]# cat foo.pl
#!/usr/bin/perl
use Time::HiRes;
exit
[root@host ~]# perl foo.pl #works
[root@host ~]# source ~/perl5/perlbrew/etc/bashrc
[root@host ~]# which perl
/root/perl5/perlbrew/perls/perl-5.16.0/bin/perl
[root@host ~]# perl -V
Summary of my perl5 (revision 5 version 16 subversion 0) configuration:
Platform:
osname=linux, osvers=2.6.9-103.elsmp, archname=i686-linux-thread-multi
uname='linux host 2.6.9-103.elsmp #1 smp fri dec 9 04:31:51 est 2011 i686 i686 i386 gnulinux '
config_args='-de -Dprefix=/root/perl5/perlbrew/perls/perl-5.16.0 -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-11)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO
USE_PERL_ATOF USE_REENTRANT_API
Built under linux
Compiled at Jun 19 2012 15:40:49
%ENV:
PERL5LIB="/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.5:/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/vendor_perl/5.8.5"
PERLBREW_BASHRC_VERSION="0.43"
PERLBREW_HOME="/root/.perlbrew"
PERLBREW_MANPATH="/root/perl5/perlbrew/perls/perl-5.16.0/man"
PERLBREW_PATH="/root/perl5/perlbrew/bin:/root/perl5/perlbrew/perls/perl-5.16.0/bin"
PERLBREW_PERL="perl-5.16.0"
PERLBREW_ROOT="/root/perl5/perlbrew"
PERLBREW_VERSION="0.43"
@INC:
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/root/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/i686-linux-thread-multi
/root/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0
/root/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/i686-linux-thread-multi
/root/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0
.
[root@host ~]# head -n2 /root/perl5/perlbrew/bin/perlbrew # Modified perlbrew
#!/usr/bin/perl
# This chunk of stuff was generated by App::FatPacker. To find the original
[root@host ~]# perlbrew switch 5.16.0 # works
[root@host ~]# perl foo.pl
perl: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_Tstack_sp_ptr
[root@host ~]# PERL5LIB="/usr/lib/perl5/site_perl/5.8.5:/usr/lib/perl5/vendor_perl/5.8.5" #cut some paths out
[root@host ~]# perl foo.pl # works
[root@host ~]# perlbrew off
perlbrew is turned off.
[root@host ~]# which perl
/usr/bin/perl
[root@host ~]# perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
Platform:
osname=linux, osvers=2.6.18-53.el5, archname=i386-linux-thread-multi
uname='linux builder10.centos.org 2.6.18-53.el5 #1 smp mon nov 12 02:14:55 est 2007 i686 athlon i386 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -Dversion=5.8.5 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux-thread-multi -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-11)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Dec 9 2011 03:12:31
%ENV:
PERL5LIB="/usr/lib/perl5/site_perl/5.8.5:/usr/lib/perl5/vendor_perl/5.8.5"
PERLBREW_BASHRC_VERSION="0.43"
PERLBREW_HOME="/root/.perlbrew"
PERLBREW_MANPATH=""
PERLBREW_PATH="/root/perl5/perlbrew/bin"
PERLBREW_PERL=""
PERLBREW_ROOT="/root/perl5/perlbrew"
PERLBREW_VERSION="0.43"
@INC:
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl
.
[root@host ~]#
Thanks for the help thus far. I realize this issues board may not specifically be intended for support. I'm still happy to take any help I can get but if the issue here seems to just be with our system I can continue elsewhere. :)
See also #387.
Since #387 has been closed, this may also be close-able. Particularly, I am no longer able to break perlbrew on OSX using a HiRes system-installed lib (on my manually set PERL5LIB
path) when invoking Perlbrew. Manually hacking the path does break programs I run through perlbrew, but I think that's expected behavior/unavoidable.
Alternatively, it seems like most of the "weird" runtime-imported compiled depenencies that I can see come from the use of Capture::Tiny
, so far as I can see. That depenency could be removed (it appears that most of the places it's invoked either only care about STDOUT, so backticks would suffice; if STDERR were returned it would probably break things at present). If that's something maintainers are interested in pursuing I can make a PR for it.