Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 13:53:29 +0000



Post From: Problem with sc.GetOrderFillEntry / s_SCOrderFillData in versions 2742+

[2025-03-05 10:49:37]
User907968 - Posts: 840
I have a problem with trading systems built on version of Sierra Chart earlier than 2742.
In the latest versions of SC, when sc.GetOrderFillEntry is called, either the program immediately crashes, or the cpu exception message appears in the message log.
I notice that at version 2742, the s_SCOrderFillData structure had a new member added and was updated to version 5, I would assume that it is related to this change, but maybe I am wrong.


Here is are some example of code from one of the systems:


const auto listSize = sc.GetOrderFillArraySize();

if (listSize == 0)
return;

auto orderFills = std::vector<s_SCOrderFillData>{};
auto listIndex = listSize;
auto orderFill = s_SCOrderFillData{};

while (listIndex > 0)
{
listIndex--;

if (!sc.GetOrderFillEntry(listIndex, orderFill))
continue;

orderFills.push_back(orderFill);
}

Here is the output when sc.GetOrderFillEntry is called in the above example:
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in SierraChart_64.exe.
Unhandled exception at 0x00007FF924E0F3C9 (ntdll.dll) in SierraChart_64.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FF924E797F0).



auto fillIndex = sc.GetOrderFillArraySize();

if (fillIndex == 0)
return false;

while (fillIndex > 0)
{
auto order = s_SCOrderFillData{};

if (!sc.GetOrderFillEntry(--fillIndex, order))
continue;

if (order.InternalOrderID == orderID)
return true;
}

Here is the output when sc.GetOrderFillEntry is called with this example:
Run-Time Check Failure #2 - Stack around the variable 'order' was corrupted.
Exception thrown at 0x0000000140459A9E in SierraChart_64.exe: 0xC0000005: Access violation reading location 0x0000000000000298.