Skip Navigation: Avoid going through Home page links and jump straight to content
NASA Logo    + View the NASA Portal  
NAIF

Questions About Apparent Errors in SPICE Code or Kernel Files

If you have written a program that uses SPICE modules, and that program either fails to execute or displays some sort of error message, you may have encountered:

  1. an attempt to obtain SPICE data that is not available in any of the SPICE files you have loaded into your program
  2. a secondary (and not-so-obvious) need for additional, but missing, SPICE data to support a primary computation
  3. a kernel file that was incorrectly ported between dissimilar computers
  4. an error in your own code, perhaps including an incorrect declaration for an input or output parameter in a call to a SPICE module
  5. an invalid parameter (data value) passed into a SPICE module through the calling sequence
  6. an error in SPICE code

(These problems are listed according to estimated relative frequency of occurrence.)

The first and second kinds of errors involve missing data (or an inadvertent request for the wrong data). Likely a SPICE error message and trace-back will be generated. (This message may be difficult to interpret.) Try using the various kernel summary tools and/or re-examining any associated metadata to ensure the SPICE kernel files you are using contain the information (e.g. object IDs, time spans) you need.

The third kind of error will usually result in some kind of SPICE error message being generated. Which message depends on the kind of file being ported and the version of the toolkit being used. (Erroneous interpretation of kernel data will not happen.)

The fourth kind of error could have unpredictable results, including program termination (crash).

The fifth kind of error is frequently detected by the exception handling mechanism built into SPICE code, in which case a SPICE error message and trace-back will be generated. (This message may be difficult to interpret.)

The sixth kind of error could have unpredictable results. In general the SPICE software has been highly tested, both using formal test procedures and through extensive use on many missions. While the occasional bug is found, this is a rather rare occurrence.


If you need help from NAIF in diagnosing an error, please try to do the following, as appropriate.

  1. Ensure that the SPICE error handling mechanism has not been turned off. ("On" is the default state for Toolkits obtained from NAIF.)
  2. Provide a complete copy of any error message(s) you have encountered.
  3. Provide a listing of output produced from your program.
  4. Provide an accurate list of the names of the SPICE kernels your program is using.
  5. Provide a listing of your code where you believe a SPICE-related error has taken place. If this is a code fragment, also include the declarations section of your code.

NAIF staff may later ask for a complete copy of your source code and/or your executable, as well as copies of the actual kernels and other data your program was using when the problem occurred.

NAIF has a document summarizing commonly encountered problems that may help you quickly self-diagnose a problem before resorting to contacting NAIF.

PDS Menu
FIRST GOV + NASA Privacy Statement, Disclaimer NASA Home Page Clearance: CL#05-2438
Site Manager: Charles Acton
NASA Official: William Knopf
Webmaster: Ron Baalke
Last Updated:
PDS Atmospheres Geosciences Imagine NAIF PPI Rings Small Bodies