Issue Details (XML | Word | Printable)

Key: CDV-907
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: 2 Major 2 Major
Assignee: Hung Huynh
Reporter: Scott Bale
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Community Development

HashMap Serialization can have unresolved references

Created: 16/Sep/08 12:31 PM   Updated: 02/Nov/08 10:45 PM   Resolved: 19/Sep/08 07:31 AM
Component/s: None
Affects Version/s: 2.7.0-stable1
Fix Version/s: 2.7.0

Issue Links:
Related
 

Severity: 2 Feature failure (but system usable), no workaround available
Fix In Branch: trunk
Fixed In Revision: 10142
Bug Found In Detail: 2.7


 Description  « Hide

Similarly to CDV-244, we've found that HashMap (prior to JDK 1.6) serialization defeats TC instrumentation, which can lead to a serialized HashMap with unresolved references.

More specifically, the serialized HashMap can contain Terracotta ObjectID's rather than the expected values, leading to a ClassCastException. This is because the writeObject() method of HashMap (prior to JDK 1.6) calls private method entrySet0(), which we do not instrument, rather than public method entrySet(), which we do instrument.

We already have this bug reproduced in a system test and I am working on it.

(Tim found that this was apparently a bug that was fixed in JDK 1.6 - see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6280967 )



Sort Order: Ascending order - Click to sort in descending order
Scott Bale added a comment - 16/Sep/08 12:34 PM

similar serialization bug, affecting Exam caching


Scott Bale added a comment - 16/Sep/08 01:57 PM

Last night I found that the writeObject() method of HashMap uses a private non-instrumented entrySet0() method to retrieve entries, rather than the public, Terracotta-instrumented entrySet method.

Today, Tim found this is only true in source code of JDK 1.4 and 1.6 but NOT JDK 1.5! That's not a misprint.

I checked with Himadri, and sure enough he was using JDK 1.6. I have been using JDK 1.5, which explains why I never saw this ClassCastException before.

Also, the system test I wrote passes (predictably) with JDK 1.5 and fails (predictably) with JDK 1.4. So I think we're on the right track.


Scott Bale added a comment - 19/Sep/08 07:31 AM

fixed in trunk (10114, 10118, 10142) and 2.7 branch (10155)