question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

failed to create io_uring ring fd Cannot allocate memory

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Camotoycommented, May 29, 2022

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.

0reactions
artnaseefcommented, May 29, 2022

That works really well. Please remove it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

netty/netty-incubator-transport-io_uring - GitHub
IOUring.ensureAvailability(IOUring.java:63) ... ... Caused by: java.lang.RuntimeException: failed to create io_uring ring fd Cannot allocate memory at ...
Read more >
Re: "Cannot allocate memory" on ring creation (not ...
IO Uring: Re: "Cannot allocate memory" on ring creation (not ... Until it does not - new ring creation just > fails with...
Read more >
Put an io_uring on it: Exploiting the Linux Kernel - Blog | Grapl
The kernel will return a file descriptor, which the user space application will use to create the shared memory mappings.
Read more >
How much locked memory does io_uring_setup need?
[pid 37480] io_uring_setup(2048, {flags=0, sq_thread_cpu=0, sq_thread_idle=0}) = -1 ENOMEM (Cannot allocate memory).
Read more >
Getting Hands-on with io_uring using Go
We make a syscall, our application in user layer calls into the kernel, ... fd is the file descriptor of the ring returned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found