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 2013/03/06 15:11:44 UTC

[Bug 54645] New: Infinite Loop in IntMapper

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

            Bug ID: 54645
           Summary: Infinite Loop in IntMapper
           Product: POI
           Version: 3.6
          Hardware: PC
                OS: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: imsandli@gmail.com
    Classification: Unclassified

Hi, 

In my application I found from time to time some hanging Threads. The
Threaddumps are always pointing to the POI IntMapper class

    at java.util.HashMap.get(java.lang.Object)
    at org.apache.poi.util.IntMapper.getIndex(java.lang.Object)
    at
org.apache.poi.hssf.record.SSTRecord.addString(org.apache.poi.hssf.record.UnicodeString)
    at
org.apache.poi.hssf.model.Workbook.addSSTString(org.apache.poi.hssf.record.UnicodeString)
    at
org.apache.poi.hssf.usermodel.HSSFCell.setCellValue(org.apache.poi.ss.usermodel.RichTextString)

We are using POI 3.6 but since then, only some code clean up (0111e33d)
happened. This problem probably exists in newer Versions too.


I even found some references in the internet with the same problem:
-
http://mail-archives.apache.org/mod_mbox/poi-user/201212.mbox/%3Cloom.20121220T112250-206@post.gmane.org%3E
-
http://cueabsorb.wordpress.com/2010/12/15/%E4%BD%BF%E7%94%A8hashmap%E5%AF%BC%E8%87%B4cpu-200%E6%88%96%E8%80%85%E5%AF%BC%E8%87%B4%E7%9A%84load-%E9%A3%99%E9%AB%98%E9%97%AE%E9%A2%98/

-- 
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


[Bug 54645] Infinite Loop in IntMapper

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

--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
Just to confirm for anyone looking later and wondering about threading with
POI:

Two threads, each working on different workbooks (or other file formats) should
always be fine

Two threads, trying to work on the same workbook object (or same slideshow,
word doc, poifsfilesystem etc) is not supported

Each workbook / filesystem / etc must only be worked on by one thread. Multiple
threads must each work with their own objects

-- 
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


[Bug 54645] Infinite Loop in IntMapper

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

Nick Burch <ap...@gagravarr.org> changed:

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

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
What are you doing to trigger it?

Is there any chance you could be allowing two different threads to work on the
same open workbook? 

(POI is designed to allow multiple different threads to each access their own
different workbooks, but it isn't designed to let multiple threads work on the
very same workbook object)

As it stands, I can't see anything that might explain why the code would lock
up in regular operation (other than a JVM bug)

-- 
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


[Bug 54645] Infinite Loop in IntMapper

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

Imsand Li <im...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Imsand Li <im...@gmail.com> ---
(In reply to comment #1)
> What are you doing to trigger it?
I profiled the JVM to get the stacktrace. It's a race condition, as the
application is already running several days.

> Is there any chance you could be allowing two different threads to work on
> the same open workbook? 

Yes. It seems like a new bug in our application circumvents the synchronization
of the workbook.

I'm closing the bug.
Thx.

-- 
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