serialVersionUID for Keyword and ArraySeq changed unnecessarily in 1.11.0

Description

Clojure 1.11 had implementation changes in Keyword and ArraySeq. Due to this, the computed serialVersionUID used by Java serialization changed, however the fields affecting serialization did not. These classes should follow the standard Java advice to define a serialVersionUID and only change it when the serialization changes.

This is a general problem with all Clojure Serializable classes and that will be tracked in the existing https://clojure.atlassian.net/browse/CLJ-1327 in a future release. In this ticket we are considering only these two classes that changed in 1.11.

Approach: Set the Clojure 1.10.3 serialVersionUID versions in 1.11.1 so they continue to match (these can be obtained with the serialver tool in the JDK.

Patch: clj-2701.patch

Test harness: https://github.com/puredanger/clj-2701

Screened by: fogus

Environment

None

Attachments

1
  • 30 Mar 2022, 08:42 PM

Activity

Show:

Alex MillerApril 1, 2022 at 6:28 PM

Released in 1.11.1-rc1

Michael FogusApril 1, 2022 at 2:50 PM

Ran through the code change and applied the patch. Ran the de/serialization tasks through 1.10.3->1.11.0 and observed failure. Built patched version 1.12.0-master-SNAPSHOT and re-ran de/serialization tasks observing passed tests. Additionally, loaded up cli-uuid which relies on serialization format to build v5 UUIDs and observed 1.10.3->1.11.0 mismatch. Running same code in 1.12.0-master-SNAPSHOT showed match with pre-1.11 generated UUIDs. This was the original case that motivated this work and detailed at https://ask.clojure.org/index.php/11658/clj-uuid-v5-uuids-inconsistent-after-clojure-1-11-0 .

Fixed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created March 30, 2022 at 8:36 PM
Updated April 1, 2022 at 6:28 PM
Resolved April 1, 2022 at 6:28 PM

Flag notifications