Login Page - Create Account

Sierra Chart Unexpectedly Shutting Down | Memory Errors | Unusual Software Problems | Exception Errors | Freezing of User Interface

Problems Caused by Advanced Custom Studies

If you are using Advanced Custom Studies, which are studies which are added through Analysis >> Studies >> Add Custom Study, and one of the following occurs:

  • Receive a Warning: The Custom DLL study "[DLLFileName].scsf_[StudyName]" has just caused a CPU exception. | Date-Time in the Window >> Message Log.
  • Windows operating system says Sierra Chart has performed an illegal operation or has encountered a problem and Sierra Chart is shut down.
  • Receive an Out of Memory message in the Message Log.
  • Receive an An unhandled exception was caught in [Function Name]. Message: [Number] message in the Message Log.
  • Receive a Exception caught from [Study Name] message in the Message Log.
  • Sierra Chart uses more and more memory.
  • You have unusual problems with Sierra Chart.
  • Sierra Chart freezes and uses a lot of CPU time.
  • Unable to open Chartbooks due to one of the above problems.
  • An abnormal shutdown of Sierra Chart occurs when pressing the Analysis >> Studies >> Add Custom Study button.
  • Sierra Chart freezes for an extended time and reconnects to the data feed because of this.
  • A "stack corruption" occurs and when this is encountered, Sierra Chart immediately shuts down without any error message. In other words it disappears. This is an example of a stack corruption:
        //Define an array of variables within the function. This is created on the "stack"
        int IntegerArray[4] = {1, 2, 3, 4};
        //The following line will corrupt the stack because it is accessing beyond the bounds of the array
        IntegerArray[4] = 10;

Then the first step to resolve these kinds of issues is to follow the below instructions.

  1. Restart Sierra Chart.
  2. At the Sierra Chart Login window, press the Cancel button.
  3. Enable the option Safe Mode to prevent the downloading of DLL files and the loading of Advanced Custom Studies DLL files.
    Safe Mode

    For detailed instructions, refer to Using Safe Mode.
  4. Press the Login button.
  5. If you no longer are experiencing the problem that you did previously, then continue with the steps below to determine what particular DLL file is causing the problem. Otherwise, if using Safe Mode did not resolve the problem, then the problem you are experiencing is not caused by an Advanced Custom Study and you can stop here.
  6. Disable automatic file downloads of custom study and related files, that your Sierra Chart account is authorized to receive. To do this, go to the Enabled Studies And Files Set To Download page and disable File Downloads.
  7. Select Global Settings >> General Settings. Make a note of the Data Files Folder.
  8. Exit Sierra Chart.
  9. Next, go to your Sierra Chart Data Files Folder that you made a note of. In the Data Files Folder, create a folder named DLLBackup.
  10. Move all files with a .DLL file extension in the Sierra Chart Data Files Folder into your DLLBackup folder that you created.
  11. Run Sierra Chart.
  12. On the Login Window, disable the option Safe Mode to allow the loading of Advanced Custom Studies DLL files.
  13. If a particular Advanced Custom Studies DLL file was the cause of the problem, then the problem you were previously experiencing will now be solved even when not using Safe Mode.
  14. You can now move the Advanced Custom Studies DLL files from the DLLBackup folder into the Sierra Chart Data Files Folder one by one and try reopening your Chartbooks after that to see which DLL file is causing the problem. Always put the DLL files in the Sierra Chart Data Files Folder. This is the only folder where they will work from. They will not work if they are located in some other folder.
  15. When you determine which DLL is causing the problem, then exit from Sierra Chart, delete that DLL file, and contact the developer about it.
  16. The first step is for the Custom Studies DLL developer to recompile their source code using the latest SierraChart.h header file. This can be done through Analysis >> Build Custom Studies DLL. The latest header file will be used by default.
  17. If after recompiling the source code and creating a new DLL, if the problem still occurs, the Custom Study developer needs to determine the reason for the problem and correct it. They can contact Sierra Chart Support on the Support Board for help if needed.
  18. If you no longer want to use a custom study which was causing the problem, then remove all instances of it from all open charts. Studies can be removed through Analysis >> Studies >> Studies to Graph >> [select study] >> Remove.

    If the DLL file for a particular study that has been added to a chart has been deleted, then the study will be listed as Custom DLL Study in the Studies to Graph list.
  19. After removing a particular custom study from your charts which you no longer want to use or has been a problem, restart Sierra Chart after to clear any memory corruptions which it may have been causing if it has this kind of problem.
  20. Programming errors in Advanced Custom Studies can cause numerous different and unusual problems.

Advanced Custom Studies Can Cause Problems in One Version but Not Another

It is very possible for an Advanced Custom Study with a programming error not to cause a problem in one version of Sierra Chart, but cause a problem in a newer version.

It is also possible for an Advanced Custom Study with a programming error not to cause a problem and then later cause a problem without an apparent reason.

Be aware of and understand this. Memory corruptions due to overwriting the bounds of an array, can lead to these kinds of behaviors.

Users will often attribute the problem to a new Sierra Chart version when it is their own custom study code or the custom study code of the developer who developed the custom study the user is using, which actually is the source of the problem.

The reason that a problem becomes apparent with a new Sierra Chart version is that the code and memory usage layout will vary compared to the prior version and memory corruptions which do not cause a problem in one version become apparent in another version simply because the area of memory that the custom study is damaging, was not a used memory location or used very infrequently in the prior version.

If Sierra Chart is completely stable when the custom study is removed, this only confirms the problem as described in this section. Additionally if other users not using the custom study have zero problem with Sierra Chart, then this is further confirmation of this.

Hard Drive / SSD Issues

If Sierra Chart unexpectedly shuts down or freezes permanently, then this could be because the Sierra Chart program files have become damaged on your disk drive or SSD. This is unlikely. To see if this is the case, download and reinstall Sierra Chart. There is no need to uninstall first.

Sierra Chart Studies Causing Exceptions

In the very rare case that a Sierra Chart built-in study is causing an exception and giving the following message in the Window >> Message Log:

Warning: The Custom DLL study "SierraChartStudies.scsf_[StudyName]" has just caused a CPU exception. | Date-Time

What you then need to do is contact Sierra Chart support about this on the Support Board for instructions. We need to analyze problem to determine the reason and provide a solution.

"Caught an unhandled exception"

In the rare case that an exception is being caught by Sierra Chart which results in a line like the following in the Window >> Message Log:

An unhandled exception was caught in [Function Name]. Message: [Number]

Then this means that a software or hardware level exception has occurred which indicates a serious problem. There can be numerous causes including a memory corruption. Usually the reason for this is an Advanced Custom Study with a programming error. The least likely reason would be that it is caused by a bug within Sierra Chart itself.

Follow the below procedure to resolve this kind of problem:

  1. An unhandled exception occurring within Sierra Chart indicates a serious problem like a memory corruption. Sierra Chart cannot continue to function reliably after this exception has occurred. Therefore, as soon as possible exit from Sierra Chart with File >> Exit.
  2. Follow the instructions in the Advanced Custom Studies Part 1 section to determine if the problem is caused by an Advanced Custom Study. If so, then stop here.
  3. If after restarting Sierra Chart and using Safe Mode, you continue to have the problem, then restart your computer.
  4. If that still does not solve the problem, then need you need to contact Sierra Chart support about this on the Support Board for instructions. We need to analyze problem to determine the reason and solve it.

System Lockups and System Restarts

In the very rare case, that you see your computer system lockup or restart when using Sierra Chart, then generally this is an indication of a hardware problem on your computer system.

Generally it is caused by faulty RAM memory or a faulty hard drive or solid-state drive.

Under no circumstances does a program like Sierra Chart which is a normal program that uses standard operating system functions, cause a computer to restart or freeze. It is technically impossible. This also applies to any other program that uses standard operating system functions. It is just not possible.

Check all of the hardware on your computer. Especially the memory and the hard drive or solid-state drive.

This particular section is only here for documentation completeness because hardware problems generally are not very common.

Sierra Chart can potentially use a significant amount of memory and drive space which can expose hardware faults with either of these on your system.

Inconsistent or Unstable Behavior of Custom Study Between Sierra Chart Versions

If you notice that your custom study is behaving differently after a Sierra Chart update or it has unstable behavior, then the most likely reason is a problem with your own program code. The Sierra Chart Advanced Custom Study Interface is a simple and rock-solid and a totally reliable C++ interface.

It is next to impossible for there to be any problem with this interface. Furthermore, if there is an issue, this would be a very rare condition that we would be aware of quite quickly and resolve it quickly.

Your custom study consists of compiled C++ code and what it does, primarily is the execution of your own code. If it does not function properly, then the problem is almost certainly going to be in your code. There is almost no other possibility.

Now, there are some items which could also be causing a problem.

There can be some rare cases, and we mean rare, where there could be an inadvertent or improper change within a Sierra Chart data structure in a new version which can cause a problem where a custom study will not be stable. If this is the case, it is going to be obvious to Sierra Chart engineering that this is the case and we will promptly resolve it.

So this kind of problem, is unlikely to begin with and if it is, we would recognize it and acknowledge it and correct it. Another solution to solve the problem is just simply to recompile your custom study on the version where you encounter the problem and that will resolve it as well without any further intervention by Sierra Chart engineering. However, that is not a permanent solution because after we reverse the data structure back to its proper and compatible state, and release a new version you will then have to recompile your source code on that new corrected version as well.

Another possibility when using the Remote Build command is that there could be a problem with the generated code from the GCC compiler. We say this not based on any actual knowledge of this but based on just merely a hypothetical concept that we have no belief is even true.

Sierra Chart itself is built with the Microsoft Visual C++ compiler which you can also use as well. We have never been aware of any problem with the generated code from the GCC compiler other than sometimes some parameter type incompatibilities. When we are aware of those, we resolve them. Aside from that potential problem with the GCC compiler which should not be an issue at the present time, we are not aware of any other issues.

However, to work around any potential issues, simply compile your code by using the Analysis >> Build Custom Studies DLL >> Build >> Build with Visual C++ - Debug/Release command. You will first need to use the Build >> Install Visual C++ Compiler button on the Build Custom Studies window.

So if you have some kind of inconsistent or unstable behavior of your custom study after updating Sierra Chart, the definitive solution to rule out Sierra Chart is to rebuild the DLL on the current version of Sierra Chart you are running by using the Analysis >> Build Custom Studies DLL >> Build >> Build with Visual C++ - Debug/Release command. If you continue to see the problem, then this 100% definitively points to your own source code as the problem. It is unlikely there is any other possibility.

If the use of the Advanced Custom Study Interface and Language is beyond your abilities, then this is not something we are able to control.

Sierra Chart provides hundreds of studies in ACSIL format, which are stable from version to version without any problem, and without any code modifications. This is because they are properly coded. We do acknowledge the possibility of an inadvertent change in a data structure, can cause a problem. If you recompile your code on the version which it is not working properly on and that resolves it, then we need to make a correction. Otherwise, the problem is in your own code.

Resolving Unstable/Improper Functioning Due to Insufficient Memory Available

Follow the instructions below, if Sierra Chart is not stable or not functioning properly, and potentially it relates to Sierra Chart not able to allocate the necessary memory that it requires.
  1. If Sierra Chart is running, exit by selecting File >> Exit.
  2. Run the 64-bit version of Sierra Chart. There should be a shortcut on the system desktop for it that has _64 in its name. For further information, refer to Difference Between 32 and 64-bit Versions.
  3. On the Login window of Sierra Chart, enable Safe Mode to rule out any problems with custom studies. For instructions, refer to Using Safe Mode.
  4. And disable Open Files on Startup.
  5. Do not use any existing Chartbooks. Start only with new charts.
  6. When everything is confirmed to be running stable, then you can open your existing Chartbooks.
  7. If you have any stability issues, and it relates to an out of memory condition, check the Window >> Message Log for any messages that contain "out of memory". For more information refer to Out of Memory Condition.
  8. If your configuration with charts and studies and other things in Sierra Chart is using a lot of memory and the operating system is not providing the needed memory to Sierra Chart for whatever reason, or Sierra Chart is under a heavy load, we recommend using sub instances of Sierra Chart. For further information, refer to Using DTC Server for Data and Trading in Another Sierra Chart Instance.

Exceptions and InstabilityFrom Open GL

Sierra Chart supports the use of OpenGL (Open Graphics Library) for chart graphics. Refer to the Use OpenGL For Chart Graphics settings option in the Global Settings >> Graphics Settings window for more information about this feature and to enable it and disable it.

If you notice any unhandled exceptions when using this option or any stability with Sierra Chart, then disable the Use OpenGL For Chart Graphics option and restart Sierra Chart.

This is a relatively new feature. The cause of the exceptions and instability and graphics display issues some users experience is being researched.

In our development and testing, we are not aware of or observe any stability problems with the use of the OpenGL functionality in current versions of Sierra Chart.

*Last modified Saturday, 25th February, 2023.