ORA-06520 when External Procedure run.
BeilstwhFeb 27 2006 — edited Feb 28 2008I need to run a C application that will run an external procedure and I am getting the following errors reported when I run the function call in PL/SQL.
The test program follows
declare
rn number;
begin
rn:=wpleca('CUSTCODE PASSTEST');
END;
/
The error that is generated is
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: ld.so.1: extproc: fatal: libgcc_s.so.1: open failed: No such file or directory
ORA-06512: at "CUSTOM.WPLECA", line 0
ORA-06512: at line 4
The C program follows
#include<stdio.h>
#include<stdlib.h>
int sysrun(char *command) {
int num;
char str[80];
strcpy (str, "/xxxx/test/adhoc/syscr/wpleca2unix.sh ");
strcpy (str,command);
num = system(str);
return num;
}
The C compile commands follow
gcc -fPIC -c wpleca.c
gcc -shared -o libwpleca.so wpleca.o
The create library command follows
CREATE OR REPLACE LIBRARY PLECA_LIB
AS '/xxxx/test/adhoc/syscr/libwpleca.so'
/
The create function call follows
CREATE OR REPLACE FUNCTION wpleca (params_in in varchar2)
return binary_integer
as language C
name "sysrun"
library pleca_lib
parameters(params_in string);
The shared library and the script both exist with approporate permissions
-rwxr-xr-x 1 root other 5800 Feb 27 14:12 /xxxx/test/adhoc/syscr/libwpleca.so
-rwxrwxr-x 1 xyz test 1139 Feb 27 14:14 /xxxx/test/adhoc/syscr/wpleca2unix.sh
Any help with this error would be most appreciated.