The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Perl bless/overload Problem on RHEL5/CentOS5)

Discussion in 'General Discussion' started by orty, Aug 25, 2008.

  1. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Now, correct me if I'm wrong, but cPanel is in charge of the Perl distro on our servers, right? Are they planning on addressing this?

    https://bugzilla.redhat.com/show_bug.cgi?id=379791
    (referenced here:
    http://blog.vipul.net/2008/08/24/redhat-perl-what-a-tragedy/ )

    Quoting from that site:
    Code:
    Steps to Reproduce:
    1. Use the test script below
    
    #!/usr/bin/perl
    use overload q(<) => sub {};
    my %h;
    for (my $i=0; $i<50000; $i++) {
       $h{$i} = bless [ ] => 'main';
       print STDERR '.' if $i % 1000 == 0;
    }
    ---------------------------------------------------
    
    as an executable file "stour-test.pl".
    
    2. Type
    
    $ time ./stour-test.pl
    
    and the program will print 50 dots.
    
    The program should complete in less than 1 second, but takes much longer under RHEL5.
    This also applies to CentOS 5.

    Cpanel folks: Do you have a plan/patch/thoughts on this? Or is this a non-issue (the perl code just runs slow -- not that it doesn't run). I'm pretty sure if we try to patch this ourselves, cPanel will break (but correct me if I'm wrong).
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I think RH has to officially address it first don't they?
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    That only impacts code that uses 'overload', and uses it a lot. cPanel uses 'overload' in only a handful of places. If you are concerned, then use /usr/local/bin/perl (which is installed by our Perl installer) since it doesn't have this issue (at least it doesn't appear to in the test I just ran).
     
  4. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    I just ran both stock system perl and directly calling that /usr/local/bin/perl, and it appears to take the same amount of time:
    Code:
    # time perl test.pl
    ..................................................
    real    0m4.649s
    user    0m4.550s
    sys     0m0.016s
    # time /usr/local/bin/perl test.pl
    ..................................................
    real    0m4.614s
    user    0m4.589s
    sys     0m0.018s
    Between both my systems:
    Code:
    [~]# time perl test.pl
    ..................................................
    real    0m4.649s
    user    0m4.550s
    sys     0m0.016s
    
    [~]$ cat /proc/cpuinfo
    Intel(R) Xeon(R) CPU           X3320  @ 2.50GHz
    
    [~]# cat /etc/redhat-release
    CentOS release 5.2 (Final)
     
    [~]# perl -v
    This is perl, v5.8.8 built for i386-linux-thread-multi
    It's even worse on one of my other servers (OS/Perl version is the same):
    Code:
    [~]# time perl test.pl
    ..................................................
    real    0m14.677s
    user    0m14.599s
    sys     0m0.034s
    
    [~]$ cat /proc/cpuinfo
    AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
    
    If a bug is released and cPanel fixes their Perl install and needs a beta tester, I'll happily oblige :)

    I have a few perl-hungry sites, and while I don't know how this affects them quite yet, I'd like to know this won't be slowing them down.
     
    #4 orty, Aug 26, 2008
    Last edited: Aug 26, 2008
  5. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I forgot, when I initially posted, that /usr/bin/perl is replaced by our perl installer. Hence, this bug report is a non-issue if your Perl binaries were installed by the cPanel perl installer.

    Recall too that it only arises in programs that have heavy dependence upon overload and bless and uses the RedHat specific Perl install.
     
  7. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Running time /usr/bin/perl test.pl gives me (roughly) the same timing as just perl or /usr/local/bin/perl. How can I tell if it's from the cPanel perl installer (I know it was on my last server, as I installed it to upgrade to 5.8.8, but I have no idea if that's the case on this server as it already had 5.8.8 installed). I'm wary about reinstalling perl as last time I did that it bulldozed some Perl libraries I needed and had to reinstall all of them.
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Check the output of perl -V, specifically the 'Compiled at' portion. There are probably other indicators in that output, but will need to compare what RedHat's perl -V reports.
     
  9. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Running perl -v on the various perl binaries on my system (which I think are all just symlinked) are:
    Code:
    This is perl, v5.8.8 built for i386-linux-thread-multi
    
    So is that cPanel or is that CentOS? If it's CentOS, I'll upgrade using these directions, but would like to avoid if possible
     
  10. QuetzlcoatlBlue

    QuetzlcoatlBlue Registered

    Joined:
    Nov 1, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    orty: Try perl -V <-capital 'V'

    I'll likely be rebuilding a centos 5.2 box and doing a fresh cpanel installation today to compare the perl issue.


    Also, cpanelkenneth:

    Your initial directions indicated us to try the binary located at:

    /usr/local/bin/perl

    however this is just a link to /usr/bin/perl
    #cat /etc/redhat-release
    CentOS release 5.2 (Final)
    # ls -l /usr/local/bin/perl
    lrwxrwxrwx 1 root root 13 May 28 15:37 /usr/local/bin/perl -> /usr/bin/perl

    I picked apart the instructions here http://faq.cpanel.net/show.cgi?qa=118735939001134 and the files in /scripts/ - as far as I see perl is grabbed directly from cpanel. Do you know if cpanel simply uses RH's src rpm, or do they get perl directly from say, CPAN?
     
  11. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Ah...didn't know there was a difference between the capital and lower-case "V", but after running it, good golly there sure is :)

    Looks like both servers are using the CentOS perl, based on this:
    Code:
     perl -V
    Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
      Platform:
        osname=linux, osvers=2.6.9-42.0.3.elsmp, archname=i386-linux-thread-multi
        uname='linux builder6.centos.org 2.6.9-42.0.3.elsmp #1 smp fri oct 6 06:28:26 cdt 2006 i686 athlon i386 gnulinux '
        config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Dversion=5.8.8 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -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=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dinc_version_list=5.8.7 5.8.6 5.8.5 -Dscriptdir=/usr/bin'
        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 -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
        optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables',
        cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/include/gdbm'
        ccversion='', gccversion='4.1.1 20070105 (Red Hat 4.1.1-52)', 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.5.so, so=so, useshrplib=true, libperl=libperl.so
        gnulibc_version='2.5'
      Dynamic Linking:
        dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE'
        cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib'
    
    
    Characteristics of this binary (from libperl):
      Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
                            PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES
                            USE_PERLIO USE_REENTRANT_API
      Built under linux
      Compiled at Nov  8 2007 06:49:16
      @INC:
        /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
        /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
        /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
        /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
        /usr/lib/perl5/site_perl/5.8.8
        /usr/lib/perl5/site_perl/5.8.7
        /usr/lib/perl5/site_perl/5.8.6
        /usr/lib/perl5/site_perl/5.8.5
        /usr/lib/perl5/site_perl
        /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
        /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
        /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
        /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
        /usr/lib/perl5/vendor_perl/5.8.8
        /usr/lib/perl5/vendor_perl/5.8.7
        /usr/lib/perl5/vendor_perl/5.8.6
        /usr/lib/perl5/vendor_perl/5.8.5
        /usr/lib/perl5/vendor_perl
        /usr/lib/perl5/5.8.8/i386-linux-thread-multi
        /usr/lib/perl5/5.8.8
        .
    
    I'll reinstall Perl using the cPanel distro and try again -- will report back later.
     
  12. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The Perl installer does not use the RedHat Source RPM. We use a tarball direct from perl.org.
     
  13. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    OK, looks like building Perl using cPanel's method appears to work fine and run much faster:

    Code:
    # time perl test.pl
    ..................................................
    real    0m0.087s
    user    0m0.079s
    sys     0m0.008s
    I ran a perl -V, and noticed that the @INC was much shorter than before:
    Code:
    @INC:
        /usr/lib/perl5/5.8.8/i686-linux
        /usr/lib/perl5/5.8.8
        /usr/lib/perl5/site_perl/5.8.8/i686-linux
        /usr/lib/perl5/site_perl/5.8.8
        /usr/lib/perl5/site_perl/5.8.7
        /usr/lib/perl5/site_perl/5.8.6
        /usr/lib/perl5/site_perl/5.8.5
        /usr/lib/perl5/site_perl
        .
    It appears that the vendor_perl/* and the 5.8.8/* directories are not included anymore. Is that normal? I just want to make sure all those Libraries I reinstalled with the snapshot bundle are going to get included properly.
     
Loading...

Share This Page