Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 04:37:40 +0000



[Programming Help] - CPU Exception when building for debugging but not release?

View Count: 612

[2020-12-16 16:08:34]
jwick - Posts: 142
I'm getting a CPU Exception from one of my studies ... but only when I build it for debugging. Does this make sense? I don't have any code branches between debug vs release so the actual code being compiled should be the same. I'm restarting SC between rebuilding to be sure but am still experiencing the CPU exception on a debug build. Any "pointers" ;)?
[2020-12-16 17:05:07]
bradh - Posts: 859
I'm restarting SC between rebuilding to be sure but am still experiencing the CPU exception on a debug build. Any "pointers" ;)?

Try attaching the debugger to the SierraChart process before opening the chart, or attaching the study. The debugger should then give you more information on the issue before the CPU exception error is logged.
[2020-12-17 09:22:49]
binaryduke - Posts: 360
If you are using Visual Studio, try updating to the latest release. I have experienced the opposite situation - fine in Debug (which in turn disables code optimisation and adds padding to avoid stack corruption) but nightmare errors in Release mode.

It turned out that the build of Visual Studio I was using had a bug causing bad code to be generated but only in release mode. Un-bloody-believable.
[2020-12-18 14:23:06]
jwick - Posts: 142
Thanks for your suggestions! I think the issue at my end ended up being how delete was handled between a release vs debug. It appears as though when compiling for release, surprisingly, delete set my pointer to null (that's my guess) while for debug it didn't (when later parts of my code was setting the pointer to a new value when the pointer was null, and had assumed delete previously implicitly set the pointer to null.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account