Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 23:57:01 +0000



Post From: CPU Exceptions from Custom Studies

[2021-11-28 22:54:59]
Sierra123 - Posts: 27
I keep running into these issues below with my Studies and I've not found a good way to isolate the issues.

Warning: The Custom DLL study "HLines1v1.scsf_ToolsHLines1v1" has just caused a CPU exception. | 2021-11-28 17:43:42.051 *
Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from your chart and restart Sierra Chart. | 2021-11-28 17:43:42.051 *

I assumed I had and error which was overwriting a memory address because I use several arrays. I use both local arrays as well as keeping some arrays persisted in memory using the persistence calls.

e.g. if(p_Line != NULL) sc.SetPersistentPointer(2, p_Line);

At times I call the sc.UseTool to draw lines or text objects on the screen and I get a 0 return code, which indicates an error, but I do not know how to determine what the error is.

Sometimes I have been able to reduce the size of the arrays of memory allocations, and the CPU exceptions stop occurring, but I am suspicious that I've not really fixed the issues.

I have 10-15 reasonably complex studies working, but do run into these problems on a few other studies I've developed. I have tried commenting out my code section by section to determine where the issue is but that is a slow painful process.

1) Are there other debugging tips to isolate what the problems are? e.g. error codes, error reasons, etc.?
2) Is there a limit to the amount of memory (heap/stack/persistence) that can be allocated by a given study?
3) Is there a memory limit that spans all studies which is causing me to have a problem when I have all of the studies loaded?