Page 1 of 1

Crash with nearly identical X values in two TPointSeries

Posted: Wed Nov 20, 2019 12:29 pm
by 16586708
Hello,

we discovered a rare but nasty condition when displaying/painting a chart leads to a crash due to an out of memory error.
It is sufficient to have two point series (or line series) in a chart and to add an X value to one series and and a very similar X value to the other series. Then when the chart is painted the program crashes.

I have a attached a simple program (C++Builder 10.2 Tokyo Update 2) to demonstrate the problem. When the button is pressed the program crashes. Please note that the second X value has to be calculated from the input value, otherwise the X values are identical and the error does not occur.

We are using version 2017.23 in our productive system but the crash also occurs with 2019.28.

Please let us know if there is a fix for the problem. As we have the source code version we could also use a source code fix.

Regards

Hans

Re: Crash with nearly identical X values in two TPointSeries

Posted: Wed Nov 27, 2019 4:04 pm
by Marc
Hello Hans,

Your test app crashes when run as you expected. We're looking to see what may be the cause; nothing obvious yet.

Regards,
Marc Meumann

Re: Crash with nearly identical X values in two TPointSeries

Posted: Thu Nov 28, 2019 1:41 pm
by yeray
Hello,

I've added it to the public tracker (#2267).
I'll send you a fix proposal you can test asap.

Re: Crash with nearly identical X values in two TPointSeries

Posted: Fri Nov 29, 2019 10:22 am
by 16586708
Hello Yeray,

the proposed fix solves the problem. There seems to be no regression introduced by the fix.

Thank you very much for the fast support!

Regards

Hans

Re: Crash with nearly identical X values in two TPointSeries

Posted: Fri Nov 29, 2019 12:46 pm
by yeray
Hello,

I'm merging the changes to the base code and closing the ticket.
Thanks for the feedback, Hans.