epoll_wait fails with "timerfd_settime() failed: Invalid argument" due to tv_sec and tv_nsec being -1
See original GitHub issueExpected behavior
epoll_wait works as it did in 4.1.29
Actual behavior
epoll_wait fails when the optimisation added in #7816 is used. timerfd_settime()
is called with the following itimerspec
:
Thread 26 "java" hit Catchpoint 1 (returned from syscall timerfd_settime), 0x00007faff30e15da in timerfd_settime () at ../sysdeps/unix/syscall-template.S:78
78 in ../sysdeps/unix/syscall-template.S
(gdb) print (struct itimerspec) *$rdx
$9 = {it_interval = {tv_sec = 0, tv_nsec = 0}, it_value = {tv_sec = -1, tv_nsec = -1}}
This is a continuation of the problem reported in #8348.
By my reading of the code, timerfd_settime
shouldn’t be called when both tvSec
and tvNsec
are -1. That makes me suspect that this if
is not evaluating as expected: https://github.com/netty/netty/blob/44c3b824ecabe5d4bf52d3a9a7a30c456ee391b8/transport-native-epoll/src/main/c/netty_epoll_native.c#L187-L196
Steps to reproduce
TBD
Minimal yet complete reproducer code (or URL to code)
Sorry, I don’t have one yet. I will update the issue if/when I do.
Netty version
4.1.31.Final
JVM version (e.g. java -version
)
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
OS version (e.g. uname -a
)
Linux ubuntu 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Invalid argument when read() from timerfd - Stack Overflow
The error is Invalid argument when executing read() in the handler, and the errno is 22. This error appears when I run this...
Read more >PTP_EXTTS_REQUEST failed: Invalid argument) - Unix ...
I am facing issue when trying to updating timestamp with ts2phc. below is my configuration master <--> eth0 (Device 1 -device acts as ......
Read more >failed to set times on ... Invalid argument (22) and what to do ...
In the tests, I am using rsync 3.1.1 since this is what is presently ... it: basically ignore error 22 (EINVAL) of fix...
Read more >nanosleep(2)
If the rmtp argument is NULL, the remaining time is not returned. If nanosleep() fails, it returns a value of -1 and sets...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, this is embarrassing. Your suspicion that there was a different native lib on the class path was exactly right. Sorry. Micrometer’s Statd module shades Netty but leaves the native
/META-INF/native/libnetty_transport_native_epoll_x86_64.so
in its default location. That one’s first on the classpath so it’s found and loaded byNativeLibraryLoader
.@wilkinsona doh! Thanks for closing the loop on this, this makes sense. At least we have one more unit test now 😃