Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectInputStream deserialization failure #20916

Open
sukolenvo opened this issue Jan 12, 2025 · 0 comments
Open

ObjectInputStream deserialization failure #20916

sukolenvo opened this issue Jan 12, 2025 · 0 comments

Comments

@sukolenvo
Copy link

Java -version output

One of the affected versions (more info below):

openjdk 21.0.5 2024-10-15 LTS
IBM Semeru Runtime Open Edition 21.0.5.11 (build 21.0.5+11-LTS)
Eclipse OpenJ9 VM 21.0.5.11 (build openj9-0.48.0, JRE 21 Linux amd64-64-Bit Compressed References 20241015_307 (JIT enabled, AOT enabled)
OpenJ9   - 1d5831436e
OMR      - d10a4d553
JCL      - b1b311c53fe based on jdk-21.0.5+11)

Summary of problem

Deserialization using ObjectInputStream fails with java.lang.ClassNotFoundException for simple object graphs with Lists. Here is sample stream to reproduce the problem:

ObjectOutputStream ois = new ObjectOutputStream(...);
ois.writeObject(List.of());
ois.writeObject(List.of(new ClassA(), new ClassB()));

public static class ClassA implements Serializable {
  Object a = List.of(0);
  Object c = new NestedClassA();
}

public static class ClassB implements Serializable {
}

public static class NestedClassA implements Serializable {
}

I've create a repo as well to reproduce the issue: https://github.com/sukolenvo/java-object-serialize-tests
Repo includes matrix of github actions with different jdks: https://github.com/sukolenvo/java-object-serialize-tests/actions/runs/12733637021
zulu, temurin, jetbrains pass both 17 and 21.
adopt-openj9 and semeru fail both 17 and 21.
I believe regression was introduced in 17.0.5 (17.0.4 pass).

This issue affects GWT (gwtproject/gwt#9789) and prevents us from upgrading above ibm-semeru-open-jdk_x64_linux_17.0.4.1_1_openj9-0.33.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant