Jump to content
rudy999

Delphi 13 and built in TCHART - Access violation when recreating new data for pens

Recommended Posts

I am just starting to investigate and will submit when I can re create the issue on a brand new application. But I was wondering if anyone else has already noticed this..

I have an application developed in Delphi 11 and Delphi 12. I still have Delphi 12 also and the application has had no issue with rendering the TCHART.

 

After compiling in Delphi 13 the issue has been observed.  The initial populating of series in the TCHART is ok. But if the series are deleted and added with new data, the exception occurs. I use a PageControl and the TCHart is in a TabSheet. Once this exception occurs and I change the page away and then back to the TChart tabsheet the exception occurs again -seems like a rendering issue.

The application in question has a lot going on. I will create a simple application and investigate the results and contact Embarcadero.

 

 

Error:

ExceptionMessage="Access violation at address 00D6324B. Read of address 00000040"
ExceptionName="EAccessViolation"
ExceptionDisplayName="$C0000005"
ExceptionAddress=00D6324B
FileName="VCLTee.Chart.pas"
LineNumber=7005

Share this post


Link to post

was: // Thanks for the testing project, we'll investigate it and let you know.

 

I couldn't reproduce the AV just clicking the add and delete buttons, should I click or move the mouse after that?

Edited by david berneda

Share this post


Link to post

One thing you might try is to replace this code with a call to FreeAllSeries, because calling Delete does not destroy the series.


 

procedure TfrmMain.btnDelPensClick(Sender: TObject);
var
     I: Integer;
begin
  chtData.FreeAllSeries;

  {
     for I := chtData.SeriesList.Count - 1 downto 0 do
          chtData.SeriesList.Delete(I);

  chtData.Invalidate;
  }
end;

 

Share this post


Link to post

With the compiled application I get the exception immediately 

steps: 

1. click btnAddPens - this is ok

2. click btnDelPens - immediate error 

image.thumb.png.1394553f08508d045e3ee98378128b1a.png

what is the code at:

FileName="VCLTee.Chart.pas"
LineNumber=7005

Share this post


Link to post

Perfect, we could also reproduce it and found the cause. The bug was fixed some time ago but the fix was not included in RAD 13.0.

 

It is related to chart legend items.

 

I'll send you now a private message with a link to a potential fix patch.

 

 

 

Share this post


Link to post
8 hours ago, david berneda said:

Perfect, we could also reproduce it and found the cause. The bug was fixed some time ago but the fix was not included in RAD 13.0.

 

It is related to chart legend items.

 

I'll send you now a private message with a link to a potential fix patch.

This doesn't make a lot of sense to me.  If it was fixed, why wasn't the fix included in the Rad 13 version?  And how about the rest of us that use TChart?

  • Like 1

Share this post


Link to post

The fix was for a different problem but it also fixed this particular one. We sent new builds to Embarcadero ahead of time, during the beta period, that was before this fix. 

 

We will publish a patch soon at steema.com, with this fix and other fixes if new bugs appear, hopefully not.

 

 

  • Like 1

Share this post


Link to post

If this bug is affecting you right now, we can send you a temporary patch but it has not been fully tested, its just the affected units recompiled dcu (no packages).

 

Share this post


Link to post

It is not affecting me right now, I was just wondering about the process.  Thanks for the clarification.

  • Like 1

Share this post


Link to post

Another workaround for this AV bug, is to clear the chart legend items after deleting the series:

 

procedure TfrmMain.btnDelPensClick(Sender: TObject);
var
     I: Integer;
begin
  chtData.FreeAllSeries;



{

     for I := chtData.SeriesList.Count - 1 downto 0 do
          chtData.SeriesList.Delete(I);

  chtData.Invalidate;

}



  chtData.Legend.Items.Clear;    // <--- THIS
end;


 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×