{"action":"opened","issue":{"url":"https://api.github.com/repos/netty/netty/issues/3974","labels_url":"https://api.github.com/repos/netty/netty/issues/3974/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/3974/comments","events_url":"https://api.github.com/repos/netty/netty/issues/3974/events","html_url":"https://github.com/netty/netty/issues/3974","id":94447034,"number":3974,"title":"DNS buffer leaks","user":{"login":"dmk23","id":1828444,"avatar_url":"https://avatars.githubusercontent.com/u/1828444?v=3","gravatar_id":"","url":"https://api.github.com/users/dmk23","html_url":"https://github.com/dmk23","followers_url":"https://api.github.com/users/dmk23/followers","following_url":"https://api.github.com/users/dmk23/following{/other_user}","gists_url":"https://api.github.com/users/dmk23/gists{/gist_id}","starred_url":"https://api.github.com/users/dmk23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmk23/subscriptions","organizations_url":"https://api.github.com/users/dmk23/orgs","repos_url":"https://api.github.com/users/dmk23/repos","events_url":"https://api.github.com/users/dmk23/events{/privacy}","received_events_url":"https://api.github.com/users/dmk23/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-11T07:07:19Z","updated_at":"2015-07-11T07:07:19Z","closed_at":null,"body":"In running big DNS resolution loads with logging turned on I've run into buffer leak warnings. With paranoid detection mode turned on I've generated the following stack traces. Not quite sure what is going on here, so just reporting it for review.\r\n\r\n```\r\n2015-07-02 15:53:03,253 ERROR [epollEventLoopGroup-2-1] util.ResourceLeakDetector: LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.\r\nRecent access records: 5\r\n#5:\r\n        io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:722)\r\n        io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:84)\r\n        io.netty.channel.DefaultAddressedEnvelope.release(DefaultAddressedEnvelope.java:101)\r\n        io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:84)\r\n        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:91)\r\n        io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)\r\n        io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)\r\n        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:157)\r\n        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:946)\r\n        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:581)\r\n        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:322)\r\n        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)\r\n        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)\r\n        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        java.lang.Thread.run(Thread.java:744)\r\n#4:\r\n        io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:722)\r\n        io.netty.handler.codec.dns.DefaultDnsRawRecord.release(DefaultDnsRawRecord.java:97)\r\n        io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:84)\r\n        io.netty.handler.codec.dns.AbstractDnsMessage.clear(AbstractDnsMessage.java:346)\r\n        io.netty.handler.codec.dns.AbstractDnsMessage.clear(AbstractDnsMessage.java:331)\r\n        io.netty.handler.codec.dns.DefaultDnsResponse.clear(DefaultDnsResponse.java:148)\r\n        io.netty.handler.codec.dns.DatagramDnsResponse.clear(DatagramDnsResponse.java:155)\r\n        io.netty.handler.codec.dns.DatagramDnsResponse.clear(DatagramDnsResponse.java:26)\r\n        io.netty.handler.codec.dns.AbstractDnsMessage.deallocate(AbstractDnsMessage.java:377)\r\n        io.netty.util.AbstractReferenceCounted.release(AbstractReferenceCounted.java:105)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:74)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:33)\r\n        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)\r\n        io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)\r\n        io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)\r\n        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:157)\r\n        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:946)\r\n        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:581)\r\n        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:322)\r\n        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)\r\n        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)\r\n        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        java.lang.Thread.run(Thread.java:744)\r\n#3:\r\n        io.netty.buffer.AdvancedLeakAwareByteBuf.retain(AdvancedLeakAwareByteBuf.java:694)\r\n        io.netty.handler.codec.dns.DefaultDnsRecordDecoder.decodeRecord(DefaultDnsRecordDecoder.java:75)\r\n        io.netty.handler.codec.dns.DefaultDnsRecordDecoder.decodeRecord(DefaultDnsRecordDecoder.java:53)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decodeRecords(DatagramDnsResponseDecoder.java:108)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:68)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:33)\r\n        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)\r\n        io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)\r\n        io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)\r\n        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:157)\r\n        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:946)\r\n        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:581)\r\n        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:322)\r\n        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)\r\n        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)\r\n        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        java.lang.Thread.run(Thread.java:744)\r\n#2:\r\n        io.netty.buffer.AdvancedLeakAwareByteBuf.duplicate(AdvancedLeakAwareByteBuf.java:64)\r\n        io.netty.handler.codec.dns.DefaultDnsRecordDecoder.decodeRecord(DefaultDnsRecordDecoder.java:75)\r\n        io.netty.handler.codec.dns.DefaultDnsRecordDecoder.decodeRecord(DefaultDnsRecordDecoder.java:53)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decodeRecords(DatagramDnsResponseDecoder.java:108)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:68)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:33)\r\n        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)\r\n        io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)\r\n        io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)\r\n        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:157)\r\n        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:946)\r\n        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:581)\r\n        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:322)\r\n        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)\r\n        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)\r\n        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        java.lang.Thread.run(Thread.java:744)\r\n#1:\r\n        io.netty.buffer.AdvancedLeakAwareByteBuf.readUnsignedShort(AdvancedLeakAwareByteBuf.java:358)\r\n        io.netty.handler.codec.dns.DefaultDnsRecordDecoder.decodeRecord(DefaultDnsRecordDecoder.java:49)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decodeRecords(DatagramDnsResponseDecoder.java:108)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:68)\r\n        io.netty.handler.codec.dns.DatagramDnsResponseDecoder.decode(DatagramDnsResponseDecoder.java:33)\r\n        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)\r\n        io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)\r\n        io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)\r\n        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:157)\r\n        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:946)\r\n        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:581)\r\n        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:322)\r\n        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)\r\n        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)\r\n        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        java.lang.Thread.run(Thread.java:744)\r\nCreated at:\r\n        io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:250)\r\n        io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:155)\r\n        io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:146)\r\n        io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:107)\r\n        io.netty.channel.FixedRecvByteBufAllocator$HandleImpl.allocate(FixedRecvByteBufAllocator.java:38)\r\n        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:538)\r\n        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:322)\r\n        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)\r\n        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)\r\n        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        java.lang.Thread.run(Thread.java:744)\r\n```"}}