Troubleshooting

Tracing Execution

Chalice plugins can define a variable, upiDebugFlag, which contains a trace level. This will cause Chalice to dump an execution path trace to standard out, showing which routines are executed and, in some cases, with what values.

To use this feature, initialize the variable with a value from 1 to 4, where 1 will dump out the least information and 4 will dump the most. For example,

int  upiDebugFlag = 4;
Since this is a global variable, it must appear outside of any subroutines. Typically, it appears at the end of the .C file containing the plugin code.


Common Pitfalls

This section is more anecdotal than analytic. It contains a number of symptoms you may observe in your plugin, followed by things to check in each case. Please feel free to contribute your own cause-effect discoveries by sending them to support@sgrail.com.


Core Dumps

PROBLEM: Place node down on work area, get immediate crash

CHECK: This generally happens if the dialog file is missing or broken. Make sure that you have run chalice -D (or builddialogs) before trying the plugin. In some cases, you may have to remove the existing dialog file and then rebuild it. Dialog files are kept in
/usr/grail/chalice1.X/support/config/Dialogs/chalice


Compiling Problems

PROBLEM: Run chalice -D, get "Chalice has failed due to an internal error"

CHECK: The upiCreateParameters() definition. Trying to add parameters without first adding a tab, will generate this message. In code terms,

CPIDSOEXPORT void upiCreateParameters( void )
{
    // WRONG!
    cpiAddInteger("Fractal Depth", 1, 0, 10, P_ANIMATE );
}

CPIDSOEXPORT void upiCreateParameters( void )
{
    // Correct
    cpiAddTab( "Fractal Noise" );
    cpiAddInteger("Fractal Depth", 1, 0, 10, P_ANIMATE );
}
ALSO CHECK: Menu definitions. Menus must be NULL terminated. If the NULL is omitted, this kind of error can result. For example,
CPIDSOEXPORT void upiCreateParameters( void )
{
    char    *menu = {"red", "green", "blue"};    // WRONG!
}

CPIDSOEXPORT void upiCreateParameters( void )
{
    char    *menu = {"red", "green", "blue", NULL};   // RIGHT
}

Runtime UI Problems

PROBLEM: Menu gadget is blank

CHECK: Menu defaults are numbered from 0, not 1. If your menu is blank, check that the default value is not pointing to the NULL menu entry. For example,

CPIDSOEXPORT void upiCreateParameters( void )
{
    char    *menu = {"red", "green", "blue", NULL};

    cpiAddTab("Parameters");
    // WRONG! Item 3 in the menu is the NULL pointer
    cpiAddMenu("Channel", 3, mdef, 0);
}
PROBLEM: I changed the UI, recompiled, and it doesn't show up

CHECK: Sometimes dialog files are not properly updated. Go to the directory
/usr/grail/chaliceX.Y/support/config/Dialogs/chalice
where X.Y is the release version of Chalice you are using, and delete the file 'yournode', where 'yournode' is the name of your custom node. Then run chalice -D again.

PROBLEM: run chalice or chalice -D, get error messages like
ERROR: /usr/grail/chalice1.6/support/config/Dialogs/chalice/mosaic: parse error on line 323

CHECK: Tab field labels. These must be simple strings - names with parentheses or dashes are illegal. For example,

Tile Size
Red Gain
are ok, but
Tile Size (pixels)
Red Gain - % value
will not work.


[Previous Page] [Next Page]
[Table of Contents] [Index]

Copyright © 1998 Silicon Grail Inc.
710 Seward Street, Hollywood, CA 90038