Bug 32076 - biff view throws exception.
Summary: biff view throws exception.
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 2.5-FINAL
Hardware: Other other
: P3 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2004-11-05 04:42 UTC by as
Modified: 2010-06-10 11:13 UTC (History)
0 users

input file for biff view. (71.00 KB, application/octet-stream)
2004-11-05 04:45 UTC, as

Note You need to log in before you can comment on or make changes to this bug.
Description as 2004-11-05 04:42:34 UTC
I am trying to biff view one file and it threw the following exception.

java.io.IOException: block[ 0 ] already removed
	at org.apache.poi.poifs.storage.BlockListImpl.remove
	at org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks
	at org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks
	at org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties
	at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>
	at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer.java:70)
	at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:652)
Comment 1 as 2004-11-05 04:45:02 UTC
Created attachment 13334 [details]
input file for biff view.
Comment 2 as 2004-11-08 05:48:19 UTC
guys , i could resolve this problem by putting a hack .Tell me if it is a 
valid solution

 but my assumption that i have resoved the problem as per bug#31979  is 
resolved is wrong..:(

In POIFSFileSystem.java In processProperties method

I added a check for size
              if(size > 0) {

                if (property.shouldUseSmallBlocks())
                    document =
                        new POIFSDocument(name, small_blocks
                            .fetchBlocks(startBlock), size);
                    document =
                        new POIFSDocument(name,
Comment 3 Avik Sengupta 2004-11-18 16:21:45 UTC
Does this file open correctly in Excel? How is this file produced? 

We need to be careful about changes to POIFileSystem, since it might have wider
repurcussions. At the very least, we need a testcase demonstrating the error and
the fix. 

Also I dont understand your reference to bug 31979. Does this patch fix that
one? Lets discuss this on the dev lists... bugzilla is rotten to have a
conversation on.
Comment 4 David Fisher 2008-12-29 14:48:04 UTC
Please try with the latest release and see if this is still trouble. If so then please provide the smallest file that recreates the problem and describe how it was created.
Comment 5 Nick Burch 2010-06-10 11:13:55 UTC
POIFS has had a number of fixes since this bug was opened. As nothing more has been heard in many years, assuming this has now been fixed