Bug 48475 - Escher properties initialization lockup on multi-threaded start
Summary: Escher properties initialization lockup on multi-threaded start
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.7-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2010-01-02 10:17 UTC by Mike Flester
Modified: 2015-12-28 20:47 UTC (History)
0 users



Attachments
patch to protect EscherProperties initialization, against trunk 2010-01-02 (888 bytes, patch)
2010-01-02 10:17 UTC, Mike Flester
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Flester 2010-01-02 10:17:44 UTC
Created attachment 24786 [details]
patch to protect EscherProperties initialization, against trunk 2010-01-02

When multiple Word 97 documents hit our multi-threaded system the initial load of EscherProperties can cause a lockup. The attached patch protects the initialization phase of this class. Since it is loading a static HashMap it needs this protection to get loaded safely.
Comment 1 Josh Micich 2010-01-02 11:11:21 UTC
Your patch doesn't seem to change anything.  I am almost certain that either version of this source file compiles to the same bytecode.

I know synchronization errors are very difficult to prove, but can you at least write a non-deterministic test case (i.e. one that fails sometimes) to show that there is actually a problem here.

A problem with a very similar description was 'fixed' with bug 47412.  The problem there was much more obvious (concurrent access to a single map object referenced by  a static field).  Hopefully the 'fix' was obvious too (no test provided).

From what I understand, the JVM guarantees class initialisation to be synchronized, so the current code looks fine to me.  I'm happy to be proven wrong, but I don't see any point in making an apparent change that actually does nothing.
Comment 2 Dominik Stadler 2015-12-28 20:47:07 UTC
No response for a very long time, therefore we are closing this as WONTFIX for now as it does not seem to occur in any other usage. Also I think static initialization is guaranteed to run thread-safe and the only thing that would happen here would be that multiple instances of the map would be created and assigned, leaving the last one in place at the end, or?