JDK-8237368 : Problem with NullPointerException in RMI TCPEndpoint.read
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 8u241,11.0.6,13.0.2,14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2020-01-16
  • Updated: 2020-07-14
  • Resolved: 2020-01-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14 JDK 15 JDK 7 JDK 8 Other
11.0.7-oracleFixed 13.0.3Fixed 14 b34Fixed 15Fixed 7u261Fixed 8u251Fixed openjdk7uFixed
Description
After upgrading to Java 1.8.0_241, 11.0.6, and 13.0.2, and
then noticed NullPointerExceptions.

A small test case that reproduces the problem is attached.

The test works in 1.8.0_231 and 11.0.5, but fails in 1.8.0_241 with:

  Registry binding failed
  java.lang.NullPointerException
	at sun.rmi.transport.tcp.TCPEndpoint.read(TCPEndpoint.java:557)
	at sun.rmi.transport.LiveRef.read(LiveRef.java:292)
	at sun.rmi.server.UnicastRef2.readExternal(UnicastRef2.java:78)
	at java.rmi.server.RemoteObject.readObject(RemoteObject.java:455)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2232)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2123)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1624)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2341)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2265)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2123)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1624)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:464)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
	at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:154)
	at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:469)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:301)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:379)
	at sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:158)
	at TCPEndpointReadBug.main(TCPEndpointReadBug.java:88)
Comments
Fix Request (13u) Patch applies perfectly to openjdk-13u, regtest behaves right before and after the fix.
25-03-2020

Fix Request (8u) This fixes the regression caused by Jan 2020 CPU. Patch does not apply cleanly to 8u, requires reshuffles. New test fails without the product patch, passes with it. Additionally, tier1 passes. 8u RFR (reviewed by phh): https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-February/011163.html
17-02-2020

Changeset: 2760497b Author: Roger Riggs <rriggs@openjdk.org> Date: 2020-01-24 13:33:31 +0000 URL: https://git.openjdk.java.net/panama-foreign/commit/2760497b
07-02-2020

Fix Request (11u) This fixes the regression caused by Jan 2020 CPU. Patch applies cleanly to 11u. New test fails without the product patch, passes with it. Additionally, tier1 and tier2 pass.
27-01-2020

URL: https://hg.openjdk.java.net/jdk/jdk14/rev/39df849b3896 User: rriggs Date: 2020-01-24 18:38:21 +0000
24-01-2020

Fix request approved This is a regression in JDK 14, the fix is low risk.
23-01-2020

Fix Request This fixes a regression in the recent CPU patch for 8230967 resulting in NPE exceptions. It adds a missing check for null to avoid the exception and is very low risk. A new test is added to test this specific case and the normal tier1-tier3 tests run w/o errors. Mandy Chung and Alan Bateman have reviewed the fix. The review thread is: https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-January/064427.html The webrev is: http://cr.openjdk.java.net/~rriggs/webrev-proxy-8237368/
17-01-2020

As described, null is a valid socket factory value.
16-01-2020