Bug 54400 - StackOverflowError formatting a cell value which contains a formula
Summary: StackOverflowError formatting a cell value which contains a formula
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.7-FINAL
Hardware: PC Mac OS X 10.4
: P2 major with 2 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2013-01-10 06:44 UTC by Trejkaz (pen name)
Modified: 2015-08-01 11:53 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Trejkaz (pen name) 2013-01-10 06:44:23 UTC
A collection of Excel files trigger a StackOverflowException with both POI 3.7 and 3.9.

Attached is the first file where I have managed to track it down to the problematic cell. There are two other files supposedly with the same issue. This is all publicly-accessible data, as I understand it.

Minimal code required for reproduction:

    public void test() throws Exception
        File file = new File("z:\\Data\\swapgraph.xls");

        HSSFWorkbook workbook = new HSSFWorkbook(new POIFSFileSystem(new FileInputStream(file)));
        HSSFSheet sheet = workbook.getSheetAt(25);
        HSSFRow row = sheet.getRow(5);
        HSSFCell cell = row.getCell(1);
        new HSSFDataFormatter().formatCellValue(cell, new HSSFFormulaEvaluator(workbook));

Stack trace I have pasted here: http://pastie.org/5659697
Comment 1 Yegor Kozlov 2013-01-11 05:34:46 UTC
The attachment is missing, please try again.

Comment 2 Trejkaz (pen name) 2013-01-11 06:15:47 UTC
"The file you are trying to attach is 5102 kilobytes (KB) in size. Attachments cannot be more than 1000 KB. 
We recommend that you store your attachment elsewhere and then paste the URL to this file on the attachment creation page in the appropriate text field."

If you have a better place for this, feel free to suggest one.

Limiting the size of attachments doesn't really make for a productive bug tracker.
Comment 3 Yegor Kozlov 2013-01-11 07:59:30 UTC
The 5MB restriction is not set by POI, we can't increase the attachement limit. 

Option 1: Can you remove all sheets/rows/cells other than the problematic one  and attach the reduced file?  

Option2: Can you put the bug file in Dropbox or Google Drive or in any other file tracker ?
Comment 4 Trejkaz (pen name) 2013-01-14 00:56:19 UTC
Hopefully this is accessible.


I tried to remove sheets but the error changes as a result. Even if I don't remove a sheet, just opening and closing the file with POI is enough to change the error from one error to a different error.
Comment 5 yvesdm 2014-01-16 11:13:22 UTC
Is it possible to provide your swapgraph.xls again ?
Comment 6 Dominik Stadler 2015-06-01 21:20:29 UTC
Sample file is not available any more, so we cannot reproduce this problem, therefore resolving this for now, please reopen with more information if this is still a problem for you.
Comment 7 Trejkaz (pen name) 2015-08-01 11:53:14 UTC
Even if I manage to find the attachment:

1. The bug tracker won't let me attach it because you have the limit set
   too low.

2. If I post it elsewhere, nobody will ever look at it and then someone
   will be asking for it again in a few years, just like this time.

Maybe you could get a copy off the last person who asked for it?