dev@grizzly.java.net

Strange NPE in SelectorRunner

From: Bongjae Chang <bongjae.chang_at_gmail.com>
Date: Fri, 07 Mar 2014 20:46:49 +0900

Hi,
When I do stress-test in Grizzly's server-side, I meet some strange
exceptions.
I just kill the client process for stress test forcibly before the following
exceptions are thrown.
Reproducing is not easy.

Here are exceptions(many similar exceptions during short time):

...
2014-03-06 23:39:40.128 [Grizzly(15) SelectorRunner] ERROR
org.glassfish.grizzly.nio.SelectorRunner:461 notifyConnectionException -
doSelect exception
java.lang.NullPointerException: null
    at
sun.nio.ch.EPollArrayWrapper.setUpdateEvents(EPollArrayWrapper.java:178)
~[na:1.7.0_40]
    at sun.nio.ch.EPollArrayWrapper.add(EPollArrayWrapper.java:227)
~[na:1.7.0_40]
    at sun.nio.ch.EPollSelectorImpl.implRegister(EPollSelectorImpl.java:164)
~[na:1.7.0_40]
    at sun.nio.ch.SelectorImpl.register(SelectorImpl.java:133)
~[na:1.7.0_40]
    at
java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableC
hannel.java:209) ~[na:1.7.0_40]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.registerChannel0(DefaultSel
ectorHandler.java:318) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.access$400(DefaultSelectorH
andler.java:64) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler$RegisterChannelOperation.ru
n(DefaultSelectorHandler.java:461) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.processPendingTaskQueue(Def
aultSelectorHandler.java:295) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.processPendingTasks(Default
SelectorHandler.java:286) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.preSelect(DefaultSelectorHa
ndler.java:100) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:332)
[grizzly-framework-2.3.10.jar:2.3.10]
    at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:276)
[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractTh
readPool.java:565) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThrea
dPool.java:545) [grizzly-framework-2.3.10.jar:2.3.10]
    at java.lang.Thread.run(Thread.java:724) [na:1.7.0_40]
2014-03-06 23:39:40.138 [Grizzly(1) SelectorRunner] WARN
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy:114 fireIOEvent -
GRIZZLY0010: Uncaught exception:
java.lang.NullPointerException: null
    at
sun.nio.ch.EPollArrayWrapper.setUpdateEvents(EPollArrayWrapper.java:178)
~[na:1.7.0_40]
    at sun.nio.ch.EPollArrayWrapper.add(EPollArrayWrapper.java:227)
~[na:1.7.0_40]
    at sun.nio.ch.EPollSelectorImpl.implRegister(EPollSelectorImpl.java:164)
~[na:1.7.0_40]
    at sun.nio.ch.SelectorImpl.register(SelectorImpl.java:133)
~[na:1.7.0_40]
    at
java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableC
hannel.java:209) ~[na:1.7.0_40]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.registerChannel0(DefaultSel
ectorHandler.java:318) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.DefaultSelectorHandler.registerChannelAsync(Defaul
tSelectorHandler.java:188) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.RoundRobinConnectionDistributor.registerChannelAsy
nc(RoundRobinConnectionDistributor.java:84)
~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.transport.TCPNIOServerConnection.registerAcceptedC
hannel(TCPNIOServerConnection.java:205)
~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.transport.TCPNIOServerConnection.onAccept(TCPNIOSe
rverConnection.java:242) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransp
ort.java:527) ~[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOSt
rategy.java:112) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOS
trategy.java:117) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.executeIoEvent(Worke
rThreadIOStrategy.java:103) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractI
OStrategy.java:89) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.jav
a:412) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:381
) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:345)
[grizzly-framework-2.3.10.jar:2.3.10]
    at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:276)
[grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractTh
readPool.java:565) [grizzly-framework-2.3.10.jar:2.3.10]
    at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThrea
dPool.java:545) [grizzly-framework-2.3.10.jar:2.3.10]
    at java.lang.Thread.run(Thread.java:724) [na:1.7.0_40]


It seems that this is not an issue of Grizzly but JDK. Have you ever seen
this error?

Thanks.

Regards,
Bongjae Chang