You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/06/29 09:07:23 UTC

DO NOT REPLY [Bug 51448] New: Evaluation Cache gets messed up after 256 sheets

https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

             Bug #: 51448
           Summary: Evaluation Cache gets messed up after 256 sheets
           Product: POI
           Version: 3.8-dev
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
        AssignedTo: dev@poi.apache.org
        ReportedBy: antti.koskimaki@joinex.com
    Classification: Unclassified


Created attachment 27226
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27226
PlainCellCache, raise suitable sheet count to 4096

When updating calculations for Workbook having more than 256 sheets, the
evaluation cache at some point throws exception:

 java.lang.IllegalStateException: value changed
    at
org.apache.poi.ss.formula.EvaluationCache.getPlainValueEntry(EvaluationCache.java:144)
    at
org.apache.poi.ss.formula.EvaluationTracker.acceptPlainValueDependency(EvaluationTracker.java:146)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:258)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:44)


Initial reason is PlainCellCache packing sheet-index to 8 bits, i.e. supporting
only 256 sheets. Excel does not limit sheet number ("is limited by available
memory"), so 256 is far too low limit. Included patch raises the limit to 4096
(12bit), at the same time dropping the workbook count from 256 to 16 (4bit)
which seemed to me more suitable compromise.

Documentation should also point out such "invisible limits" and code should
Assert the situation when such limits are exceeded, instead of just getting
messed up.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 51448] Evaluation Cache gets messed up after 256 sheets

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

Antti Koskimäki <an...@joinex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 51448] Evaluation Cache gets messed up after 256 sheets

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2011-06-30 16:12:06 UTC ---
A unit test demonstrating the problem, please!

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 51448] Evaluation Cache gets messed up after 256 sheets

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

--- Comment #4 from Yegor Kozlov <ye...@dinom.ru> 2011-07-02 09:09:51 UTC ---
Fixed in r1142181, junit added.

I changed the type of the index from int to long. This way the number of
workbook and sheets is unlimited (actually less 65536). 

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 51448] Evaluation Cache gets messed up after 256 sheets

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

--- Comment #2 from Antti Koskimäki <an...@joinex.com> 2011-07-01 09:55:10 UTC ---
Created attachment 27234
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27234
Test code demonstrating the problem

Couldn't find proper documentation on how to write suitable junit for this kind
of bug, but simple test-code demonstrating the problem attached.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 51448] Evaluation Cache gets messed up after 256 sheets

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 51448] Evaluation Cache gets messed up after 256 sheets

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51448

--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> 2011-07-01 13:26:37 UTC ---
It is a pretty low-level stuff. Thanks for digging that deep!

The patch looks good, but I'm inclined to change the type of the index to long.
This way we don't need to compromise between the number of workbooks and
worksheets.

The fix is coming soon - I'm going to write some tests first.

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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