MCProtocolLib icon indicating copy to clipboard operation
MCProtocolLib copied to clipboard

failed to create io_uring ring fd Cannot allocate memory

Open leopoldhub opened this issue 4 years ago • 5 comments

Hello,

I simply tried to run the example with the 1.18-1 version of the lib and got the following error:

java.lang.RuntimeException: failed to create io_uring ring fd Cannot allocate memory

Full stacktrace:

Exception in thread "main" java.lang.IllegalStateException: failed to create a child event loop
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:88)
	at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:68)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:104)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:97)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:90)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:79)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:62)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:48)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.<init>(IOUringEventLoopGroup.java:41)
	at com.github.steveice10.packetlib.tcp.TcpServer.bindImpl(TcpServer.java:51)
	at com.github.steveice10.packetlib.AbstractServer.bind(AbstractServer.java:131)
	at com.github.steveice10.packetlib.AbstractServer.bind(AbstractServer.java:126)
	at com.github.steveice10.packetlib.AbstractServer.bind(AbstractServer.java:121)
	at fr.leopoldhub.mcprotocollibtest.Main.main(Main.java:134)
Caused by: java.lang.RuntimeException: failed to create io_uring ring fd Cannot allocate memory
	at io.netty.incubator.channel.uring.Native.ioUringSetup(Native Method)
	at io.netty.incubator.channel.uring.Native.createRingBuffer(Native.java:169)
	at io.netty.incubator.channel.uring.IOUringEventLoop.<init>(IOUringEventLoop.java:73)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.newChild(IOUringEventLoopGroup.java:121)
	at io.netty.incubator.channel.uring.IOUringEventLoopGroup.newChild(IOUringEventLoopGroup.java:31)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
	... 13 more

Im on ubuntu 20.04.3 and using jdk11-correto on intellij.

leopoldhub avatar Dec 04 '21 23:12 leopoldhub

Try this https://github.com/netty/netty-incubator-transport-io_uring#i-tried-to-use-io_uring-but-got-javalangruntimeexception-failed-to-create-io_uring-ring-fd-cannot-allocate-memory

rtm516 avatar Dec 05 '21 14:12 rtm516

I did it and it is my actual limit:

ulimit -l
65536

But it still not working...

leopoldhub avatar Dec 05 '21 23:12 leopoldhub

This is turning into a major problem recently. Increasing the memlock limit to 1GB and still getting this error. Seeing if I can remove io_uring.

Given that the JAR is a 0.0.8 version, I don't want this on production software.

artnaseef avatar May 29 '22 18:05 artnaseef

Geyser also removes io_uring - you can just exclude the package and PacketLib will handle the removal gracefully:

<exclusion>
          <groupId>io.netty.incubator</groupId>
          <artifactId>netty-incubator-transport-native-io_uring</artifactId>
</exclusion>

But a PR to update the dependency will also be accepted.

Camotoy avatar May 29 '22 19:05 Camotoy

That works really well. Please remove it.

artnaseef avatar May 29 '22 20:05 artnaseef