Exception on application exit calling SeriesCount

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Exception on application exit calling SeriesCount

Post by kent_myers » Mon Apr 01, 2013 10:03 pm

I am experiencing an unhandled exception when exiting from an application using TeeChart 912. I had the same problem with 812. Do you know of any reason why this might happen?

The stack trace is attached.

Thanks,
Kent
Attachments
stackTrace_4_1_2013.zip
Stack track of unhandled exception.
(3.74 KiB) Downloaded 697 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Yeray » Tue Apr 02, 2013 1:17 pm

Hi Kent,

Thanks for the stack trace.
However it isn't enough for us to know in what exact situations does the error appear.
Could you please try to simplify your application to the minimum, or even better, start a new one so we can get an as simple as possible application we can run as-is to reproduce the problem here?

Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Thu Apr 04, 2013 9:31 pm

Hi Yeray,

I have extracted my charting code from the main application and have prepared data files that exhibit a couple of exception conditions that I am unable to determine the source of. The zip file is 3MB, so I cannot attach it.

How can I send the file to you?

Thanks,
Kent

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Narcís » Fri Apr 05, 2013 7:04 am

Hi Kent,

Please send it at www.steema.net/upload/.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Fri Apr 05, 2013 4:20 pm

I have uploaded my sample code as TeeChartDemo.zip.

The top level folder contains two input files:
HRM_Export1.csv
HRM_Export2.csv

To reproduce the problem do the following:

- Go to ChartController folder and open the ProjectGroup1.groupproj file to launch Delphi IDE.
- Ignore any error messages that occur while opening the project files.
- The project folder contains all binary files, but you are welcome to rebuild the package and executable.
- Run the application.
- When the form appears, click Button1.
- When the charting window appears, stretch the parent window to see complete form.
- Click the Browse... button and locate the input files described above.
- Select HRM_Export2.csv

There will be an exception occuring the second time that ChartDisplay.Update is called from line 3306 of FormChartTimeSeries.pas. I put a comment there "NOTE: Exception occurs here"
I would like to know the cause of this exception.

If you load HRM_Export1.csv first, no exception will occur and it will be possible to subsequently load HRM_Export2.csv without error. When you exit from the application another exception will occur. Perhaps it is a consequence of the first exception, but I would like to know for sure.

Thanks,
Kent

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Yeray » Mon Apr 08, 2013 10:45 am

Hi Kent,

I can open, build and execute the application without any error. I've also loaded both csv files without errors.
I've used TeeChart v2012.07 and RAD Studio 2010.

On the other hand, note the application is very big for us to debug it and see where the problem (if any) comes from.
Please, try to reduce the application to the minimum where the problem is still reproducible. This process usually ends on the customers finding the root of the problem. If not, we'll be able to get a simple example project we can run as-is to reproduce a possible bug here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Mon Apr 08, 2013 4:00 pm

Hi Yeray,

I am using TeeChart Build 2012.07.121105 with Delphi 2009 Version 12.0.3420.21218. If you are unable to reproduce the error that I am seeing with the large application, I don't see much point in spending the time to make it smaller. Perhaps the problem is related to Delphi 2009.

I will let you know if I come up with a better test case.

Thanks,
Kent

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Yeray » Tue Apr 09, 2013 9:51 am

Hi Kent,
kent_myers wrote:I am using TeeChart Build 2012.07.121105 with Delphi 2009 Version 12.0.3420.21218. If you are unable to reproduce the error that I am seeing with the large application, I don't see much point in spending the time to make it smaller. Perhaps the problem is related to Delphi 2009.
I've tried your application now with Delphi 2009 in the same Windows 7 x64 machine, also with TeeChart v2012.07 and I can load HRM_Export1.csv first and HRM_Export2.csv without errors. I don't see any point in the chart, but I don't get any error either.

I still think the best way to find the root of the problem is to reduce the application so the problem can be easily reproducible and debugable.
kent_myers wrote:I will let you know if I come up with a better test case.
Great.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Tue Apr 09, 2013 8:21 pm

Hi Yeray,

I think that in my explanation of how to reproduce the problem, I indicated that loading HRM_Export1.csv first and loading HRM_Export2.csv second does NOT cause the exception. You must load HRM_Export2.csv first to get the exception. There is also an exception when exiting from the application.

I am not sure from your explanation of how you attempted to reproduce the problem if you followed this prescribed order.

Thanks,
Kent

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Yeray » Wed Apr 10, 2013 2:15 pm

Hi Kent,

Sorry, I didn't explain myself correctly enough. I tried both loading HRM_Export1.csv and then HRM_Export2.csv, and directly HRM_Export2.csv from the beginning.
I open the editor after it, and I can't see any series on the chart.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Fri Apr 19, 2013 9:54 pm

Hi Yeray,

I got the TeeChart source code to compile and build with my application. By debugging I think that I have identified the source of at least one of my problems. My conclusion from debugging is that there is a problem related to Marks in TCustomPolarSeries and TPointSeries.

I hope you still have my previous sample application. The attached FormChartTimeSeries.pas should replace the same file in that application. When I comment out the code in this file that is identified with comments like:
// KWM Comment this block to avoid error during FreeAllSeries
or
// KWM Comment this line to avoid error during FreeAllSeries

then the problem goes away. All are related to adding Text to Marks in a series. Perhaps you will find that I am doing something wrong in the use of these methods, but they are working as I expect.

If the code is left the way it is in the attached file, then there will be an exception when calling FreeAllSeries(). I think the problem is in the clean-up code that is called from FreeAllSeries() that is called when generating a new chart.

Here is the stack trace:

:754f0700 ; C:\Windows\syswow64\LPK.dll
Tee912.TeEngine.TMarksItem.Destroy
:50006c37 TObject.Free + $B
Tee912.TeEngine.TSeriesMarks.Clear
Tee912.TeEngine.TChartSeries.ClearLists
Tee912.TeEngine.TChartSeries.Clear
Tee912.TeEngine.TChartSeries.Destroy
Tee912.Series.TCustomBarSeries.Destroy
:50006c37 TObject.Free + $B
QuicksetChartViewerPlugin.FormChartTimeSeries.TfrmChartTimeSeries.FreeCharts
QuicksetChartViewerPlugin.FormChartTimeSeries.TfrmChartTimeSeries.AllocateChartArrays(7,$6061600,(),(),(),(),(),(),(),(),(),3.0778817523e-275,5,False)
QuicksetChartViewerPlugin.FormChartTimeSeries.TfrmChartTimeSeries.Display(False)
QuicksetChartViewerPlugin.FormChartTimeSeries.TfrmChartTimeSeries.UpdateChart(False)
QuicksetChartViewerPlugin.FormChartTimeSeries.TfrmChartTimeSeries.DisplayChart(True,True,False,True,False,False)
QuicksetChartViewerPlugin.FormChartTimeSeries.TfrmChartTimeSeries.DisplayChart(ctHarmonic,True,False,'C:\Users\kentmy\AppData\Roaming\SEL\AcSELerator\QuickSet\HRM Export 2013-Apr-19.csv',False)

You can use the attached input files to reproduce the problem. These contain more useful data. Reproducing the error usually requires loading more than one of the files in the same session. The exception above occurs when loading the WetSide SSI 12_22_08.csv first, then MAI.csv, then HRM130415.csv.

I can make the application smaller if it is really necessary, but I think I have pinpointed the problem so that you should be able to reproduce and investigate it with this app.

Let me know if you have questions.

Thanks,
Kent
Attachments
SampleAppUpdate.zip
Replacement source file
(62.63 KiB) Downloaded 706 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Yeray » Tue Apr 23, 2013 10:39 am

Hi,
kent_myers wrote:I got the TeeChart source code to compile and build with my application. By debugging I think that I have identified the source of at least one of my problems. My conclusion from debugging is that there is a problem related to Marks in TCustomPolarSeries and TPointSeries.
It would be nice if we could get a simple example project we can run as-is to reproduce the problem here. The application you sent is too big for us to debug it.
kent_myers wrote:I hope you still have my previous sample application. The attached FormChartTimeSeries.pas should replace the same file in that application.
Yes we still have it. However, when I replace the file you mention, I get some errors regarding some units that are not found: ClassLoadProfileFile_010, SpecialFolders, SELUtilitiesFuncs and CenterMessageBox. And there are some functions that seem to need these units.
kent_myers wrote:I can make the application smaller if it is really necessary, but I think I have pinpointed the problem so that you should be able to reproduce and investigate it with this app.
If the problem is what you seem to suspect and describe, it should be easier for you to create a simple application (with just a form, a chart on it, and a few lines of code) than for us to debug and track 17 .pas and about 15 thousand lines of code...
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Tue Apr 23, 2013 4:27 pm

Hi Yeray,

I zipped a new version of the app called TeeChartDemo2.zip. I removed the references that caused problems for you. This version was built using the TeeChart source code. Since the complete build package was too large to upload, I had to remove all the teechart bpls and dcps. (NOTE: Our development environment forces warnings to be treated as errors. You may need to reset this in the package options Hints and Warnings)

I cannot give you a specific recipe for what sequence of file imports will result in a crash. I just keep loading csv files in various orders and eventually it will crash. For example, one time I got a crash if I load the input files in the following order: MAV.csv, WetSide SSI 12_22_08.csv, HRM130415.csv. See the traceback below. Sometimes I get different error if I load the WetSidexxx file and then use the cursor query (pick icon that has cross-hairs) to point to the labels, then import a different csv file. I believe that all of the errors are related to memory cleanup operations that are somehow related to changing from one chartseries type to another, but I cannot prove it.

Most of the source files in this app are small base class files or are used to parse the input files, so you do not need to worry about them. All of the interaction with the TeeChart functions is done in FormChartTimeSeries.pas. The app needs to support different chart types in order to demonstrate the problem, so it is going to be difficult to make is smaller.

Please see if you can reproduce any of the issues I have described using this app. If I can find a specific sequence of operations that reliably produces a particular error, I will let you know.

Thanks,
Kent

:004041ca TObject.InheritsFrom + $2
TeCanvas.TTeeCanvas.AssignFont(???)
Chart.TLegendTitle.CalcHeight
Chart.TCustomChartLegend.DrawLegend
Chart.TCustomChart.DrawTitlesAndLegend(True)
TeEngine.TCustomAxisPanel.InternalDraw((0, 0, 734, 530, (0, 0), (734, 530)))
TeeProcs.TCustomTeePanel.Draw($24E77B0,(0, 0, 734, 530, (0, 0), (734, 530)))
TeeProcs.TCustomTeePanel.Draw
TeeProcs.TCustomTeePanel.Paint
:004f501d TCustomTeePanel.Draw + $21
:004aa3cf TWinControl.PaintHandler + $5B
:004aaba1 TWinControl.WMPaint + $4D
:004af2d5 TCustomControl.WMPaint + $15
:004aa218 TWinControl.WndProc + $518
TeeProcs.TCustomTeePanel.WndProc(???)
:004f5819 TCustomTeePanel.WndProc + $11
:004351f6 StdWndProc + $16
:755262fa ; C:\Windows\syswow64\USER32.dll
:75527316 USER32.GetDC + 0x52
:75526de8 ; C:\Windows\syswow64\USER32.dll
:75526e44 ; C:\Windows\syswow64\USER32.dll
:77af010a ntdll.KiUserCallbackDispatcher + 0x2e
:004aceb6 TWinControl.Update + $1A
FormChartTimeSeries.TfrmChartTimeSeries.DisplayChartFile('Z:\TeeChartDemo\HRM130415.csv')
FormChartTimeSeries.TfrmChartTimeSeries.ButtonImportClick(???)
:004a627d TControl.Click + $75
:004aa218 TWinControl.WndProc + $518
:004549b1 TButtonControl.WndProc + $71
:004aa368 DoControlMsg + $28
:004aa218 TWinControl.WndProc + $518
:004a992f TWinControl.MainWndProc + $2F
:004351f6 StdWndProc + $16
:755262fa ; C:\Windows\syswow64\USER32.dll
:75526d3a USER32.GetThreadDesktop + 0xd7
:7552965e ; C:\Windows\syswow64\USER32.dll
:755296c5 USER32.SendMessageW + 0x4c
:749d4601 ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
:749d4663 ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
:749d44ed ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
:755262fa ; C:\Windows\syswow64\USER32.dll
:75526d3a USER32.GetThreadDesktop + 0xd7
:75530d27 USER32.GetClientRect + 0xc5
:75530d4d USER32.CallWindowProcW + 0x1b
:004aa314 TWinControl.DefaultHandler + $DC
:004aa218 TWinControl.WndProc + $518
:004549b1 TButtonControl.WndProc + $71
:004351f6 StdWndProc + $16
:755262fa ; C:\Windows\syswow64\USER32.dll
:75526d3a USER32.GetThreadDesktop + 0xd7
:755277c4 ; C:\Windows\syswow64\USER32.dll
:7552788a USER32.DispatchMessageW + 0xf
:004c6f6a TApplication.ProcessMessage + $122

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception on application exit calling SeriesCount

Post by Yeray » Wed Apr 24, 2013 9:35 am

Hi,

I can't reproduce any TeeChart error with this either.
What happens to me here is that after loading one or two of the files (in the [MAV.csv, WetSide SSI 12_22_08.csv, HRM130415.csv] sequence), when I click the Browse button, the whole IDE hangs.
I kill the Project1.exe through the task manager and then I get this error message:
bds.exe - bordbk120N.dll
Assertion failure: "(!"SetThreadContext failed")"
in ..\win32src\thread32.cpp at line 434
Continue execution?
Yes No
Is this the error you are getting?
I answer "No" and then the IDE gets responsive but I still see Project1.exe running in the task manager and in the task bar. I can't kill it in the task manager so I close the IDE. Then the execution of the Project1.exe finishes.
Debugging it, I see the hang happens when the line 4426 in FormChartTimeSeries.pas is executed:

Code: Select all

    if openDialog.Execute then
openDialog is an instance of the TOpenDialog class, so I don't think this is the error you suspect to be TeeChart related.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kent_myers
Newbie
Newbie
Posts: 23
Joined: Wed Feb 13, 2013 12:00 am

Re: Exception on application exit calling SeriesCount

Post by kent_myers » Wed Apr 24, 2013 4:27 pm

Hi Yeray,

I have never gotten the error that you reported. I assume you tried a variety of sequences of file imports. Did you also try the query operation? This operation interacts with the chart markers by feeding back the data that is attached to the marker into the title of the chart when you position the mouse cursor over the marker (this can be done with MAV.csv or Wetsidexxx.csv) I don't get an error during the query operation, but when I import a different data file, then I get the error that I sent to you (sometimes).

I will keep trying to find a more deterministic/reproducible error condition and let you know.

Thanks,
Kent

Post Reply