{"action":"created","issue":{"url":"https://api.github.com/repos/celluloid/nio4r/issues/84","repository_url":"https://api.github.com/repos/celluloid/nio4r","labels_url":"https://api.github.com/repos/celluloid/nio4r/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/celluloid/nio4r/issues/84/comments","events_url":"https://api.github.com/repos/celluloid/nio4r/issues/84/events","html_url":"https://github.com/celluloid/nio4r/issues/84","id":134702170,"number":84,"title":"NullPointerExceptions occurring when monitors are being closed.","user":{"login":"clonezone","id":31172,"avatar_url":"https://avatars.githubusercontent.com/u/31172?v=3","gravatar_id":"","url":"https://api.github.com/users/clonezone","html_url":"https://github.com/clonezone","followers_url":"https://api.github.com/users/clonezone/followers","following_url":"https://api.github.com/users/clonezone/following{/other_user}","gists_url":"https://api.github.com/users/clonezone/gists{/gist_id}","starred_url":"https://api.github.com/users/clonezone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clonezone/subscriptions","organizations_url":"https://api.github.com/users/clonezone/orgs","repos_url":"https://api.github.com/users/clonezone/repos","events_url":"https://api.github.com/users/clonezone/events{/privacy}","received_events_url":"https://api.github.com/users/clonezone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-18T21:29:50Z","updated_at":"2016-02-18T22:31:20Z","closed_at":null,"body":"These seem to happen at random times, but most commonly when I'm shutting down my server. Stack trace for one of those included below. All occurrences go through Celluloid::IO::Reactor#wait(), but what is above that varies.\r\n\r\nnio4r 1.2.1-java\r\nCelluloid / Celluloid-IO 0.17.3\r\nJRuby 9.0.1.0 / Java 1.8_0_72\r\n\r\nDiscussion of this issue started at https://groups.google.com/d/topic/celluloid-ruby/O9q9rHdtcy0\r\n\r\n```\r\n2016-02-16T12:52:46.244000 [ERROR]: CLEANUP CRASHED!\r\nJava::JavaLang::NullPointerException:\r\n    org.jruby.util.io.OpenFile.channel(OpenFile.java:2245)\r\n    org.jruby.RubyIO.getChannel(RubyIO.java:403)\r\n    org.nio4r.Nio4r$Selector.deregister(Nio4r.java:188)\r\n    org.nio4r.Nio4r$Selector$INVOKER$i$1$0$deregister.call(Nio4r$Selector$INVOKER$i$1$0$deregister.gen)\r\n    org.jruby.RubyClass.finvoke(RubyClass.java:756)\r\n    org.jruby.runtime.Helpers.invoke(Helpers.java:400)\r\n    org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:376)\r\n    org.nio4r.Nio4r$Monitor.close(Nio4r.java:462)\r\n    org.nio4r.Nio4r$Monitor.close(Nio4r.java:453)\r\n    org.nio4r.Nio4r$Monitor$INVOKER$i$close.call(Nio4r$Monitor$INVOKER$i$close.gen)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.reactor.invokeOther53:close(<install/path>/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.reactor.RUBY$method$wait$0(<install/path>/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb:52)\r\n    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:146)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:216)\r\n    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:205)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.reactor.invokeOther3:wait(<install/path>/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.reactor.RUBY$method$wait_readable$0(<install/path>/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb:21)\r\n    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:181)\r\n    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.invokeOther14:wait_readable(<install/path>/celluloid-io-0.17.3/lib/celluloid/io.rb)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.RUBY$method$wait_readable$0(<install/path>/celluloid-io-0.17.3/lib/celluloid/io.rb:54)\r\n    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:181)\r\n    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)\r\n    org.jruby.internal.runtime.methods.WrapperMethod.call(WrapperMethod.java:59)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.tcp_server.invokeOther6:wait_readable(<install/path>/celluloid-io-0.17.3/lib/celluloid/io/tcp_server.rb)\r\n    install.path.celluloid_minus_io_minus_0_dot_17_dot_3.lib.celluloid.io.tcp_server.RUBY$method$accept$0(<install/path>/celluloid-io-0.17.3/lib/celluloid/io/tcp_server.rb:36)\r\n    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:146)\r\n    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129)\r\n    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:305)\r\n    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)\r\n    org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:136)\r\n    org.jruby.runtime.InterpretedIRBlockBody.commonYieldPath(InterpretedIRBlockBody.java:118)\r\n    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:67)\r\n    org.jruby.runtime.Block.yieldSpecific(Block.java:116)\r\n    org.jruby.RubyKernel.loop(RubyKernel.java:1291)\r\n    org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(RubyKernel$INVOKER$s$0$0$loop.gen)\r\n    org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:494)\r\n    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)\r\n    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)\r\n    org.jruby.ir.instructions.CallBase.interpret(CallBase.java:419)\r\n    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:321)\r\n    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:127)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:113)\r\n    org.jruby.RubyClass.finvoke(RubyClass.java:541)\r\n    org.jruby.RubyBasicObject.send19(RubyBasicObject.java:1626)\r\n    org.jruby.RubyBasicObject$INVOKER$i$send19.call(RubyBasicObject$INVOKER$i$send19.gen)\r\n    org.jruby.RubyKernel.public_send(RubyKernel.java:1823)\r\n    org.jruby.RubyKernel$INVOKER$s$0$0$public_send.call(RubyKernel$INVOKER$s$0$0$public_send.gen)\r\n    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.calls.invokeOther6:public_send(<install/path>/celluloid-0.17.3/lib/celluloid/calls.rb)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.calls.RUBY$method$dispatch$0(<install/path>/celluloid-0.17.3/lib/celluloid/calls.rb:28)\r\n    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:111)\r\n    org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:899)\r\n    org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:892)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.call.async.invokeSuper19:dispatch(<install/path>/celluloid-0.17.3/lib/celluloid/call/async.rb)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.call.async.RUBY$method$dispatch$0(<install/path>/celluloid-0.17.3/lib/celluloid/call/async.rb:7)\r\n    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131)\r\n    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:181)\r\n    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)\r\n    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)\r\n    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.cell.invokeOther13:dispatch(<install/path>/celluloid-0.17.3/lib/celluloid/cell.rb)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.cell.RUBY$block$dispatch$2(<install/path>/celluloid-0.17.3/lib/celluloid/cell.rb:50)\r\n    org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:70)\r\n    org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:140)\r\n    org.jruby.runtime.BlockBody.yield(BlockBody.java:77)\r\n    org.jruby.runtime.Block.yield(Block.java:147)\r\n    org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:450)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.cell.RUBY$block$task$1(<install/path>/celluloid-0.17.3/lib/celluloid/cell.rb:76)\r\n    org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:70)\r\n    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:67)\r\n    org.jruby.runtime.Block.yieldSpecific(Block.java:116)\r\n    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:457)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.actor.RUBY$block$task$1(<install/path>/celluloid-0.17.3/lib/celluloid/actor.rb:339)\r\n    org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:70)\r\n    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:67)\r\n    org.jruby.runtime.Block.yieldSpecific(Block.java:116)\r\n    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:457)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.task.RUBY$block$initialize$2(<install/path>/celluloid-0.17.3/lib/celluloid/task.rb:44)\r\n    org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:70)\r\n    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:67)\r\n    org.jruby.runtime.Block.yieldSpecific(Block.java:116)\r\n    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:457)\r\n    install.path.celluloid_minus_0_dot_17_dot_3.lib.celluloid.task.fibered.RUBY$block$create$2(<install/path>/celluloid-0.17.3/lib/celluloid/task/fibered.rb:14)\r\n    org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:70)\r\n    org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:147)\r\n    org.jruby.runtime.BlockBody.yield(BlockBody.java:83)\r\n    org.jruby.runtime.Block.yieldArray(Block.java:161)\r\n    org.jruby.ext.fiber.ThreadFiber$1.run(ThreadFiber.java:259)\r\n    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n    java.lang.Thread.run(Thread.java:745) \r\n```"},"comment":{"url":"https://api.github.com/repos/celluloid/nio4r/issues/comments/185954623","html_url":"https://github.com/celluloid/nio4r/issues/84#issuecomment-185954623","issue_url":"https://api.github.com/repos/celluloid/nio4r/issues/84","id":185954623,"user":{"login":"tarcieri","id":797,"avatar_url":"https://avatars.githubusercontent.com/u/797?v=3","gravatar_id":"","url":"https://api.github.com/users/tarcieri","html_url":"https://github.com/tarcieri","followers_url":"https://api.github.com/users/tarcieri/followers","following_url":"https://api.github.com/users/tarcieri/following{/other_user}","gists_url":"https://api.github.com/users/tarcieri/gists{/gist_id}","starred_url":"https://api.github.com/users/tarcieri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarcieri/subscriptions","organizations_url":"https://api.github.com/users/tarcieri/orgs","repos_url":"https://api.github.com/users/tarcieri/repos","events_url":"https://api.github.com/users/tarcieri/events{/privacy}","received_events_url":"https://api.github.com/users/tarcieri/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T22:31:20Z","updated_at":"2016-02-18T22:31:20Z","body":"@headius @enebo any idea what would be causing an NPE here? (inside ` org.jruby.util.io.OpenFile.channel(OpenFile.java:2245)`)"}}