deathcap / wsmc

WebSocket proxy to Minecraft
34 stars 10 forks source link

[wsmc/Java] 22:19:39 [SEVERE] LEAK: ByteBuf.release() was not called before it's garbage-collected. Enable advanced leak reporting to find out where the leak occurred. To enable advanced leak reporting, specify the JVM option '-Ddeathcap.wsmc.lib.netty.leakDetectionLevel=advanced' or call ResourceLeakDetector.setLevel() #6

Closed deathcap closed 8 years ago

deathcap commented 8 years ago

Probably related to this error, occurs after connecting for a while:

[22:15:09 INFO]: id 0 stripped 35 reply=00 06 C0 65 C5 40 C5 D0 E9 25 40 50 C0 10 62 4D D2 F2 40 70 0F F1 22 36 29 C6 C2 86 66 67 C0 DC CC D0 01 
[22:15:09 ERROR]: LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 5
#5:
    deathcap.wsmc.lib.netty.buffer.AdvancedLeakAwareByteBuf.readBytes(AdvancedLeakAwareByteBuf.java:457)
    deathcap.wsmc.web.WebSocketHandler.messageReceived(WebSocketHandler.java:114)
    deathcap.wsmc.web.WebSocketHandler.messageReceived(WebSocketHandler.java:42)
    deathcap.wsmc.lib.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:132)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:106)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:154)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    deathcap.wsmc.lib.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:127)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
    deathcap.wsmc.lib.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
    java.lang.Thread.run(Thread.java:724)
#4:
    deathcap.wsmc.lib.netty.buffer.AdvancedLeakAwareByteBuf.getBytes(AdvancedLeakAwareByteBuf.java:223)
    deathcap.wsmc.HexDumper.hexByteBuf(HexDumper.java:11)
    deathcap.wsmc.web.WebSocketHandler.messageReceived(WebSocketHandler.java:111)
    deathcap.wsmc.web.WebSocketHandler.messageReceived(WebSocketHandler.java:42)
    deathcap.wsmc.lib.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:132)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:106)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:154)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    deathcap.wsmc.lib.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:127)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
    deathcap.wsmc.lib.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
    java.lang.Thread.run(Thread.java:724)
#3:
    deathcap.wsmc.lib.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:45)
    deathcap.wsmc.lib.netty.buffer.DefaultByteBufHolder.release(DefaultByteBufHolder.java:73)
    deathcap.wsmc.lib.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:68)
    deathcap.wsmc.lib.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:91)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:132)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:106)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:154)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    deathcap.wsmc.lib.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:127)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
    deathcap.wsmc.lib.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
    java.lang.Thread.run(Thread.java:724)
#2:
    deathcap.wsmc.lib.netty.buffer.AdvancedLeakAwareByteBuf.retain(AdvancedLeakAwareByteBuf.java:709)
    deathcap.wsmc.lib.netty.buffer.DefaultByteBufHolder.retain(DefaultByteBufHolder.java:61)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketFrame.retain(WebSocketFrame.java:76)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.BinaryWebSocketFrame.retain(BinaryWebSocketFrame.java:69)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.BinaryWebSocketFrame.retain(BinaryWebSocketFrame.java:24)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketProtocolHandler.decode(WebSocketProtocolHandler.java:37)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.decode(WebSocketServerProtocolHandler.java:101)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.decode(WebSocketServerProtocolHandler.java:50)
    deathcap.wsmc.lib.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:132)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:106)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:154)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    deathcap.wsmc.lib.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:127)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
    deathcap.wsmc.lib.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
    java.lang.Thread.run(Thread.java:724)
#1:
    deathcap.wsmc.lib.netty.buffer.AdvancedLeakAwareByteBuf.setByte(AdvancedLeakAwareByteBuf.java:253)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.unmask(WebSocket08FrameDecoder.java:390)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.decode(WebSocket08FrameDecoder.java:289)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:227)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:140)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    deathcap.wsmc.lib.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:127)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
    deathcap.wsmc.lib.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
    java.lang.Thread.run(Thread.java:724)
Created at:
    deathcap.wsmc.lib.netty.util.ResourceLeakDetector.open(ResourceLeakDetector.java:163)
    deathcap.wsmc.lib.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(AbstractByteBufAllocator.java:42)
    deathcap.wsmc.lib.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:55)
    deathcap.wsmc.lib.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:155)
    deathcap.wsmc.lib.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:146)
    deathcap.wsmc.lib.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:83)
    deathcap.wsmc.lib.netty.buffer.ByteBufUtil.readBytes(ByteBufUtil.java:297)
    deathcap.wsmc.lib.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.decode(WebSocket08FrameDecoder.java:281)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:227)
    deathcap.wsmc.lib.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:140)
    deathcap.wsmc.lib.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
    deathcap.wsmc.lib.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
    deathcap.wsmc.lib.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    deathcap.wsmc.lib.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:127)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
    deathcap.wsmc.lib.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
    deathcap.wsmc.lib.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
    java.lang.Thread.run(Thread.java:724)
[22:15:09 INFO]: ws received 35 bytes: 00 06 C0 65 C5 40 C5 D0 E9 25 40 50 C0 10 62 4D D2 F2 40 70 0F F1 22 36 29 C6 C2 86 66 67 C0 DC CC D0 01 
[22:15:09 INFO]: id 0 stripped 35 reply=00 06 C0 65 C5 40 C5 D0 E9 25 40 50 C0 10 62 4D D2 F2 40 70 0F F1 22 36 29 C6 C2 86 66 67 C0 DC CC D0 01 
[22:15:09 INFO]: ws received 35 bytes: 00 06 C0 65 C5 40 C5 D0 E9 25 40 50 C0 10 62 4D D2 F2 40 70 0F F1 22 36 29 C6 C2 86 66 67 C0 DC CC D0 01 
deathcap commented 8 years ago

Seems I was using a buffer after it was released. Used to hit this error early, tested with the fix running for 5 minutes (packets continuously sent), haven't seen it yet.