What’s CRADLE_ERRORSTACK?

Environment Variable or Command-line Switch Stack-tracing

As with many complex products Cradle monitors its internal operation and on the rare occasion that something goes wrong it writes information to a log. CRADLE_ERRORSTACK controls how much information is logged internally and output on these occasions.

If in the unfortunate case a Cradle tool crashes, there will often be a log produced in the %CRADLEHOME%\logs\errors directory. This will enable 3SL Support to diagnose simple cases such as a lack of memory on the machine. If the case is more complex, the development team may need to know at which point the program was processing at the time the error occurred. CRADLE_ERRORSTACK will enable additional internal logging that will output a simple execution stack trace into the log. This can aid diagnosis and resolution.

Switching Stack Trace On and Off

CRADLE_ERRORSTACK is an environment variable. You can set it via the control panel’s Advanced system settings (see the screenshot).

In Linux if you are editing the environment config files bashrc, profile, etc for either the system /etc/profile or the user ~/.bashrc then use:

export CRADLE_ERRORSTACK=true

Or as we now set CRADLEHOME in /etc/profile.d/cradle.sh you can put the ‘CRADLE_ERRORSTACK=true’ variable in this file.

Or you could start the Cradle tool from within a command shell, (On Windows®) press windows key type cmd and then in the shell set CRADLE_ERRORSTACK=true, then launch the tool e.g. "%CRADLEHOME%\bin\exe\windows\work.exe". You can also set a -errorstack parameter to your command line option, i.e. work.exe -errorstack to start WorkBench with the stack on.

Turning on CRADLE_ERRORSTACK environment variable
Environment Variables

Should I leave CRADLE_ERRORSTACK on?

Generally there is no need to leave the stack trace on all the the time. There is a small performance hit if you do, so unless you are having problems we don’t advise you leave it enabled.

What if that still does not sort the issue?

3SL Support may ask you to turn on tracing which produces a complete execution trail from the product. This has a large overhead and uses disk space and is only in used in the very trickiest of issues. Rest assured, it’s unlikely you’ll have to use  it, but if you do there is a post here that explains tracing.

Article UpdateD

27/04/2021 – Using CRADLE_ERRORSTACK in Linux