7

I have a PL/SQL function that I'm working with that sometimes compiles ok but sometime give me this error.

ORA-00600: internal error code, arguments: [17285], [0x318FDE2C], [1], [0x273F1C60], [], [], [], [], [], [], [], []
00600. 00000 -  "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause:    This is the generic internal error number for Oracle program
       exceptions.  This indicates that a process has encountered an
       exceptional condition.
*Action:   Report as a bug - the first argument is the internal error number

Disconnecting and reconnecting to the Oracle and the function compiles ok which feels crazy...

Googling the error code and argument gave me this

ERROR:
ORA-600 [17285] [a] [b] [c]

VERSIONS:
versions 7.0 to 10.1
DESCRIPTION:
Oracle is in the process of deleting an instantiation object when it
discovers that the object is currently on the call stack.
This should not occur and so ORA-600 [17285] is reported.
ARGUMENTS:
Arg [a] Instantiation object
Arg [b] Call stack nesting level
Arg [c] Library Cache Object Handle
FUNCTIONALITY:
Kernel Generic Instantiation manager

IMPACT:
PROCESS FAILURE
NON CORRUPTIVE - no corruption to underlying data.
SUGGESTIONS:
This error is usually accompanied by another error. Please check for this.

My function returns a custom table type pipelined. Most function code left out...

CREATE TYPE t_solexp_row AS OBJECT (
obj         VARCHAR(30),
dt          DATE,
param       VARCHAR(30),
param_id    NUMBER,
val         NUMBER,
change_time TIMESTAMP
);
/

CREATE TYPE t_solexp_tab IS TABLE OF t_solexp_row;
/

CREATE OR REPLACE FUNCTION get_solexp_tab(p_start_date IN DATE, p_end_date IN DATE) RETURN t_solexp_tab PIPELINED AS
BEGIN
    ...
    LOOP
        PIPE ROW(t_solexp_row(...,...,...,...,...,...);
    END LOOP;
    ...
    RETURN;
END;
/

Any idea of what may cause this behavior?

MT0
  • 143,790
  • 11
  • 59
  • 117
Lallen
  • 518
  • 7
  • 13
  • Can you try with specifying a LIMIT for the array size and see if it still happens. – Lalit Kumar B Jan 30 '15 at 13:11
  • @LalitKumarB Where do you suggest that i try to add a limit? There are not really any arrays present. – Lallen Jan 30 '15 at 13:19
  • You have not provided the complete code. I thought there would be an array involved. When you do a bulk collect, you could specify a LIMIT. This acts as the limit on building the array in the memory. You would expect to get limited number of rows in each array. The same applies to context switching. – Lalit Kumar B Jan 30 '15 at 13:29
  • Anyway, good that you found the root cause and shared it as an answer. +1 – Lalit Kumar B Jan 30 '15 at 13:30

1 Answers1

13

This wasn't planned as a self answered question but I got an idea when i wrote it, thank you Stackoverflow! :)

I'm developing and testing the function in SQL Developer. The number of rows in the result set varies from just a few to many thousand depending on the arguments.

I noticed that the problem only occurs when the last result set contained over 50 records.

The problem seem to be that SQL Developer only fetches the first 50 rows from oracle initially, recompiling the function with data still in the pipeline causes the ORA-00600. Seems reasonable and matches the error description

Oracle is in the process of deleting an instantiation object when it
discovers that the object is currently on the call stack.
This should not occur and so ORA-600 [17285] is reported.

Phew, just happy that it's working now! Internal errors from the database engine is enough to give me the shivers.

Lallen
  • 518
  • 7
  • 13
  • It makes sense that this would cause an error. But ORA-600 is always a bug; those errors generate trace files and can't be caught. I would expect this issue to generate an error like `ORA-08103: object no longer exists`. – Jon Heller Feb 01 '15 at 07:50
  • Same issue occurs in Toad, loading all rows resolves it. – Niels Tolstrup Oct 29 '20 at 13:43