poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60405] New: AIOOBE: -32725 when loading an Excel file that includes some Excel 4.0 macros
Date Tue, 22 Nov 2016 21:36:40 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60405

            Bug ID: 60405
           Summary: AIOOBE: -32725 when loading an Excel file that
                    includes some Excel 4.0 macros
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: martin.oberhuber@gmx.at
  Target Milestone: ---

Created attachment 34467
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34467&action=edit
MyWB.xls containing Excel 4.0 macro functions

I'm using poi-3.15 from Sourceforge Docfetcher, to index Excel documents (among
others) for searching. On attached document, the following exception is thrown,
making it impossible to access any data of the document; this is a severe issue
that I don't have any workaround for.


java.lang.ArrayIndexOutOfBoundsException: -32725
        at
org.apache.poi.ss.formula.function.FunctionMetadataRegistry.getFunctionByIndexInternal(FunctionMetadataRegistry.java:66)
        at
org.apache.poi.ss.formula.function.FunctionMetadataRegistry.getFunctionByIndex(FunctionMetadataRegistry.java:62)
        at org.apache.poi.ss.formula.ptg.FuncVarPtg.create(FuncVarPtg.java:56)
        at org.apache.poi.ss.formula.ptg.FuncVarPtg.create(FuncVarPtg.java:45)
        at org.apache.poi.ss.formula.ptg.Ptg.createClassifiedPtg(Ptg.java:103)
        at org.apache.poi.ss.formula.ptg.Ptg.createPtg(Ptg.java:84)
        at org.apache.poi.ss.formula.ptg.Ptg.readTokens(Ptg.java:55)
        at org.apache.poi.ss.formula.Formula.getTokens(Formula.java:82)
        at
org.apache.poi.hssf.record.FormulaRecord.getParsedExpression(FormulaRecord.java:314)
        at
org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate.getFormulaTokens(FormulaRecordAggregate.java:201)
        at
org.apache.poi.hssf.usermodel.HSSFCell.getCellFormula(HSSFCell.java:649)
        at
org.apache.poi.hssf.extractor.ExcelExtractor.getText(ExcelExtractor.java:339)
        at
net.sourceforge.docfetcher.model.parse.MSExcelParser.renderText(MSExcelParser.java:57)


The issue is severe, since no other contents from the Excel file is available,
due to the exception. Docfetcher runs POI like this:

    POIFSFileSystem fs = new POIFSFileSystem(in);
    extractor = new ExcelExtractor(fs);
    extractor.setFormulasNotResults(true);
    return extractor.getText();

Running my testcase in the debugger, the exception seems to occur on the sheet
"Macro1" row 1 column 0 which contains this:
    =ALIGNMENT(2;FALSE;1;0;FALSE)
which appears to relate to this FormulaRecord._byteEncoding:
    [30, 2, 0, 29, 0, 30, 1, 0, 30, 0, 0, 29, 0, 66, 5, 43, -128]

Note that the document must be opened with "Macros disabled" in order to make
this contents visible in Excel. The particular sheet contains several other
"Excel 4.0 macro functions".

Expected behavior would be, that POI can ignore unknown
functions/formulas/macros, such that at least the rest of the document can be
indexed for search.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message