commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Jakarta-commons Wiki] Update of "CollectionsMysteriousNullPointerException" by RobertBurrellDonkin
Date Mon, 28 Nov 2005 22:02:22 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" for change notification.

The following page has been changed by RobertBurrellDonkin:

The comment on the change is:
Page to record results for LRUMap mystery

New page:
= The Collections Mysterious LRUMap NullPointerException =

See [ Bug 32573]

The Collections 3.1 LRUMap has been reported to throw unexpected NullPointerException's. What
is mysterious is that these have only only ever been observed by a small number of users in
production code. Attempts to replicate this phenomenum under laboratory conditions have (so
far) failed.

This map (as with the majority of the maps, collections and bags in commons-collections) should
be externally synchronized (by using - for example - Collections.synchronizeMap) when used
in a multithreaded environment. When not appropriately synchronized, our analysis of the code
indicates that NullPointerExceptions may be thrown. However, all those who have analysed the
code have yet to find a use case when a NullPointerException will be thrown when the map is
appropriately synchronized. 

So far, a definitive cause eludes us. It may be that this issue is caused by inappropriate
synchronization or by problems with sychronization code in one or more JVMs. If you think
you can help us solve this mystery, please email the [
commons developer list] or edit this wiki page (at the bottom, if you please).

== SOAK Tests ==

In order to try to discover whether this is a real issue but limited to certain environments
(for example, only in particular JVMs or in multiprocessor machines), volunteers have run
long running SOAK tests on various environment. The commons-collections team would be very
grateful to anyone else who is willing to donate some cycles and record their results below.

Just to report that I have run the synchronized soak test using 5
threads and 10,000,000 loops on

AlphaServer 4X00 5/400 4MB, 4 CPUs

OpenVMS 7.3-1

java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition
Fast VM (build 1.4.0-1, build J2SDK.v.1.4.0:01/10/2003-09:47, native
threads, jit_140)

Just for the record, since everyone might not have access to these
platforms, I saw the same results as Phil while running SoakLRUMap
overnight on Mac OS X 10.4.3 dual-G4 and dual-G5 hardware with java
versions 1.4.2_09 and 1.5.0_05.

10 days running constantly on a Debian box using Sun JRE 1.5.0-04 without NPEs

Thanks to:
 * Sebb 
 * Michael Heuer

(Volunteers please feel free to append your name and record your results. The SOAK tests are
attached to the bug.)


= Solutions To The Mystery Below, Please =

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message