C Language UDR on RedHat
Posted in 2014
A first-time C UDR writer on Informix 12.10 / RHEL 6.3 built a simple getenv() shared library, registered it with CREATE FUNCTION ... EXTERNAL NAME '/tmp/igetenv.so(igetenv)', but execution failed with 'C Language Symbol <igetenv> not found in /tmp/igetenv.so', even though objdump showed the symbol exported. Suggestions included checking for C++ name mangling, but the actual cause was file permissions/ownership: the .so must be owned by user informix (in the informix group) and not world-writable, ideally under $INFORMIXDIR/extend. After chown'ing to informix with 775 permissions it worked; the misleading 'symbol not found' message had sent him chasing compile/link issues.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Data Types & Schema Design
Im making my first foray into C UDRs. Im using Informix 12.10 (c1) and
using Redhat 6.3.
As a test I decided to write a simple C routine that returns an environment
variable:
#include "dmi/mi.h"
#include "stdlib.h"
mi_lvarchar *igetenv(mi_lvarchar *str,MI_FPARAM *fparam)
{
mi_lvarchar *lvarch_out;
char *varname;
char *varvalue;
varname = mi_lvarchar_to_string(str);
varvalue = getenv(varname);
lvarch_out = mi_string_to_lvarchar(varvalue);
return (lvarch_out);
}
I compiled it with :
gcc I$INFOMRIXDIR/incl fPIC g c Wall DMI_SERVBUILD igetenv.c
and
gcc shared fPIC W1,--version-script=igetenv.exportlist o /tmp/igetenv.so
igetenv.o lc
I then registered it with:
CREATE FUNCTION sql_igetenv(lvarchar)RETURNS lvarchar
with (NOT VARIANT,PARALLELIZABLE)
EXTERNAL NAME "/tmp/igetenv.so(igetenv)"
LANGUAGE c;
And ran it with :
execute function sql_igetenv('INFORMIXDIR')
I get the error message:
Error: User Defined Routine (sql_igetenv) load failed. (State:S1000, Native
Code: FFFFD9BE)
And the log has the following:
13:52:09 ERROR: C Language Symbol <igetenv> (procid 513) not found in
</tmp/igetenv.so>
13:52:09 (-1): ERROR: Loading Routine <sql_igetenv> procid=513
If I use objdump I can see the routine is exported:
root:2:/home/rayb>objdump -T /tmp/igetenv.so
/tmp/igetenv.so: file format elf64-x86-64
DYNAMIC SYMBOL TABLE:
0000000000000428 l d .init 0000000000000000 .init
0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string
0000000000000000 w D *UND* 0000000000000000 __gmon_start__
0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize
0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv
0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar
000000000000055c g DF .text 0000000000000046 Base igetenv
Can anyone help with what I am missing here?
Sorry I forgot to include the export list. It looks like this: { global: igetenv; local: *; };
Permissions?
Sent from my iPad
> On Aug 20, 2014, at 9:00 PM, "RAY BURNS" <ray.burns@velocityglobal.co.nz>
wrote:
>
> I’m making my first foray into C UDR’s. I’m using Informix 12.10 (c1) and
> using Redhat 6.3.
>
> As a test I decided to write a simple C routine that returns an
environment
> variable:
>
> #include "dmi/mi.h"
> #include "stdlib.h"
>
> mi_lvarchar *igetenv(mi_lvarchar *str,MI_FPARAM *fparam)
> {
>
> mi_lvarchar *lvarch_out;
>
> char *varname;
>
> char *varvalue;
>
> varname = mi_lvarchar_to_string(str);
>
> varvalue = getenv(varname);
>
> lvarch_out = mi_string_to_lvarchar(varvalue);
>
> return (lvarch_out);
> }
>
> I compiled it with :
> gcc –I$INFOMRIXDIR/incl –fPIC –g –c –Wall –DMI_SERVBUILD igetenv.c
> and
> gcc –shared –fPIC –W1,--version-script=igetenv.exportlist
–o /tmp/igetenv.so
> igetenv.o –lc
>
> I then registered it with:
>
> CREATE FUNCTION sql_igetenv(lvarchar)> RETURNS lvarchar
> with (NOT VARIANT,PARALLELIZABLE)
> EXTERNAL NAME "/tmp/igetenv.so(igetenv)"
> LANGUAGE c;
>
> And ran it with :
>
> execute function sql_igetenv('INFORMIXDIR')>
> I get the error message:
>
> Error: User Defined Routine (sql_igetenv) load failed. (State:S1000,
Native
> Code: FFFFD9BE)
> And the log has the following:
> 13:52:09 ERROR: C Language Symbol <igetenv> (procid 513) not found in
> </tmp/igetenv.so>
> 13:52:09 (-1): ERROR: Loading Routine <sql_igetenv> procid=513
>
> If I use objdump I can see the routine is exported:
>
> root:2:/home/rayb>objdump -T /tmp/igetenv.so
>
> /tmp/igetenv.so: file format elf64-x86-64
>
> DYNAMIC SYMBOL TABLE:
> 0000000000000428 l d .init 0000000000000000 .init
> 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string
> 0000000000000000 w D *UND* 0000000000000000 __gmon_start__
> 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
> 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize
> 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv
> 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar
> 000000000000055c g DF .text 0000000000000046 Base igetenv
>
> Can anyone help with what I am missing here?
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
I think he said:
--------------------------------------
Permissions?
Sent from my iPad
> On Aug 20, 2014, at 9:00 PM, "RAY BURNS" <ray.burns@velocityglobal.co.nz>
wrote:
>
> Im making my first foray into C UDRs. Im using Informix 12.10 (c1) and
> using Redhat 6.3.
>
> As a test I decided to write a simple C routine that returns an
environment
> variable:
>
> #include "dmi/mi.h"
> #include "stdlib.h"
>
> mi_lvarchar *igetenv(mi_lvarchar *str,MI_FPARAM *fparam)
> {
>
> mi_lvarchar *lvarch_out;
>
> char *varname;
>
> char *varvalue;
>
> varname = mi_lvarchar_to_string(str);
>
> varvalue = getenv(varname);
>
> lvarch_out = mi_string_to_lvarchar(varvalue);
>
> return (lvarch_out);
> }
>
> I compiled it with :
> gcc I$INFOMRIXDIR/incl fPIC g c Wall DMI_SERVBUILD igetenv.c
> and
> gcc shared fPIC W1,--version-script=igetenv.exportlist
o /tmp/igetenv.so
> igetenv.o lc
>
> I then registered it with:
>
> CREATE FUNCTION sql_igetenv(lvarchar)> RETURNS lvarchar
> with (NOT VARIANT,PARALLELIZABLE)
> EXTERNAL NAME "/tmp/igetenv.so(igetenv)"
> LANGUAGE c;
>
> And ran it with :
>
> execute function sql_igetenv('INFORMIXDIR')>
> I get the error message:
>
> Error: User Defined Routine (sql_igetenv) load failed. (State:S1000,
Native
> Code: FFFFD9BE)
> And the log has the following:
> 13:52:09 ERROR: C Language Symbol <igetenv> (procid 513) not found in
> </tmp/igetenv.so>
> 13:52:09 (-1): ERROR: Loading Routine <sql_igetenv> procid=513
>
> If I use objdump I can see the routine is exported:
>
> root:2:/home/rayb>objdump -T /tmp/igetenv.so
>
> /tmp/igetenv.so: file format elf64-x86-64
>
> DYNAMIC SYMBOL TABLE:
> 0000000000000428 l d .init 0000000000000000 .init
> 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string
> 0000000000000000 w D *UND* 0000000000000000 __gmon_start__
> 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
> 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize
> 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv
> 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar
> 000000000000055c g DF .text 0000000000000046 Base igetenv
>
> Can anyone help with what I am missing here?
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
On Wed, Aug 20, 2014 at 7:49 PM, Madison Pruet <mpruet@us.ibm.com> wrote:
>
>
> Permissions?
>
> Sent from my iPad
>
> > On Aug 20, 2014, at 9:00 PM, "RAY BURNS" <ray.burns@velocityglobal.co.nz>
> wrote:
> >
> > I’m making my first foray into C UDR’s. I’m using Informix 12.10 (c1) and
> > using Redhat 6.3.
> >
> > As a test I decided to write a simple C routine that returns an
> environment
> > variable:
> >
> > #include "dmi/mi.h"
> > #include "stdlib.h"
> >
> > mi_lvarchar *igetenv(mi_lvarchar *str,MI_FPARAM *fparam)
> > {
> >
> > mi_lvarchar *lvarch_out;
> >
> > char *varname;
> >
> > char *varvalue;
> >
> > varname = mi_lvarchar_to_string(str);
> >
> > varvalue = getenv(varname);
> >
> > lvarch_out = mi_string_to_lvarchar(varvalue);
> >
> > return (lvarch_out);
> > }
> >
> > I compiled it with :
> > gcc –I$INFOMRIXDIR/incl –fPIC –g –c –Wall –DMI_SERVBUILD igetenv.c
> > and
> > gcc –shared –fPIC –W1,--version-script=igetenv.exportlist
> –o /tmp/igetenv.so
> > igetenv.o –lc
> >
> > I then registered it with:
> >
> > CREATE FUNCTION sql_igetenv(lvarchar)> > RETURNS lvarchar
> > with (NOT VARIANT,PARALLELIZABLE)
> > EXTERNAL NAME "/tmp/igetenv.so(igetenv)"
> > LANGUAGE c;
> >
> > And ran it with :
> >
> > execute function sql_igetenv('INFORMIXDIR')> >
> > I get the error message:
> >
> > Error: User Defined Routine (sql_igetenv) load failed. (State:S1000,
> Native
> > Code: FFFFD9BE)
> > And the log has the following:
> > 13:52:09 ERROR: C Language Symbol <igetenv> (procid 513) not found in
> > </tmp/igetenv.so>
> > 13:52:09 (-1): ERROR: Loading Routine <sql_igetenv> procid=513
> >
> > If I use objdump I can see the routine is exported:
> >
> > root:2:/home/rayb>objdump -T /tmp/igetenv.so
> >
> > /tmp/igetenv.so: file format elf64-x86-64
> >
> > DYNAMIC SYMBOL TABLE:
> > 0000000000000428 l d .init 0000000000000000 .init
> > 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string
> > 0000000000000000 w D *UND* 0000000000000000 __gmon_start__
> > 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
> > 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize
> > 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv
> > 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar
> > 000000000000055c g DF .text 0000000000000046 Base igetenv
> >
> > Can anyone help with what I am missing here?
> >
> >
> >
> *******************************************************************************
>
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2013.0521 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
--089e011825e6d67f2705011b36af
I don't think so. The error message in online.log is quite specific: 15:35:17 ERROR: C Language Symbol <igetenv> (procid 518) not found in </tmp/igetenv.so> 15:35:17 (-1): ERROR: Loading Routine <sql_igetenv> procid=518 I tried doing a grant execute on routine sql_igetenv to public and it did not make any difference.
Please post 'ls -l /tmp/igetenv.so' Sent from my iPad > On Aug 20, 2014, at 10:38 PM, "RAY BURNS" <ray.burns@velocityglobal.co.nz> wrote: > > I don't think so. The error message in online.log is quite specific: > > 15:35:17 ERROR: C Language Symbol <igetenv> (procid 518) not found in > </tmp/igetenv.so> > 15:35:17 (-1): ERROR: Loading Routine <sql_igetenv> procid=518 > > I tried doing a grant execute on routine sql_igetenv to public and it did not > make any difference. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >
Ray: Is it possible that the routine was compiled with the C++ compiler rather than the C compiler? Run nm against the shared library and make sure that the expected symbol igetenv is in there and wasn't mangled. Art On Aug 21, 2014 7:08 AM, "Madison Pruet" <mpruet@us.ibm.com> wrote: > Please post 'ls -l /tmp/igetenv.so' > > Sent from my iPad > > > On Aug 20, 2014, at 10:38 PM, "RAY BURNS" > <ray.burns@velocityglobal.co.nz> wrote: > > > > I don't think so. The error message in online.log is quite specific: > > > > 15:35:17 ERROR: C Language Symbol <igetenv> (procid 518) not found in > > </tmp/igetenv.so> > > 15:35:17 (-1): ERROR: Loading Routine <sql_igetenv> procid=518 > > > > I tried doing a grant execute on routine sql_igetenv to public and it did > not > > make any difference. > > > > > > > > > ******************************************************************************* > > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a11c34f521328db0501223ad2
Hi Ray, Like Marco reported in another email, it worked for me as well. Make sure the library is owned by user "informix" and not writable by the world: -rwxrwxr-x 1 informix RAND 7823 Aug 21 07:16 /tmp/igetenv.so [ashworth@zeetes utm 1065] 1170_zeetes_timeseries -> objdump -T /tmp/igetenv.so /tmp/igetenv.so: file format elf64-x86-64 DYNAMIC SYMBOL TABLE: 0000000000000488 l d .init 0000000000000000 .init 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses 0000000000000000 w DF *UND* 0000000000000126 GLIBC_2.2.5 __cxa_finalize 0000000000000000 DF *UND* 00000000000000f5 GLIBC_2.2.5 getenv 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar 00000000002008b0 g D *ABS* 0000000000000000 Base _end 00000000002008a0 g D *ABS* 0000000000000000 Base _edata 00000000000005bc g DF .text 000000000000003d Base igetenv 00000000002008a0 g D *ABS* 0000000000000000 Base __bss_start 0000000000000488 g DF .init 0000000000000000 Base _init 0000000000000638 g DF .fini 0000000000000000 Base _fini -- Mark. Mark Ashworth IBM Informix Extensibility Architect Office phone: +1 (905) 413-5033 Alternate: +1 (905) 697-8094 Email: ashworth@ca.ibm.com Check out my blog From: "RAY BURNS" <ray.burns@velocityglobal.co.nz> To: ids@iiug.org, Date: 08/20/2014 10:05 PM Subject: Forgot the export list [33553] Sent by: ids-bounces@iiug.org Sorry I forgot to include the export list. It looks like this: { global: igetenv; local: *; }; ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
On 21/08/14 13:31, Mark Ashworth wrote: > Hi Ray, > > Like Marco reported in another email, it worked for me as well. Make sure > the library is owned by user "informix" and not writable by the world: > > -rwxrwxr-x 1 informix RAND 7823 Aug 21 07:16 /tmp/igetenv.so > > [ashworth@zeetes utm 1065] 1170_zeetes_timeseries -> objdump -T > /tmp/igetenv.so > > /tmp/igetenv.so: file format elf64-x86-64 > > DYNAMIC SYMBOL TABLE: > 0000000000000488 l d .init 0000000000000000 .init > 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string > 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ > 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses > 0000000000000000 w DF *UND* 0000000000000126 GLIBC_2.2.5 > __cxa_finalize > 0000000000000000 DF *UND* 00000000000000f5 GLIBC_2.2.5 getenv > 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar > 00000000002008b0 g D *ABS* 0000000000000000 Base _end > 00000000002008a0 g D *ABS* 0000000000000000 Base _edata > 00000000000005bc g DF .text 000000000000003d Base igetenv > 00000000002008a0 g D *ABS* 0000000000000000 Base __bss_start > 0000000000000488 g DF .init 0000000000000000 Base _init > 0000000000000638 g DF .fini 0000000000000000 Base _fini > > -- Mark. > Mark Ashworth > IBM Informix Extensibility Architect > Office phone: +1 (905) 413-5033 > Alternate: +1 (905) 697-8094 > Email: ashworth@ca.ibm.com > Check out my blog > > From: "RAY BURNS" <ray.burns@velocityglobal.co.nz> > To: ids@iiug.org, > Date: 08/20/2014 10:05 PM > Subject: Forgot the export list [33553] > Sent by: ids-bounces@iiug.org > > Sorry I forgot to include the export list. It looks like this: > > { > global: igetenv; > local: *; > }; > Permission issues give rise to a 9793, but the original poster was seeing a 9794 which definitely is missing symbols. -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Why don't you just use onstat -g env?
:-)
--
Regards
Spokey
> On 21 Aug 2014, at 03:00, "RAY BURNS" <ray.burns@velocityglobal.co.nz> wrote:
>
> Im making my first foray into C UDRs. Im using Informix 12.10 (c1) and
> using Redhat 6.3.
>
> As a test I decided to write a simple C routine that returns an environment
> variable:
>
> #include "dmi/mi.h"
> #include "stdlib.h"
>
> mi_lvarchar *igetenv(mi_lvarchar *str,MI_FPARAM *fparam)
> {
>
> mi_lvarchar *lvarch_out;
>
> char *varname;
>
> char *varvalue;
>
> varname = mi_lvarchar_to_string(str);
>
> varvalue = getenv(varname);
>
> lvarch_out = mi_string_to_lvarchar(varvalue);
>
> return (lvarch_out);
> }
>
> I compiled it with :
> gcc I$INFOMRIXDIR/incl fPIC g c Wall DMI_SERVBUILD igetenv.c
> and
> gcc shared fPIC W1,--version-script=igetenv.exportlist o /tmp/igetenv.so
> igetenv.o lc
>
> I then registered it with:
>
> CREATE FUNCTION sql_igetenv(lvarchar)> RETURNS lvarchar
> with (NOT VARIANT,PARALLELIZABLE)
> EXTERNAL NAME "/tmp/igetenv.so(igetenv)"
> LANGUAGE c;
>
> And ran it with :
>
> execute function sql_igetenv('INFORMIXDIR')>
> I get the error message:
>
> Error: User Defined Routine (sql_igetenv) load failed. (State:S1000, Native
> Code: FFFFD9BE)
> And the log has the following:
> 13:52:09 ERROR: C Language Symbol <igetenv> (procid 513) not found in
> </tmp/igetenv.so>
> 13:52:09 (-1): ERROR: Loading Routine <sql_igetenv> procid=513
>
> If I use objdump I can see the routine is exported:
>
> root:2:/home/rayb>objdump -T /tmp/igetenv.so
>
> /tmp/igetenv.so: file format elf64-x86-64
>
> DYNAMIC SYMBOL TABLE:
> 0000000000000428 l d .init 0000000000000000 .init
> 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string
> 0000000000000000 w D *UND* 0000000000000000 __gmon_start__
> 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
> 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize
> 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv
> 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar
> 000000000000055c g DF .text 0000000000000046 Base igetenv
>
> Can anyone help with what I am missing here?
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
Again. I say permissions. Sent from my iPad > On Aug 21, 2014, at 7:31 AM, "Mark Ashworth" <ashworth@ca.ibm.com> wrote: > > Hi Ray, > > Like Marco reported in another email, it worked for me as well. Make sure > the library is owned by user "informix" and not writable by the world: > > -rwxrwxr-x 1 informix RAND 7823 Aug 21 07:16 /tmp/igetenv.so > > [ashworth@zeetes utm 1065] 1170_zeetes_timeseries -> objdump -T > /tmp/igetenv.so > > /tmp/igetenv.so: file format elf64-x86-64 > > DYNAMIC SYMBOL TABLE: > 0000000000000488 l d .init 0000000000000000 .init > 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string > 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ > 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses > 0000000000000000 w DF *UND* 0000000000000126 GLIBC_2.2.5 > __cxa_finalize > 0000000000000000 DF *UND* 00000000000000f5 GLIBC_2.2.5 getenv > 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar > 00000000002008b0 g D *ABS* 0000000000000000 Base _end > 00000000002008a0 g D *ABS* 0000000000000000 Base _edata > 00000000000005bc g DF .text 000000000000003d Base igetenv > 00000000002008a0 g D *ABS* 0000000000000000 Base __bss_start > 0000000000000488 g DF .init 0000000000000000 Base _init > 0000000000000638 g DF .fini 0000000000000000 Base _fini > > -- Mark. > Mark Ashworth > IBM Informix Extensibility Architect > Office phone: +1 (905) 413-5033 > Alternate: +1 (905) 697-8094 > Email: ashworth@ca.ibm.com > Check out my blog > > From: "RAY BURNS" <ray.burns@velocityglobal.co.nz> > To: ids@iiug.org, > Date: 08/20/2014 10:05 PM > Subject: Forgot the export list [33553] > Sent by: ids-bounces@iiug.org > > Sorry I forgot to include the export list. It looks like this: > > { > global: igetenv; > local: *; > }; > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >
From a developers work article I wrote several years ago... Installing the UDR After you compile and link the UDR into a shared object, you must install it into a secured location that is accessible from the server, such as, under the $INFORMIXDIR/extend directory. For instance, the checksum UDR shared object file would be placed in $INFORMIXDIR/extend/checksum. On UNIX® and Linux computers, the directory must be owned by user informix, placed in the informix group, and be non-writable by anyone except user informix (drwxr-xr-x). Similarly, the shared object file must be owned by user informix, in the informix group, and have (drwxrwxr-x) permissions. Sent from my iPad > On Aug 21, 2014, at 1:30 PM, "Madison Pruet" <mpruet@us.ibm.com> wrote: > > Again. I say permissions. > > Sent from my iPad > > > On Aug 21, 2014, at 7:31 AM, "Mark Ashworth" <ashworth@ca.ibm.com> wrote: > > > > Hi Ray, > > > > Like Marco reported in another email, it worked for me as well. Make sure > > the library is owned by user "informix" and not writable by the world: > > > > -rwxrwxr-x 1 informix RAND 7823 Aug 21 07:16 /tmp/igetenv.so > > > > [ashworth@zeetes utm 1065] 1170_zeetes_timeseries -> objdump -T > > /tmp/igetenv.so > > > > /tmp/igetenv.so: file format elf64-x86-64 > > > > DYNAMIC SYMBOL TABLE: > > 0000000000000488 l d .init 0000000000000000 .init > > 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string > > 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ > > 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses > > 0000000000000000 w DF *UND* 0000000000000126 GLIBC_2.2.5 > > __cxa_finalize > > 0000000000000000 DF *UND* 00000000000000f5 GLIBC_2.2.5 getenv > > 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar > > 00000000002008b0 g D *ABS* 0000000000000000 Base _end > > 00000000002008a0 g D *ABS* 0000000000000000 Base _edata > > 00000000000005bc g DF .text 000000000000003d Base igetenv > > 00000000002008a0 g D *ABS* 0000000000000000 Base __bss_start > > 0000000000000488 g DF .init 0000000000000000 Base _init > > 0000000000000638 g DF .fini 0000000000000000 Base _fini > > > > -- Mark. > > Mark Ashworth > > IBM Informix Extensibility Architect > > Office phone: +1 (905) 413-5033 > > Alternate: +1 (905) 697-8094 > > Email: ashworth@ca.ibm.com > > Check out my blog > > > > From: "RAY BURNS" <ray.burns@velocityglobal.co.nz> > > To: ids@iiug.org, > > Date: 08/20/2014 10:05 PM > > Subject: Forgot the export list [33553] > > Sent by: ids-bounces@iiug.org > > > > Sorry I forgot to include the export list. It looks like this: > > > > { > > global: igetenv; > > local: *; > > }; > > > > > > > > ******************************************************************************* > > > > > 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. > --Apple-Mail-3F49D7F1-6AB9-4F7C-AA1F-94A0C68092E2
I might add that this article was written around the 10.x days and some= of the permissions rules might have changed just a bit since then. Check = in the UDR reference manual in the install section. Sent from my iPad > On Aug 21, 2014, at 1:45 PM, "Madison Pruet" <mpruet@us.ibm.com> wrot= e: > > >From a developers work article I wrote several years ago... > Installing the UDR > After you compile and link the UDR into a shared object, you must ins= tall it > into a secured location that is accessible from the server, such as, under the > $INFORMIXDIR/extend directory. For instance, the checksum UDR shared object > file would be placed in $INFORMIXDIR/extend/checksum. > On UNIX=AE and Linux computers, the directory must be owned by user informix, > placed in the informix group, and be non-writable by anyone except us= er > informix (drwxr-xr-x). Similarly, the shared object file must be owne= d by user > informix, in the informix group, and have (drwxrwxr-x) permissions. > > Sent from my iPad > > > On Aug 21, 2014, at 1:30 PM, "Madison Pruet" <mpruet@us.ibm.com> wr= ote: > > > > Again. I say permissions. > > > > Sent from my iPad > > > > > On Aug 21, 2014, at 7:31 AM, "Mark Ashworth" <ashworth@ca.ibm.com= > wrote: > > > > > > Hi Ray, > > > > > > Like Marco reported in another email, it worked for me as well. M= ake sure > > > the library is owned by user "informix" and not writable by the world: > > > > > > -rwxrwxr-x 1 informix RAND 7823 Aug 21 07:16 /tmp/igetenv.so > > > > > > [ashworth@zeetes utm 1065] 1170_zeetes_timeseries -> objdump -T > > > /tmp/igetenv.so > > > > > > /tmp/igetenv.so: file format elf64-x86-64 > > > > > > DYNAMIC SYMBOL TABLE: > > > 0000000000000488 l d .init 0000000000000000 .init > > > 0000000000000000 D *UND* 0000000000000000 mi_lvarchar_to_string > > > 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ > > > 0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses > > > 0000000000000000 w DF *UND* 0000000000000126 GLIBC_2.2.5 > > > __cxa_finalize > > > 0000000000000000 DF *UND* 00000000000000f5 GLIBC_2.2.5 getenv > > > 0000000000000000 D *UND* 0000000000000000 mi_string_to_lvarchar > > > 00000000002008b0 g D *ABS* 0000000000000000 Base _end > > > 00000000002008a0 g D *ABS* 0000000000000000 Base _edata > > > 00000000000005bc g DF .text 000000000000003d Base igetenv > > > 00000000002008a0 g D *ABS* 0000000000000000 Base __bss_start > > > 0000000000000488 g DF .init 0000000000000000 Base _init > > > 0000000000000638 g DF .fini 0000000000000000 Base _fini > > > > > > -- Mark. > > > Mark Ashworth > > > IBM Informix Extensibility Architect > > > Office phone: +1 (905) 413-5033 > > > Alternate: +1 (905) 697-8094 > > > Email: ashworth@ca.ibm.com > > > Check out my blog > > > > > > From: "RAY BURNS" <ray.burns@velocityglobal.co.nz> > > > To: ids@iiug.org, > > > Date: 08/20/2014 10:05 PM > > > Subject: Forgot the export list [33553] > > > Sent by: ids-bounces@iiug.org > > > > > > Sorry I forgot to include the export list. It looks like this: > > > > > > { > > > global: igetenv; > > > local: *; > > > }; > > > > > > > > > > > > > > ***********************************************************************= ******** > > > > > > > > Forum Note: Use "Reply" to post a response in the discussion foru= m. > > > > > > > > > > > > > > ***********************************************************************= ******** > > > > > Forum Note: Use "Reply" to post a response in the discussion foru= m. > > > > > > > > > > ***********************************************************************= ******** > > Forum Note: Use "Reply" to post a response in the discussion forum.= > > > > --Apple-Mail-3F49D7F1-6AB9-4F7C-AA1F-94A0C68092E2 > > > ***********************************************************************= ******** > Forum Note: Use "Reply" to post a response in the discussion forum.= >=
Many many thanks to all of those who offered your advice. It is much appreciated. As Madison said - The answer was permissions. Specifically the post from Mark making sure the file is owned by informix with 775 permissions. As soon as I did that everything worked perfectly. The message in the online.log sent me off on a wild goose chase thinking I had incorrectly compiled/linked the code. - Lesson Learnt Thanks again.