Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333106

Summary: Occasional NullPointerException in SslSelectChannelEndpoint
Product: [RT] Jetty Reporter: Jeremy Stone <jeremy.stone>
Component: buildAssignee: Greg Wilkins <gregw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jesse.mcconnell, jetty-inbox, mgorovoy
Version: 7.1.3   
Target Milestone: 7.1.x   
Hardware: All   
OS: All   
Whiteboard:

Description Jeremy Stone CLA 2010-12-22 11:39:54 EST
Build Identifier: 7.1.6.v20100715

Stack trace:
2010-12-22 16:18:09,856 2324639 WARN  [org.eclipse.jetty.util.log] (jetty-364:)   handle failed
java.lang.NullPointerException
	at org.eclipse.jetty.io.nio.SslSelectChannelEndPoint.unwrap(SslSelectChannelEndPoint.java:727)
	at org.eclipse.jetty.io.nio.SslSelectChannelEndPoint.fill(SslSelectChannelEndPoint.java:327)
	at org.eclipse.jetty.websocket.WebSocketParser.parseNext(WebSocketParser.java:96)
	at org.eclipse.jetty.websocket.WebSocketConnection.handle(WebSocketConnection.java:177)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:506)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
	at java.lang.Thread.run(Thread.java:619)

Looks like a threading issue to me. Do you really need to use a field for the SSLEngineResult? Can a local variable not be used instead in those methods that make wrap/unwrap calls? (If toString() really needs it then maybe a volatile field containing a copy '_latestResult' should be used for this purpose only.)

Reproducible: Didn't try
Comment 1 Michael Gorovoy CLA 2011-01-24 17:35:04 EST
Assigned to Greg.
Comment 2 Greg Wilkins CLA 2011-09-06 01:10:09 EDT
Sorry for no explicit action on this issue for so long.

However we have been working on the SSL connector throughout this time and we believe we have solved a number of issues including this NPE (which was a bad call within a synchronized try{}finally{}.

however, we don't have an explicit test case for precisely this issue, so can you please try 7.5.x and reopen if you see the problem again.

thanks