Login Page - Create Account

Support Board


Date/Time: Fri, 10 Jan 2025 16:55:32 +0000



Example with new/delete that crashes SC every time

View Count: 975

[2016-09-23 22:15:29]
DabbaDo - Posts: 148
Attached is file PersistentPointerCrash.cpp.
To crash every time:
Add this study to a chart.
Add a Volume by Price study. (I haven't found another study that will crash.) Apply it but DO NOT press OK.
Edit the VbP study Subgraphs tab by changing a color, e.g. Value Area and Outline. Apply it. I get a memory error. (In debug mode I get "Debug Assertion failed in minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp Line 892").
Debugging through this, SC seems to give me an out-of-date pointer when I call GetPersistentPointer(), but ONLY in this special sequence of commands and ONLY with VbP.
But in this case, it crashes EVERY time.
I could make a screencast and send you a link if necessary.
Or if I need to do more work to document this maybe-bug to you in a simpler fashion, please let me know.
This is version 1463 running on Windows 10.
Thanks,
Dale
attachmentPersistentPointerCrash.cpp - Attached On 2016-09-23 22:00:45 UTC - Size: 2.02 KB - 321 views
Attachment Deleted.
[2016-09-24 00:20:51]
Sierra Chart Engineering - Posts: 104368
Disregard our prior post. We will have a quick look.

This also got us thinking about something related that we want to look into. (Update: verified there is no problem with what we were concerned with)
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-09-24 00:58:00
[2016-09-24 01:39:58]
Sierra Chart Engineering - Posts: 104368
We did not encounter any problems. This is what we saw in the debugger output:


Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Created new p_ClassA=02C09240 | 2016-09-23 21:36:09
Message Log: CLU16 [M] 1 Min #1 | Reloading chart. | 2016-09-23 21:36:09


Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Deleting p_ClassA=02C09240 | 2016-09-23 21:36:10
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Created new p_ClassA=02C09240 | 2016-09-23 21:36:10
The thread 0x4ae0 has exited with code 0 (0x0).
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Deleting p_ClassA=02C09240 | 2016-09-23 21:36:30
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Created new p_ClassA=02C09240 | 2016-09-23 21:36:30


Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Deleting p_ClassA=02C09240 | 2016-09-23 21:36:48
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Created new p_ClassA=02C09240 | 2016-09-23 21:36:48
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Deleting p_ClassA=02C09240 | 2016-09-23 21:36:54
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Created new p_ClassA=02C09240 | 2016-09-23 21:36:54


Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Deleting p_ClassA=02C09240 | 2016-09-23 21:37:00
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Created new p_ClassA=02C09240 | 2016-09-23 21:37:00


Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Entered LastCallToFunction | 2016-09-23 21:37:03 *
Message Log: Chart: CLU16 [M] 1 Min #1 | Study: Dynamic Memory Allocation exception test | Deleting p_ClassA=02C09240 | 2016-09-23 21:37:03

It would be very unlikely there is a problem with in Sierra Chart. The problem is most likely in your own code.

Since your function is calling new and delete you should be able to tell exactly what the source the problem is within your study function without having to rely upon us.


It would be very unlikely there is any problem with getting and setting a persistent pointer and if there is, you should be able to tell us exactly what the problem is.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account