Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 662

Summary: Crash when area is zero
Product: FireMonkey TeeChart Reporter: Daniel Marschall <daniel.marschall>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: minor CC: david, sandra
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: Tablet   
OS: Android   
Chart Series: --- Delphi / C++ Builder RAD IDE Version: RAD XE5

Description Daniel Marschall 2014-03-24 08:55:38 EDT
We accidently created a 2-axis chart with following values:

yMin=0,
yMax=0,
xMin=0,
xMax=0,

when we launched the application, it just did close. No Exception was thrown. I think it might be an internal DivByZero-Exception which was not catched by Delphi?

Solution: An Exception should always be thrown. Not just closing the app.
Comment 1 david berneda 2014-03-24 12:29:58 EDT
Cannot reproduce.
I made a FireMonkey Delphi project using XE5, with the code below, and executed fine in Android device:

procedure TForm213.FormCreate(Sender: TObject);
begin
  Chart1.Axes.Left.SetMinMax(0,0);
  Chart1.Axes.Bottom.SetMinMax(0,0);
end;

Are you doing something different?
Comment 2 Daniel Marschall 2014-03-24 13:40:55 EDT
(Bezüglich comment 1 von david berneda)
> Are you doing something different?

Hello,

I did use:

LeftAxis.Min := 0;
LeftAxis.Max := 0;
BottomAxis.Min := 0;
BottomAxis.Max := 0;

I can test it with a new project tomorrow to isolate the behavior.
Comment 3 Daniel Marschall 2014-03-24 13:43:38 EDT
Correction: The Code is actually:

  Chart1.BottomAxis.Minimum := InterpretedMetadata.xMin;
  Chart1.BottomAxis.Maximum := InterpretedMetadata.xMax;
  Chart1.LeftAxis.Minimum   := InterpretedMetadata.yMin;
  Chart1.LeftAxis.Maximum   := InterpretedMetadata.yMax;

Where InterpretedMetadata is an accidently empty record with all double's set to 0.
Comment 4 Daniel Marschall 2014-03-25 07:33:49 EDT
Hello,

I could successfully reproduce the bug with all my mobile devices.

Btw, do you know why the app just closes? I have experienced many cases of AccessViolations where the app just closed instead of showing at least an error message. Is this a bug in Delphi's RTL? (I use XE5 SP2)

http://download.rinntech.com/marschall/Bug662-Reproduction.zip
Comment 5 Daniel Marschall 2014-03-25 08:27:56 EDT
Hello,

I just installed the Update http://cc.embarcadero.com/item/29708 . The app doesn't close now and brings the message "Axis Minimum Value must be <= Maximum".

(The problem was actually the uninitialized record, which did have random values instead of zeros)

You can mark the bug as already fixed.

But could you still explain, why the app closes in some kinds of Exceptions, please? Should Embarcadero be informed about this?
Comment 6 david berneda 2014-03-27 14:07:44 EDT
XE5 Update2 fixed one similar case (access violation closing Android app):

http://qc.embarcadero.com/wc/qcmain.aspx?d=117507

There might be other related issues. XE5 Update 2 has several fixes similar:
http://edn.embarcadero.com/article/43522

I'll investigate and try to determine the cause, TeeChart Axis has some protection against floating point overflows, maybe these aren't working fine in Android.