Odd External Function Behavoir
Posted in 2010
A user had a C external function (soundex UDR) registered via EXTERNAL NAME pointing at a .so symlink; it loaded fine on one server but failed on an apparently identical one with "The C Language Module can't load ... reason: Cannot access library file". Both machines ran 32-bit IDS 10.00.UC9, so version/bitness was ruled out. The main suggestion was to check the ONCONFIG parameter DB_LIBRARY_PATH (not the LD_LIBRARY_PATH environment variable): if it is set, UDR/DataBlade shared libraries can only be loaded from the directories it lists, so the library's directory must be included. The poster never confirmed back, so no resolution is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Data Types & Schema Design, Versions, Editions & End-of-Life
I have a stored procedure that is defined as such:
create function cx_soundex(str lvarchar(32)) returning lvarchar(4) as outputEXTERNAL NAME "/path/BClibsoundex.so(cx_soundex)" LANGUAGE C;
I have 2 systems both using the same source code (diff confirms this). On one
system the function works exactly as expected, however on the other system I
get the following error:
16:09:53 Loading Module </path/BClibsoundex.so>
16:09:53 (13): The C Language Module </path/BClibsoundex.so> can't load
reason: Cannot access library file
16:09:53 (-1): ERROR: Loading Module </path/BClibsoundex.so>
So I do a ll:
ll /path/BClibsoundex.*
-r-xr-xr-x 1 bin bin 7318 Mar 22 16:11 /path/BClibsoundex.1
-rw-rw-r-- 1 wyzaj common 3386 Mar 22 16:11 /path/BClibsoundex.a
lrwxrwxrwx 1 wyzaj common 14 Mar 22 16:11 /path/BClibsoundex.so ->
BClibsoundex.1
Based on the above you'd think it would work, but clearly for whatever reason,
it doesn't. Thoughts? Is the load reason of "Cannot access library file"
referring to a library file other than the library itself? I didn't think you
could compile something in c that had includes to something it couldn't access
(but I know so painfully little about C).
Jonathon Wyza
CX & CBORD System Administrator
CX Programmer/Analyst
Administrative Computing
Bethel College
(574)-257-3381
AIM: Iamwyza
jonathon.wyza@bethelcollege.edu<mailto:jonathon.wyza@bethelcollege.edu>
==========================
SLES 10 SP2 & IDS 10.0 HC9
" I would love to change the world, but they won't give me the source code."
-- Unknown
Are both the same version of Informix? Are they both 32bit or both 64bit
engine versions?
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Mon, Mar 22, 2010 at 4:27 PM, Wyza, Jonathon <wyzaj@bethelcollege.edu>wrote:
> I have a stored procedure that is defined as such:
>
> create function cx_soundex(str lvarchar(32)) returning lvarchar(4) as> output
> EXTERNAL NAME "/path/BClibsoundex.so(cx_soundex)" LANGUAGE C;
>
> I have 2 systems both using the same source code (diff confirms this). On
> one
> system the function works exactly as expected, however on the other system
> I
> get the following error:
>
> 16:09:53 Loading Module </path/BClibsoundex.so>
> 16:09:53 (13): The C Language Module </path/BClibsoundex.so> can't load
>
> reason: Cannot access library file
> 16:09:53 (-1): ERROR: Loading Module </path/BClibsoundex.so>
>
> So I do a ll:
>
> ll /path/BClibsoundex.*
> -r-xr-xr-x 1 bin bin 7318 Mar 22 16:11 /path/BClibsoundex.1
> -rw-rw-r-- 1 wyzaj common 3386 Mar 22 16:11 /path/BClibsoundex.a
> lrwxrwxrwx 1 wyzaj common 14 Mar 22 16:11 /path/BClibsoundex.so ->
> BClibsoundex.1
>
> Based on the above you'd think it would work, but clearly for whatever
> reason,
> it doesn't. Thoughts? Is the load reason of "Cannot access library file"
> referring to a library file other than the library itself? I didn't think
> you
> could compile something in c that had includes to something it couldn't
> access
> (but I know so painfully little about C).
>
> Jonathon Wyza
> CX & CBORD System Administrator
> CX Programmer/Analyst
> Administrative Computing
> Bethel College
> (574)-257-3381
> AIM: Iamwyza
> jonathon.wyza@bethelcollege.edu<mailto:jonathon.wyza@bethelcollege.edu>
> ==========================
> SLES 10 SP2 & IDS 10.0 HC9
>
> " I would love to change the world, but they won't give me the source
> code."
> -- Unknown
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001517447a428e9cc504826bcfa6
Both 32 bit, both 10.00.UC9.
Jonathon Wyza
CX & CBORD System Administrator
CX Programmer/Analyst
Administrative Computing
Bethel College
(574)-257-3381
AIM: Iamwyza
jonathon.wyza@bethelcollege.edu
=============================
SLES 10x32 SP2 & IDS 10.0 UC9
" I would love to change the world, but they won't give me the source code."
-- Unknown
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Art Kagel
Sent: Monday, March 22, 2010 7:11 PM
To: ids@iiug.org
Subject: Re: Odd External Function Behavoir [19381]
Are both the same version of Informix? Are they both 32bit or both 64bit
engine versions?
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Mon, Mar 22, 2010 at 4:27 PM, Wyza, Jonathon
<wyzaj@bethelcollege.edu>wrote:
> I have a stored procedure that is defined as such:
>
> create function cx_soundex(str lvarchar(32)) returning lvarchar(4) as> output
> EXTERNAL NAME "/path/BClibsoundex.so(cx_soundex)" LANGUAGE C;
>
> I have 2 systems both using the same source code (diff confirms this). On
> one
> system the function works exactly as expected, however on the other system
> I
> get the following error:
>
> 16:09:53 Loading Module </path/BClibsoundex.so>
> 16:09:53 (13): The C Language Module </path/BClibsoundex.so> can't load
>
> reason: Cannot access library file
> 16:09:53 (-1): ERROR: Loading Module </path/BClibsoundex.so>
>
> So I do a ll:
>
> ll /path/BClibsoundex.*
> -r-xr-xr-x 1 bin bin 7318 Mar 22 16:11 /path/BClibsoundex.1
> -rw-rw-r-- 1 wyzaj common 3386 Mar 22 16:11 /path/BClibsoundex.a
> lrwxrwxrwx 1 wyzaj common 14 Mar 22 16:11 /path/BClibsoundex.so ->
> BClibsoundex.1
>
> Based on the above you'd think it would work, but clearly for whatever
> reason,
> it doesn't. Thoughts? Is the load reason of "Cannot access library file"
> referring to a library file other than the library itself? I didn't think
> you
> could compile something in c that had includes to something it couldn't
> access
> (but I know so painfully little about C).
>
> Jonathon Wyza
> CX & CBORD System Administrator
> CX Programmer/Analyst
> Administrative Computing
> Bethel College
> (574)-257-3381
> AIM: Iamwyza
> jonathon.wyza@bethelcollege.edu<mailto:jonathon.wyza@bethelcollege.edu>
> ==========================
> SLES 10 SP2 & IDS 10.0 HC9
>
> " I would love to change the world, but they won't give me the source
> code."
> -- Unknown
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001517447a428e9cc504826bcfa6
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Did you check you DL_LIBRARY_PATH to make sure you
can load libraries from the directories.
# DB_LIBRARY_PATH - Specifies the locations, separated
# by commas, from which IDS can use
# UDR or UDT shared libraries. If set,
# make sure that all directories containing
# the blade modules are listed, to
# ensure all DataBlade modules will
# work.
John F. Miller III
STSM, Support Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)
ids-bounces@iiug.org wrote on 03/22/2010 04:55:15 PM:
> Both 32 bit, both 10.00.UC9.
>
> Jonathon Wyza
> CX & CBORD System Administrator
> CX Programmer/Analyst
> Administrative Computing
> Bethel College
> (574)-257-3381
> AIM: Iamwyza
> jonathon.wyza@bethelcollege.edu
> =============================
> SLES 10x32 SP2 & IDS 10.0 UC9
>
> " I would love to change the world, but they won't give me the source
code."
> -- Unknown
>
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Art
> Kagel
> Sent: Monday, March 22, 2010 7:11 PM
> To: ids@iiug.org
> Subject: Re: Odd External Function Behavoir [19381]
>
> Are both the same version of Informix? Are they both 32bit or both 64bit
> engine versions?
>
> Art
>
> Art S. Kagel
> Advanced DataTools (www.advancedatatools.com)
> IIUG Board of Directors (art@iiug.org)
>
> See you at the 2010 IIUG Informix Conference
> April 25-28, 2010
> Overland Park (Kansas City), KS
> www.iiug.org/conf
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
and
> do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other
> organization with which I am associated either explicitly, implicitly, or
by
> inference. Neither do those opinions reflect those of other individuals
> affiliated with any entity with which I am affiliated nor those of the
> entities themselves.
>
> On Mon, Mar 22, 2010 at 4:27 PM, Wyza, Jonathon
> <wyzaj@bethelcollege.edu>wrote:
>
> > I have a stored procedure that is defined as such:
> >
> > create function cx_soundex(str lvarchar(32)) returning lvarchar(4) as> > output
> > EXTERNAL NAME "/path/BClibsoundex.so(cx_soundex)" LANGUAGE C;
> >
> > I have 2 systems both using the same source code (diff confirms this).
On
> > one
> > system the function works exactly as expected, however on the other
system
> > I
> > get the following error:
> >
> > 16:09:53 Loading Module </path/BClibsoundex.so>
> > 16:09:53 (13): The C Language Module </path/BClibsoundex.so> can't load
> >
> > reason: Cannot access library file
> > 16:09:53 (-1): ERROR: Loading Module </path/BClibsoundex.so>
> >
> > So I do a ll:
> >
> > ll /path/BClibsoundex.*
> > -r-xr-xr-x 1 bin bin 7318 Mar 22 16:11 /path/BClibsoundex.1
> > -rw-rw-r-- 1 wyzaj common 3386 Mar 22 16:11 /path/BClibsoundex.a
> > lrwxrwxrwx 1 wyzaj common 14 Mar 22 16:11 /path/BClibsoundex.so ->
> > BClibsoundex.1
> >
> > Based on the above you'd think it would work, but clearly for whatever
> > reason,
> > it doesn't. Thoughts? Is the load reason of "Cannot access library
file"
> > referring to a library file other than the library itself? I didn't
think
> > you
> > could compile something in c that had includes to something it couldn't
> > access
> > (but I know so painfully little about C).
> >
> > Jonathon Wyza
> > CX & CBORD System Administrator
> > CX Programmer/Analyst
> > Administrative Computing
> > Bethel College
> > (574)-257-3381
> > AIM: Iamwyza
> > jonathon.wyza@bethelcollege.edu<mailto:jonathon.wyza@bethelcollege.edu>
> > ==========================
> > SLES 10 SP2 & IDS 10.0 HC9
> >
> > " I would love to change the world, but they won't give me the source
> > code."
> > -- Unknown
> >
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --001517447a428e9cc504826bcfa6
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
You used 2 variables there:
DL_LIBRARY_PATH
DB_LIBRARY_PATH
And did you really mean LD_LIBRARY_PATH?
Jonathon Wyza
CX & CBORD System Administrator
CX Programmer/Analyst
Administrative Computing
Bethel College
(574)-257-3381
AIM: Iamwyza
jonathon.wyza@bethelcollege.edu
==============================
SLES 10x32 SP2 & IDS 10.00.UC9
" I would love to change the world, but they won't give me the source code."
-- Unknown
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of John
Miller iii
Sent: Monday, March 22, 2010 8:17 PM
To: ids@iiug.org
Subject: RE: Odd External Function Behavoir [19383]
Did you check you DL_LIBRARY_PATH to make sure you
can load libraries from the directories.
# DB_LIBRARY_PATH - Specifies the locations, separated
# by commas, from which IDS can use
# UDR or UDT shared libraries. If set,
# make sure that all directories containing
# the blade modules are listed, to
# ensure all DataBlade modules will
# work.
John F. Miller III
STSM, Support Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)
ids-bounces@iiug.org wrote on 03/22/2010 04:55:15 PM:
> Both 32 bit, both 10.00.UC9.
>
> Jonathon Wyza
> CX & CBORD System Administrator
> CX Programmer/Analyst
> Administrative Computing
> Bethel College
> (574)-257-3381
> AIM: Iamwyza
> jonathon.wyza@bethelcollege.edu
> =============================
> SLES 10x32 SP2 & IDS 10.0 UC9
>
> " I would love to change the world, but they won't give me the source
code."
> -- Unknown
>
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Art
> Kagel
> Sent: Monday, March 22, 2010 7:11 PM
> To: ids@iiug.org
> Subject: Re: Odd External Function Behavoir [19381]
>
> Are both the same version of Informix? Are they both 32bit or both 64bit
> engine versions?
>
> Art
>
> Art S. Kagel
> Advanced DataTools (www.advancedatatools.com)
> IIUG Board of Directors (art@iiug.org)
>
> See you at the 2010 IIUG Informix Conference
> April 25-28, 2010
> Overland Park (Kansas City), KS
> www.iiug.org/conf
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
and
> do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other
> organization with which I am associated either explicitly, implicitly, or
by
> inference. Neither do those opinions reflect those of other individuals
> affiliated with any entity with which I am affiliated nor those of the
> entities themselves.
>
> On Mon, Mar 22, 2010 at 4:27 PM, Wyza, Jonathon
> <wyzaj@bethelcollege.edu>wrote:
>
> > I have a stored procedure that is defined as such:
> >
> > create function cx_soundex(str lvarchar(32)) returning lvarchar(4) as> > output
> > EXTERNAL NAME "/path/BClibsoundex.so(cx_soundex)" LANGUAGE C;
> >
> > I have 2 systems both using the same source code (diff confirms this).
On
> > one
> > system the function works exactly as expected, however on the other
system
> > I
> > get the following error:
> >
> > 16:09:53 Loading Module </path/BClibsoundex.so>
> > 16:09:53 (13): The C Language Module </path/BClibsoundex.so> can't load
> >
> > reason: Cannot access library file
> > 16:09:53 (-1): ERROR: Loading Module </path/BClibsoundex.so>
> >
> > So I do a ll:
> >
> > ll /path/BClibsoundex.*
> > -r-xr-xr-x 1 bin bin 7318 Mar 22 16:11 /path/BClibsoundex.1
> > -rw-rw-r-- 1 wyzaj common 3386 Mar 22 16:11 /path/BClibsoundex.a
> > lrwxrwxrwx 1 wyzaj common 14 Mar 22 16:11 /path/BClibsoundex.so ->
> > BClibsoundex.1
> >
> > Based on the above you'd think it would work, but clearly for whatever
> > reason,
> > it doesn't. Thoughts? Is the load reason of "Cannot access library
file"
> > referring to a library file other than the library itself? I didn't
think
> > you
> > could compile something in c that had includes to something it couldn't
> > access
> > (but I know so painfully little about C).
> >
> > Jonathon Wyza
> > CX & CBORD System Administrator
> > CX Programmer/Analyst
> > Administrative Computing
> > Bethel College
> > (574)-257-3381
> > AIM: Iamwyza
> > jonathon.wyza@bethelcollege.edu<mailto:jonathon.wyza@bethelcollege.edu>
> > ==========================
> > SLES 10 SP2 & IDS 10.0 HC9
> >
> > " I would love to change the world, but they won't give me the source
> > code."
> > -- Unknown
> >
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --001517447a428e9cc504826bcfa6
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
On Mon, Mar 22, 2010 at 17:20, Wyza, Jonathon <wyzaj@bethelcollege.edu>wrote:
> You used 2 variables there:
>
> DL_LIBRARY_PATH
> DB_LIBRARY_PATH
> And did you really mean LD_LIBRARY_PATH?
>
John was referring to the ONCONFIG parameter DB_LIBRARY_PATH, and not to the
environment variable LD_LIBRARY_PATH. The function of the two is similar
though (in some respects) - both identify where shared libraries can be
loaded from. However, DB_LIBRARY_PATH is restrictive - if it is specified,
then a datablade cannot be loaded unless it is in one of the directories on
DB_LIBRARY_PATH.
>
>
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of John
> Miller iii
> Sent: Monday, March 22, 2010 8:17 PM
> To: ids@iiug.org
> Subject: RE: Odd External Function Behavoir [19383]
>
> Did you check you DL_LIBRARY_PATH to make sure you
> can load libraries from the directories.
>
> # DB_LIBRARY_PATH - Specifies the locations, separated
> # by commas, from which IDS can use
> # UDR or UDT shared libraries. If set,
> # make sure that all directories containing
> # the blade modules are listed, to
> # ensure all DataBlade modules will
> # work.
>
> John F. Miller III
> STSM, Support Architect
> miller3@us.ibm.com
> 503-578-5645
> IBM Informix Dynamic Server (IDS)
>
> ids-bounces@iiug.org wrote on 03/22/2010 04:55:15 PM:
>
> > Both 32 bit, both 10.00.UC9.
> >
>
>
> >
> > -----Original Message-----
> > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> Art
>
> > Kagel
> > Sent: Monday, March 22, 2010 7:11 PM
> > To: ids@iiug.org
> > Subject: Re: Odd External Function Behavoir [19381]
> >
> > Are both the same version of Informix? Are they both 32bit or both 64bit
> > engine versions?
> >
>
>
> >
> > On Mon, Mar 22, 2010 at 4:27 PM, Wyza, Jonathon
> > <wyzaj@bethelcollege.edu>wrote:
> >
> > > I have a stored procedure that is defined as such:
> > >
> > > create function cx_soundex(str lvarchar(32)) returning lvarchar(4) as> > > output
> > > EXTERNAL NAME "/path/BClibsoundex.so(cx_soundex)" LANGUAGE C;
> > >
> > > I have 2 systems both using the same source code (diff confirms this).
> On
> > > one
> > > system the function works exactly as expected, however on the other
> system
> > > I
> > > get the following error:
> > >
> > > 16:09:53 Loading Module </path/BClibsoundex.so>
> > > 16:09:53 (13): The C Language Module </path/BClibsoundex.so> can't load
>
> > >
> > > reason: Cannot access library file
> > > 16:09:53 (-1): ERROR: Loading Module </path/BClibsoundex.so>
> > >
> > > So I do a ll:
> > >
> > > ll /path/BClibsoundex.*
> > > -r-xr-xr-x 1 bin bin 7318 Mar 22 16:11 /path/BClibsoundex.1
> > > -rw-rw-r-- 1 wyzaj common 3386 Mar 22 16:11 /path/BClibsoundex.a
> > > lrwxrwxrwx 1 wyzaj common 14 Mar 22 16:11 /path/BClibsoundex.so ->
> > > BClibsoundex.1
> > >
> > > Based on the above you'd think it would work, but clearly for whatever
> > > reason,
> > > it doesn't. Thoughts? Is the load reason of "Cannot access
> library file"
> > > referring to a library file other than the library itself? I
> didn't think
> > > you
> > > could compile something in c that had includes to something it couldn't
> > > access
> > > (but I know so painfully little about C).
>
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
--0016e6d3e9032085030482c1ab04