NullPointerException can happen at channel.write(buffer) because of a race condition inside AsyncSenderImpl in JBoss EAP 7

Solution Unverified - Updated -

Issue

The following NullPointerException happened. This happened only once. What caused this issue?

ERROR [org.xnio.listener] (default I/O-3) XNIO001007: A channel event listener threw an exception: java.lang.NullPointerException
    at org.xnio.conduits.ConduitStreamSinkChannel.write(ConduitStreamSinkChannel.java:154) [xnio-api-3.4.7.Final-redhat-1.jar:3.4.7.Final-redhat-1]
    at io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:187)
    at io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2011)
    at io.undertow.io.AsyncSenderImpl.invokeOnComplete(AsyncSenderImpl.java:398)
    at io.undertow.io.AsyncSenderImpl.access$400(AsyncSenderImpl.java:41)
    at io.undertow.io.AsyncSenderImpl$3.handleEvent(AsyncSenderImpl.java:454)
    at io.undertow.io.AsyncSenderImpl$3.handleEvent(AsyncSenderImpl.java:440)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.4.7.Final-redhat-1.jar:3.4.7.Final-redhat-1]
    at io.undertow.channels.DetachableStreamSinkChannel$SetterDelegatingListener.handleEvent(DetachableStreamSinkChannel.java:285)
    at io.undertow.channels.DetachableStreamSinkChannel$SetterDelegatingListener.handleEvent(DetachableStreamSinkChannel.java:272)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.4.7.Final-redhat-1.jar:3.4.7.Final-redhat-1]
    at org.xnio.conduits.WriteReadyHandler$ChannelListenerHandler.writeReady(WriteReadyHandler.java:65) [xnio-api-3.4.7.Final-redhat-1.jar:3.4.7.Final-redhat-1]
    at io.undertow.server.protocol.ajp.AjpServerResponseConduit$AjpServerWriteReadyHandler.writeReady(AjpServerResponseConduit.java:496)
    at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:94) [xnio-nio-3.4.7.Final-redhat-1.jar:3.4.7.Final-redhat-1]
    at org.xnio.nio.WorkerThread.run(WorkerThread.java:571) [xnio-nio-3.4.7.Final-redhat-1.jar:3.4.7.Final-redhat-1]

or

ERROR [stderr] (default task-4) Exception in thread "default task-44" java.lang.NullPointerException
ERROR [stderr] (default task-4)    at org.xnio.conduits.ConduitStreamSinkChannel.write(ConduitStreamSinkChannel.java:154)
ERROR [stderr] (default task-4)    at io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:187)
ERROR [stderr] (default task-4)    at io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2011)
ERROR [stderr] (default task-4)    at io.undertow.io.AsyncSenderImpl.invokeOnComplete(AsyncSenderImpl.java:398)
ERROR [stderr] (default task-4)    at io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:162)
ERROR [stderr] (default task-4)    at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:178)
ERROR [stderr] (default task-4)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ERROR [stderr] (default task-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ERROR [stderr] (default task-4)    at java.lang.Thread.run(Thread.java:748)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In