ORA-28579: network error during callback from foreign agent procedure

Has anyone seen this error when trying to call an external C function from an Oracle query? I am using Oracle 10g and I get this error every time I try to call one of the two functions in the library. Calling another function returns a value each time, although the function that is running is standalone, it does not call any OCI * functions.

This is where the procedure is stored that is used to call the failed C code:

CREATE OR REPLACE PROCEDURE index_procedure(text in clob, tokens in out nocopy clob, location_needed in boolean)
as language c
name "c_index_proc"
library lexer_lib
with context
parameters
(
  context,
  text,
  tokens,
  location_needed
);

      

Any help would be greatly appreciated. Everything I found in this error message suggests that the following actions should be taken: Contact Oracle Customer Support Services.

Edit: I've narrowed it down to the point where I know there is a segfault in libclntsh after I call OCILobTrim (to truncate it to 0 length) in the token glue. Here is the code I used to call this procedure.

declare text CLOB; tokens CLOB;
begin
dbms_lob.createtemporary(tokens, TRUE);
dbms_lob.append(tokens, 'token');
dbms_lob.createtemporary(text, TRUE);
dbms_lob.append(text, '<BODY>Test Document</BODY>');
index_procedure(text, tokens, FALSE);
dbms_output.put_line(tokens);
end;
/

      

Is there something wrong with this setting that could cause OCILobTrim problems?

0


source to share


2 answers


Well, upgrading to 10.2.0.4 (10.2.0.1 was used) at least gave me an understandable error instead of the rather useless kernel file and ORA-28579.

It turns out that the code I was debugging assumed that the OCILobRead call would return all data in one pass. This applies to any client using a fixed-width character set.



For clients using the variable width character set, this is not the case, OCILobRead actually looked at a piece of data and returned OCI_NEED_DATA, and future calls to OCILobTrim and OCILobWrite failed due to the still pending OCILobRead call. The solution was to loop the OCILobRead calls until OCI_NEED_DATA was no longer returned and we had all the data we needed in our buffer.

The OCIBreak call would also allow the OCILobTrim and OCILobWrite functions to continue, although we would not have all the required input.

+1


source


It looks like this is one of those errors, which essentially means that any number of things could break the outer procedure.

Known bug in 10.2.0.3, don't know if it matters:

ORA-28579 occurs when trying to fetch data from a pipelined table function implemented in "C" using the ODCITable / ANYDATASET interface. ODCITableDescribe works fine, but ODCITableFetch generates ORA-28579 error.



I would suggest:

  • Look at the database server for the trace directories and the directory where the external proc is located for any generated log or trace files when an error occurs.
  • A tool for your external proc in some way so that you can try and follow it up.
  • Contact Oracle Support Services.
+1


source







All Articles