/usr/lib/dld.sl: Unresolved symbol - HP UX

This is a discussion on /usr/lib/dld.sl: Unresolved symbol - HP UX ; I am trying to port a Perl script that uses a MySQL database to an HP- UX server. I've installed Perl (v5.6.1 built for PA-RISC2.0), and MySql (Server version: 5.0.51a MySQL Community Server (GPL)). I've also installed the Perl module ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: /usr/lib/dld.sl: Unresolved symbol

  1. /usr/lib/dld.sl: Unresolved symbol

    I am trying to port a Perl script that uses a MySQL database to an HP-
    UX server. I've installed Perl (v5.6.1 built for PA-RISC2.0), and
    MySql (Server version: 5.0.51a MySQL Community Server (GPL)). I've
    also installed the Perl module DBD-mysql-4.007. When the script tries
    to connect to the database (DBI->connect($DSN, $DBUSER, $DBPW)), I get
    this output:

    /usr/lib/dld.sl: Unresolved symbol: mysql_init (code) from /opt/
    perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl

    Googling, I find lots of people running lots of scripts (not just
    Perl) who get similar messages for lots of different symbols, but I
    can't find a solution that works. I've already tried setting both
    LD_LIBRARY_PATH=/opt/mysql/lib and LD_PRELOAD=/opt/mysql/lib, to no
    avail. Running /opt/mysql/bin/mysql works, even without those being
    set.

    Can anyone help? Thanks!

    P.S. Running uname -a returns this:

    HP-UX hqhpubu8 B.11.11 U 9000/800 1563736587 unlimited-user license


  2. Re: /usr/lib/dld.sl: Unresolved symbol

    samwyse wrote:
    > /usr/lib/dld.sl: Unresolved symbol: mysql_init (code)
    > /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl


    Where is mysql_init defined? That shlib needs to be linked into your
    application (perl)

    > Googling, I find lots of people running lots of scripts (not just
    > Perl) who get similar messages for lots of different symbols


    Only that exact message for mysql_init is valid:
    http://forums.itrc.hp.com/service/fo...threadId=46251
    (But no solution.)

    > but I can't find a solution that works.


    You need to find the shlib with the definition:
    nm -pxAN paths-to-shlibs | grep mysql_init

  3. Re: /usr/lib/dld.sl: Unresolved symbol

    On Jul 9, 12:47*am, Dennis Handly wrote:
    > samwyse wrote:
    > > /usr/lib/dld.sl: Unresolved symbol: mysql_init (code)
    > > /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl

    >
    > Where is mysql_init defined? *That shlib needs to be linked into your
    > application (perl)
    >
    > > Googling, I find lots of people running lots of scripts (not just
    > > Perl) who get similar messages for lots of different symbols

    >
    > Only that exact message for mysql_init is valid:http://forums.itrc.hp.com/service/fo....do?threadId=4...
    > (But no solution.)


    Yeah, I found that one. Then I searched for variations and found
    people with the same problem loading Oracle into PHP, etc.

    > > but I can't find a solution that works.

    >
    > You need to find the shlib with the definition:
    > nm -pxAN paths-to-shlibs | grep mysql_init


    Well, Perl dynamically loads the DBD interface module without
    problems:

    hqhpubu8:> nm -pxAN /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/
    DBD/mysql/mysql.sl | grep mysql_init
    /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl:
    0x0000a0f8 T mysql_init
    /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl:
    0x00000000 U mysql_init

    But it looks like this isn't being found, despite being told the path:

    hqhpubu8:> nm -pxAN $LD_LIBRARY_PATH /libmysqlclient.sl | grep
    mysql_init
    /opt/mysql/lib/libmysqlclient.sl:0x00038628 T mysql_init
    /opt/mysql/lib/libmysqlclient.sl:0x00086408 T
    mysql_init_character_set
    /opt/mysql/lib/libmysqlclient.sl:0x00086100 T
    mysql_init_character_set
    /opt/mysql/lib/libmysqlclient.sl:0x00085fb0 T mysql_init
    /opt/mysql/lib/libmysqlclient.sl:0x00085fe0 T mysql_init
    /opt/mysql/lib/libmysqlclient.sl:0x00086178 T
    mysql_init_character_set
    /opt/mysql/lib/libmysqlclient.sl:0x000875f8 T mysql_init

  4. Re: /usr/lib/dld.sl: Unresolved symbol

    samwyse wrote:
    > Perl dynamically loads the DBD interface module without problems:


    Does it call them?

    > hqhpubu8:> nm -pxAN /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/
    > DBD/mysql/mysql.sl | grep mysql_init
    > mysql.sl: T mysql_init
    > mysql.sl: U mysql_init


    These are unsats and not definitions.

    > But it looks like this isn't being found, despite being told the path:
    > hqhpubu8:> nm -pxAN $LD_LIBRARY_PATH /libmysqlclient.sl | grep mysql_init
    > /opt/mysql/lib/libmysqlclient.sl:0x00038628 T mysql_init
    > /opt/mysql/lib/libmysqlclient.sl:0x00085fb0 T mysql_init
    > /opt/mysql/lib/libmysqlclient.sl:0x00085fe0 T mysql_init
    > /opt/mysql/lib/libmysqlclient.sl:0x000875f8 T mysql_init


    These won't be found. You must load this shlib either before or with
    your mysql.sl. It indicates your shlib is broken or isn't made for easy
    use.

    But to be sure you need to use the correct shlib tool:
    odump -slexport /opt/mysql/lib/libmysqlclient.sl | grep grep mysql_init

    What does "chatr .../mysql.sl" show?

  5. Re: /usr/lib/dld.sl: Unresolved symbol

    On Jul 10, 1:20*am, Dennis Handly wrote:
    > samwyse wrote:
    > > Perl dynamically loads the DBD interface module without problems:

    >
    > Does it call them?
    >
    > > hqhpubu8:> nm -pxAN /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/
    > > DBD/mysql/mysql.sl | grep mysql_init
    > > mysql.sl: T *mysql_init
    > > mysql.sl: U *mysql_init

    >
    > These are unsats and not definitions.
    >
    > > But it looks like this isn't being found, despite being told the path:
    > > hqhpubu8:> nm -pxAN $LD_LIBRARY_PATH /libmysqlclient.sl | grep mysql_init
    > > /opt/mysql/lib/libmysqlclient.sl:0x00038628 T *mysql_init
    > > /opt/mysql/lib/libmysqlclient.sl:0x00085fb0 T *mysql_init
    > > /opt/mysql/lib/libmysqlclient.sl:0x00085fe0 T *mysql_init
    > > /opt/mysql/lib/libmysqlclient.sl:0x000875f8 T *mysql_init

    >
    > These won't be found. *You must load this shlib either before or with
    > your mysql.sl. *It indicates your shlib is broken or isn't made for easy
    > use.


    I need to check, but I think that the binaries were downloaded from
    the HP porting centre. Yeah, that's no guarantee of correctness.

    > But to be sure you need to use the correct shlib tool:
    > odump -slexport /opt/mysql/lib/libmysqlclient.sl | grep grep mysql_init
    >
    > What does "chatr .../mysql.sl" show?


    hqhpubu8:> odump -slexport /opt/mysql/lib/libmysqlclient.sl | grep
    mysql_init
    000000886 -00000001 00113 0x00086100 Code 000000,155 00
    mysql_init_character_set
    000001100 000000665 00113 0x00085fb0 Code 000000,155 00 mysql_init

    hqhpubu8:> chatr /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/
    mysql/mysql.sl
    /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl:
    shared library
    shared library dynamic path search:
    SHLIB_PATH disabled second
    embedded path disabled first Not Defined
    shared vtable support disabled
    explicit unloading enabled
    static branch prediction disabled
    executable from stack: D (default)
    kernel assisted branch prediction enabled
    lazy swap allocation disabled
    text segment locking disabled
    data segment locking disabled
    third quadrant private data space disabled
    fourth quadrant private data space disabled
    third quadrant global data space disabled
    data page size: D (default)
    instruction page size: D (default)
    nulptr references disabled
    shared library private mapping disabled

    BTW, thanks again for all the help. I really appreciate it. As I
    said, there have been lots of people with similar problems who have
    never gotten this far.

  6. Re: /usr/lib/dld.sl: Unresolved symbol

    On Jul 10, 9:57*am, samwyse wrote:
    > On Jul 10, 1:20*am, Dennis Handly wrote:


    > > These won't be found. *You must load this shlib either before or with
    > > your mysql.sl. *It indicates your shlib is broken or isn't made for easy
    > > use.

    >
    > I need to check, but I think that the binaries were downloaded from
    > the HP porting centre. *Yeah, that's no guarantee of correctness.


    OK, the installed versions of Perl and MySql were originally
    downloaded from the Porting And Archive Centre for HP-UX, but the DBD
    was compiled by hand. So, we're revisiting that.

    As an aside, here's an amusing story. One of the other admins was
    very excited this morning; he'd been able to find someone who had the
    same problem that we're having, and there was a lot more information
    available than he'd seen posted anywhere else. "Great," I said, "Show
    me what they've got." I looked at what he'd found, and then pointed
    to some console output that had been copied and pasted. Had he
    noticed anything odd about their server's hostname? Yes, he'd found
    this very thread.

  7. Re: /usr/lib/dld.sl: Unresolved symbol

    samwyse wrote:
    > hqhpubu8:> odump -slexport /opt/mysql/lib/libmysqlclient.sl | grep mysql_init
    > 000001100 000000665 00113 0x00085fb0 Code 000000,155 00 mysql_init


    So the symbol is being exported for use.

    > hqhpubu8:> chatr /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl
    > shared library dynamic path search:
    > SHLIB_PATH disabled second
    > embedded path disabled first Not Defined


    This shlib should really have libmysqlclient.sl as a dependent shlib and
    then everything should be happy.

    > there have been lots of people with similar problems who have
    > never gotten this far.


    Well, you're the first to mention libmysqlclient.sl. I would have
    thought it was obvious you had to have that, even if I didn't know the name.

  8. Re: /usr/lib/dld.sl: Unresolved symbol

    On Jul 10, 10:04*pm, Dennis Handly wrote:
    > samwyse wrote:
    > > hqhpubu8:> odump -slexport /opt/mysql/lib/libmysqlclient.sl | grep mysql_init
    > > 000001100 000000665 *00113 0x00085fb0 *Code *000000,155 *00 mysql_init

    >
    > So the symbol is being exported for use.
    >
    > > hqhpubu8:> chatr /opt/perlmod/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/mysql/mysql.sl
    > > * * * * *shared library dynamic path search:
    > > * * * * * * *SHLIB_PATH * * disabled *second
    > > * * * * * * *embedded path *disabled *first *Not Defined

    >
    > This shlib should really have libmysqlclient.sl as a dependent shlib and
    > then everything should be happy.


    Thanks! I'll see if I can figure out where things went wrong and get
    them fixed.

    > > there have been lots of people with similar problems who have
    > > never gotten this far.

    >
    > Well, you're the first to mention libmysqlclient.sl. *I would have
    > thought it was obvious you had to have that, even if I didn't know the name.


    I suspect that what isn't obvious is how to get the pointer to
    libmysqlclient.sl embedded into the DBD module. The supplied makefile
    doesn't seem to know to do it.

    By "lots of people with similar problems", I mean that if you look at
    http://www.google.com/search?q=/usr/...esolved+symbol then
    you see about 3500 results. A few mention rs6000 (so I assume that
    the same issue can occur under AIX), but the majority seem to be for
    HP-UX. Besides Perl and MySQL, I see people having this issue with
    Apache, PHP, Oracle, crypto++, and more, so it looks like there are
    lots and lots of makefiles that don't know how to do it, either.
    While I didn't read all 3500 results, I did check multiple pages
    worth, and this is the first time I've seen the troubleshooting get
    this far; though maybe the previous times the problem solving switched
    to private email.

    Anyway, I'm overjoyed to have a solution. Thanks again for the effort
    you've put into this.

  9. Re: /usr/lib/dld.sl: Unresolved symbol

    samwyse wrote:
    >> This shlib should really have libmysqlclient.sl as a dependent shlib and
    >> then everything should be happy.

    >
    > I suspect that what isn't obvious is how to get the pointer to
    > libmysqlclient.sl embedded into the DBD module. The supplied makefile
    > doesn't seem to know to do it.


    It should be pretty simple: -L mysqlclient-path -lmysqlclient

    > By "lots of people with similar problems", I mean that if you look at
    > http://www.google.com/search?q=/usr/...esolved+symbol then
    > you see about 3500 results.


    You need to include mysql_init, then I see 7. And 42 with:
    dld + Unresolved + symbol + mysql_init

+ Reply to Thread