perl and db-module

Discussion in 'Perl Misc' started by Sebastian Diedrich, Jan 31, 2004.

  1. hi all,

    i have some problems with perl and the berkeley-db-module. when i
    start a perl-prog such as cyradm (cyrus-imap) or some other that uses
    the berkeley-db; perl throws this error:

    <---------------------------
    Can't load '/usr/lib/perl5/site_perl/5.6.1/i586-linux/auto/Cyrus/IMAP/IMAP.so'
    for module Cyrus::IMAP:
    /usr/lib/perl5/site_perl/5.6.1/i586-linux/auto/Cyrus/IMAP/IMAP.so:
    undefined symbol: db_version at
    /usr/lib/perl5/5.6.1/i586-linux/DynaLoader.pm line 206.
    at /usr/lib/perl5/site_perl/5.6.1/i586-linux/Cyrus/IMAP/Admin.pm line
    44
    Compilation failed in require at
    /usr/lib/perl5/site_perl/5.6.1/i586-linux/Cyrus/IMAP/Admin.pm line 44.
    BEGIN failed--compilation aborted at
    /usr/lib/perl5/site_perl/5.6.1/i586-linux/Cyrus/IMAP/Admin.pm line 44.
    Compilation failed in require at
    /usr/lib/perl5/site_perl/5.6.1/i586-linux/Cyrus/IMAP/Shell.pm line 60.
    BEGIN failed--compilation aborted at
    /usr/lib/perl5/site_perl/5.6.1/i586-linux/Cyrus/IMAP/Shell.pm line 60.
    Compilation failed in require.
    BEGIN failed--compilation aborted.
    ---------------------------->

    i' m on an suse 7.3 box with berkeley 3.1 and perl. 5.0.6.1 (revision
    5.0 version 6 subversion 1). db_file is version is 1.807 (detected
    with: perl -e 'use DB_File; print "DB_File ver $DB_File::VERSION\n"').
    have anyone an idea how to solve this problem?

    thanx in advance

    cya
    sebastian
     
    Sebastian Diedrich, Jan 31, 2004
    #1
    1. Advertising

  2. Sebastian Diedrich

    Ben Morrow Guest

    (Sebastian Diedrich) wrote:
    > i have some problems with perl and the berkeley-db-module. when i
    > start a perl-prog such as cyradm (cyrus-imap) or some other that uses
    > the berkeley-db; perl throws this error:
    >
    > <---------------------------
    > Can't load '/usr/lib/perl5/site_perl/5.6.1/i586-linux/auto/Cyrus/IMAP/IMAP.so'
    > for module Cyrus::IMAP:
    > /usr/lib/perl5/site_perl/5.6.1/i586-linux/auto/Cyrus/IMAP/IMAP.so:
    > undefined symbol: db_version at

    <snip>
    >
    > i' m on an suse 7.3 box with berkeley 3.1 and perl. 5.0.6.1 (revision
    > 5.0 version 6 subversion 1).


    That's odd... perl -v does indeed say 'revision 5.0 version...'.
    This is referred to as perl 5.6.1.

    > db_file is version is 1.807 (detected
    > with: perl -e 'use DB_File; print "DB_File ver $DB_File::VERSION\n"').


    If you can load DB_File then that is not your problem. Try
    reinstalling the Cyrus::IMAP module.

    Ben

    --
    Razors pain you / Rivers are damp
    Acids stain you / And drugs cause cramp. [Dorothy Parker]
    Guns aren't lawful / Nooses give
    Gas smells awful / You might as well live.
     
    Ben Morrow, Jan 31, 2004
    #2
    1. Advertising

  3. Sebastian Diedrich

    Dan Bent Guest

    non existent <> wrote in message news:<>...
    > On Sat, 31 Jan 2004 03:15:08 -0800, Sebastian Diedrich wrote:
    >
    > > i have some problems with perl and the berkeley-db-module. when i start
    > > a perl-prog such as cyradm (cyrus-imap) or some other that uses the
    > > berkeley-db; perl throws this error:
    > >
    > > <---------------------------
    > > Can't load
    > > '/usr/lib/perl5/site_perl/5.6.1/i586-linux/auto/Cyrus/IMAP/IMAP.so' for
    > > module Cyrus::IMAP:

    >
    > I hardly know how to spell perl but in regards to a complied from source
    > cyrus-imapd that was installed in the default /usr/local location I was
    > able to: 'export
    > PERL5LIB=/usr/local/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi'
    > thereby adding this path to perl's @INC and working around the problem. If
    > your cyrus_imapd is installed in /usr/local, and not /usr adjust the
    > example for your paths.
    >
    > Chris


    I am also perl impaired. I'm having the same problem on FreeBSD
    5.1-RELEASE, and perl 5.8.3. I tried the solution above (at least I
    think I did - I exported the environment variable, adjusted to match
    my system, and ran cyradm. I didn't compile anything with the
    environment variable set), but got the same result. There's a comment
    near line 229 in DynaLoader.pm:

    # Many dynamic extension loading problems will appear to come from
    # this section of code: XYZ failed at line 123 of DynaLoader.pm.
    # Often these errors are actually occurring in the initialisation
    # C code of the extension XS file. Perl reports the error as being
    # in this perl code simply because this was the last perl code
    # it executed.

    Sorry I'm no help, but I'd like to learn the solution, myself.
     
    Dan Bent, Feb 13, 2004
    #3
  4. Sebastian Diedrich

    Ben Morrow Guest

    (Dan Bent) wrote:
    > non existent <> wrote in message news:<>...
    > >
    > > I hardly know how to spell perl but in regards to a complied from source
    > > cyrus-imapd that was installed in the default /usr/local location I was
    > > able to: 'export
    > > PERL5LIB=/usr/local/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi'
    > > thereby adding this path to perl's @INC and working around the
    > > problem.

    >
    > I am also perl impaired.


    An unfortunate state to be in, to be sure; but I believe it's curable :).

    > I'm having the same problem on FreeBSD 5.1-RELEASE, and perl
    > 5.8.3. I tried the solution above (at least I think I did - I
    > exported the environment variable, adjusted to match my system, and
    > ran cyradm. I didn't compile anything with the environment variable
    > set


    That shouldn't be necessary: if the compilation succeeded, it found
    everything it needed anyway.

    > ), but got the same result. There's a comment
    > near line 229 in DynaLoader.pm:
    >
    > # Many dynamic extension loading problems will appear to come from


    [ dynamic-extension loading-problems, but never mind... :) ]

    > # this section of code: XYZ failed at line 123 of DynaLoader.pm.
    > # Often these errors are actually occurring in the initialisation
    > # C code of the extension XS file. Perl reports the error as being
    > # in this perl code simply because this was the last perl code
    > # it executed.
    >
    > Sorry I'm no help, but I'd like to learn the solution, myself.


    Right, what was the *exact* error message you got? Usually it's
    something like (example taken from a module I'm working on at the
    moment)

    Can't load '.../auto/Hook/CallStack/CallStack.so' for module
    Hook::CallStack: .../auto/Hook/CallStack/CallStack.so: undefined
    symbol: SvSetSv_nosteal at .../DynaLoader.pm line 229.

    If it is like this, the name of the undefined symbol is a big clue as
    to where the problem lies.

    Ben

    --
    It will be seen that the Erwhonians are a meek and long-suffering people,
    easily led by the nose, and quick to offer up common sense at the shrine of
    logic, when a philosopher convinces them that their institutions are not based
    on the strictest morality. [Samuel Butler, paraphrased]
     
    Ben Morrow, Feb 13, 2004
    #4
  5. Sebastian Diedrich

    Dan Bent Guest

    <snip>
    > Right, what was the *exact* error message you got? Usually it's
    > something like (example taken from a module I'm working on at the
    > moment)
    >
    > Can't load '.../auto/Hook/CallStack/CallStack.so' for module
    > Hook::CallStack: .../auto/Hook/CallStack/CallStack.so: undefined
    > symbol: SvSetSv_nosteal at .../DynaLoader.pm line 229.
    >
    > If it is like this, the name of the undefined symbol is a big clue as
    > to where the problem lies.
    >
    > Ben

    Right on! Here's my error message.

    Can't load '/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/auto/Cyrus/IMAP/IMAP.so'
    for module Cyrus::IMAP:
    /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/auto/Cyrus/IMAP/IMAP.so:
    Undefined symbol "db_version" at
    /usr/local/lib/perl5/5.8.3/i386-freebsd/DynaLoader.pm line 229.
    at /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Admin.pm
    line 44
    Compilation failed in require at
    /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Admin.pm
    line 44.
    BEGIN failed--compilation aborted at
    /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Admin.pm
    line 44.
    Compilation failed in require at
    /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Shell.pm
    line 60.
    BEGIN failed--compilation aborted at
    /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Shell.pm
    line 60.
    Compilation failed in require.
    BEGIN failed--compilation aborted.

    I've been discussing this with a fellow who solved a similar problem
    on Suse 7.1. He says:
    i have de-installed berkeley 3.1 devel-packages (comes with suse
    standard-install). after that - cyradm runs fine. i think it was the
    additional installation of an different berkeley-version that course
    the problem. the devel-pkg make some sym-links for berkeley < 3.1 ->
    and that's the prob!

    So, we're clearly on the trail. I just need to learn how to identify,
    and un-install the offending berkeley db libraries. I installed
    Berkeley 4.2 earlier in this process, and I'm afraid I might break
    something if I am not careful.

    Thanks for your help in this, by the way. I have a Camel book (it's
    good read for a technical manual), and I'm learning about perl
     
    Dan Bent, Feb 13, 2004
    #5
  6. Sebastian Diedrich

    Ben Morrow Guest

    (Dan Bent) wrote:
    > Can't load '/.../auto/Cyrus/IMAP/IMAP.so' for module Cyrus::IMAP:
    > /.../auto/Cyrus/IMAP/IMAP.so: Undefined symbol "db_version" at
    > /.../DynaLoader.pm line 229.
    >
    > I've been discussing this with a fellow who solved a similar problem
    > on Suse 7.1. He says:
    > i have de-installed berkeley 3.1 devel-packages (comes with suse
    > standard-install). after that - cyradm runs fine. i think it was the
    > additional installation of an different berkeley-version that course
    > the problem. the devel-pkg make some sym-links for berkeley < 3.1 ->
    > and that's the prob!
    >
    > So, we're clearly on the trail. I just need to learn how to identify,
    > and un-install the offending berkeley db libraries. I installed
    > Berkeley 4.2 earlier in this process, and I'm afraid I might break
    > something if I am not careful.


    It certainly looks like the db libs are the problem... on my machine,
    I have 3 versions installed: libdb-1.so with no symbol db_version,
    libdb-3.2.so with db_version, libdb-4.0.so with db_version_4000, and a
    bunch of symlinks. The headers for db4 have

    #define db_version db_version_4000

    so I wonder if this may be part of your problem... What versions do
    you have installed, and what db_version symbols do they define (nm -D
    /usr/lib/libdb-1.so | grep db_version)? Also, which libs is IMAP.so
    trying to load (ldd /.../Cyrus/IMAP/IMAP.so | grep db)?

    I suspect that in your friend's case, IMAP.so was built against db <
    3.1 and thus it failed, whereas yours is built against db-3.*, and
    thus is looking for a db_version rather than a db_version_4000 symbol;
    the answer if this is the case is to rebuild IMAP.so against the
    currently installed libraries.

    Ben

    --
    If you put all the prophets, | You'd have so much more reason
    Mystics and saints | Than ever was born
    In one room together, | Out of all of the conflicts of time.
    |----------------+---------------| The Levellers, 'Believers'
     
    Ben Morrow, Feb 13, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mothra
    Replies:
    5
    Views:
    485
    Dennis Lee Bieber
    Apr 15, 2005
  2. Maric Michaud
    Replies:
    0
    Views:
    7,194
    Maric Michaud
    Jun 24, 2006
  3. Replies:
    2
    Views:
    519
    Paul Lalli
    Feb 6, 2006
  4. Replies:
    4
    Views:
    142
    Ted Zlatanov
    Feb 10, 2009
  5. Dilbert
    Replies:
    0
    Views:
    845
    Dilbert
    Nov 10, 2011
Loading...

Share This Page