Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netty leak detector can cause native image build to randomly fail #575

Closed
stuartwdouglas opened this issue Jan 20, 2019 · 0 comments
Closed
Milestone

Comments

@stuartwdouglas
Copy link
Member

2019-01-19T23:00:20.9795528Z Error: Detected a direct/mapped ByteBuffer in the image heap. A direct ByteBuffer has a pointer to unmanaged C memory, and C memory from the image generator is not available at image run time. A mapped ByteBuffer references a file descriptor, which is no longer open and mapped at run time. The object was probably created by a class initializer and is reachable from a static field. By default, all class initialization is done during native image building.You can manually delay class initialization to image run time by using the option --delay-class-initialization-to-runtime=. Or you can write your own initialization methods and call them explicitly from your main entry point.
2019-01-19T23:00:20.9796370Z Trace: object io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledDirectByteBuf
2019-01-19T23:00:20.9796602Z object io.netty.util.ResourceLeakDetector$DefaultResourceLeak
2019-01-19T23:00:20.9796780Z object java.util.concurrent.ConcurrentHashMap$Node
2019-01-19T23:00:20.9796982Z object java.util.concurrent.ConcurrentHashMap$Node[]
2019-01-19T23:00:20.9797177Z object java.util.concurrent.ConcurrentHashMap
2019-01-19T23:00:20.9797353Z object io.netty.util.ResourceLeakDetector
2019-01-19T23:00:20.9797554Z method io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(ByteBuf)
2019-01-19T23:00:21.5832486Z Call path from entry point to io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(ByteBuf):
2019-01-19T23:00:21.5858141Z at io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(AbstractByteBufAllocator.java:39)
2019-01-19T23:00:21.5859220Z at io.netty.buffer.PooledByteBufAllocator.newHeapBuffer(PooledByteBufAllocator.java:314)
2019-01-19T23:00:21.5860891Z at io.netty.buffer.AbstractByteBufAllocator.heapBuffer(AbstractByteBufAllocator.java:166)
2019-01-19T23:00:21.5861166Z at io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:123)
2019-01-19T23:00:21.5861435Z at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:867)
2019-01-19T23:00:21.5861736Z at io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved(ByteToMessageDecoder.java:247)
2019-01-19T23:00:21.5862252Z at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:643)
2019-01-19T23:00:21.5862428Z at io.netty.channel.DefaultChannelPipeline.access$000(DefaultChannelPipeline.java:46)
2019-01-19T23:00:21.5862514Z at io.netty.channel.DefaultChannelPipeline$4.run(DefaultChannelPipeline.java:281)
2019-01-19T23:00:21.5862636Z at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:144)
2019-01-19T23:00:21.5862723Z at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:89)
2019-01-19T23:00:21.5862831Z at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
2019-01-19T23:00:21.5862923Z at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
2019-01-19T23:00:21.5864406Z Error: Detected a direct/mapped ByteBuffer in the image heap. A direct ByteBuffer has a pointer to unmanaged C memory, and C memory from the image generator is not available at image run time. A mapped ByteBuffer references a file descriptor, which is no longer open and mapped at run time. The object was probably created by a class initializer and is reachable from a static field. By default, all class initialization is done during native image building.You can manually delay class initialization to image run time by using the option --delay-class-initialization-to-runtime=. Or you can write your own initialization methods and call them explicitly from your main entry point.
2019-01-19T23:00:21.5864695Z Trace: object io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledDirectByteBuf
2019-01-19T23:00:21.5864804Z object io.netty.util.ResourceLeakDetector$DefaultResourceLeak
2019-01-19T23:00:21.5864882Z object java.util.concurrent.ConcurrentHashMap$Node
2019-01-19T23:00:21.5864971Z object java.util.concurrent.ConcurrentHashMap$Node[]
2019-01-19T23:00:21.5865044Z object java.util.concurrent.ConcurrentHashMap
2019-01-19T23:00:21.5865125Z object io.netty.util.ResourceLeakDetector
2019-01-19T23:00:21.5865197Z method io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(ByteBuf)
2019-01-19T23:00:21.5865301Z Call path from entry point to io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(ByteBuf):
2019-01-19T23:00:21.5865395Z at io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(AbstractByteBufAllocator.java:39)
2019-01-19T23:00:21.5865783Z at io.netty.buffer.PooledByteBufAllocator.newHeapBuffer(PooledByteBufAllocator.java:314)
2019-01-19T23:00:21.5865871Z at io.netty.buffer.AbstractByteBufAllocator.heapBuffer(AbstractByteBufAllocator.java:166)
2019-01-19T23:00:21.5866074Z at io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:123)
2019-01-19T23:00:21.5866155Z at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:867)
2019-01-19T23:00:21.5866254Z at io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved(ByteToMessageDecoder.java:247)
2019-01-19T23:00:21.5866341Z at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:643)
2019-01-19T23:00:21.5866466Z at io.netty.channel.DefaultChannelPipeline.access$000(DefaultChannelPipeline.java:46)
2019-01-19T23:00:21.5866549Z at io.netty.channel.DefaultChannelPipeline$4.run(DefaultChannelPipeline.java:281)
2019-01-19T23:00:21.5866648Z at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:144)
2019-01-19T23:00:21.5866743Z at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:89)
2019-01-19T23:00:21.5869974Z at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
2019-01-19T23:00:21.5873639Z at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
2019-01-19T23:00:21.5874422Z

@stuartwdouglas stuartwdouglas added this to the 0.7.0 milestone Jan 20, 2019
stuartwdouglas referenced this issue in stuartwdouglas/quarkus-old Jan 20, 2019
Otherwise if a buffer was registered with the leak detector it is possible
for the native image build to fail randomly
stuartwdouglas referenced this issue in stuartwdouglas/quarkus-old Jan 20, 2019
Otherwise if a buffer was registered with the leak detector it is possible
for the native image build to fail randomly
stuartwdouglas added a commit that referenced this issue Jan 20, 2019
Fixes #575, make the resource leak detector initialized at runtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant