Stack Overflow when calculating

Is there way to determine where the calculation causes a overflow?


I have provided a stripped down version of the excel, but I fear I might have made the situation worse.

I am able to replicate the issue by loading the excel file provided and attempting a calculate.

I am using Jdk 6 and v7.5.3.3 but the same occurs in v7.5.3

Thanks.

Hi,

Thanks for your posting and using Aspose.Cells for Java.

We were able to replicate the exception using the following code. However, we cannot tell you at this stage where the calculation caused the overflow. We have logged this issue in our database. We will look into it and resolve this issue if possible. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40627.

Java


String filePath = “F:\Shak-Data-RW\Downloads\testcalc-stackoverflow.xls”;


Workbook workbook = new Workbook(filePath);


workbook.calculateFormula();

Exception:
Exception in thread "main" java.lang.StackOverflowError
at java.util.ArrayList.get(Unknown Source)
at com.aspose.cells.RowCollection.a(Unknown Source)
at com.aspose.cells.RowCollection.a(Unknown Source)
at com.aspose.cells.Cells.a(Unknown Source)
at com.aspose.cells.beo.a(Unknown Source)
at com.aspose.cells.beo.A(Unknown Source)
at com.aspose.cells.beo.r(Unknown Source)
.........
at com.aspose.cells.beo.c(Unknown Source)
at com.aspose.cells.beo.a(Unknown Source)

Hi Steven,


Could you please download and use our latest version/fix: Aspose.Cells for Java v7.5.3.3 I have tested with it using the following sample code and template files, it works fine:

Sample code:

String filePath = “testcalc-stackoverflow.xls”;


Workbook workbook = new Workbook(filePath);


workbook.calculateFormula();

workbook.save(outtestcalc-stackoverflow.xls”);


Thank you.

Hi Amjad,


I was already using 7.5.3.3, so I found it odd that the issue did not occur again.

I tried the calculations with different settings and realised that I had increased the calcstack to 1500. Once I set it back to 500 (default) the stack overflow did not occur.

Thanks for your speedy assistance.

Steven.


Hi Steven,

Thanks for your feedback and using Aspose.Cells.

It is good to know that you were able to sort out this issue. We have closed this thread now. If you encounter any other issue, please feel free to post on our forum, we will look into it and help you asap.