- Notifications
You must be signed in to change notification settings - Fork 3.8k
linux: work around io_uring IORING_OP_CLOSE bug #4059
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
Conversation
ronag left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this cause other bugs? i.e. is it safe to just skip OP_CLOSE?
| Libuv falls back to the thread pool. The file descriptor is still closed, just not by io_uring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My worry is that this might manifest in other scenarios as the commits in those kernel versions don't explicitly point to an IORING_OP_CLOSE issue
| Maybe @axboe can help us understand what's happening here. |
| maybe just totally disable ioring for older kernel versions? |
| That's a little heavy-handed, no? |
Work around a poorly understood bug in older kernels where closing a file descriptor pointing to /foo/bar results in ETXTBSY errors when trying to execve("/foo/bar") later on. The bug seems to have been fixed somewhere between 5.15.85 and 5.15.90. I couldn't pinpoint the responsible commit but good candidates are the several data race fixes. Interestingly, it seems to manifest only when running under Docker so the possibility of a Docker bug can't be completely ruled out either. This commit moves uv__kernel_version() from fs.c to linux.c because the latter now uses it more than the former. Fixes: nodejs/node#48444
It feels a little experimental if there are issues and we don't know precisely what they are and whether it also affects other calls... |
| Everything has issues, not just io_uring. A big part of libuv is detecting and working around missing or broken operating system features, just take a look a src/unix/fs.c. |
Work around a poorly understood bug in older kernels where closing a file descriptor pointing to /foo/bar results in ETXTBSY errors when trying to execve("/foo/bar") later on. The bug seems to have been fixed somewhere between 5.15.85 and 5.15.90. I couldn't pinpoint the responsible commit but good candidates are the several data race fixes. Interestingly, it seems to manifest only when running under Docker so the possibility of a Docker bug can't be completely ruled out either. This commit moves uv__kernel_version() from fs.c to linux.c because the latter now uses it more than the former. Fixes: nodejs/node#48444 Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: #48618 Fixes: #48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: #48618 Fixes: #48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: nodejs#48618 Fixes: nodejs#48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: nodejs#48618 Fixes: nodejs#48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: nodejs#48618 Fixes: nodejs#48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: #48618 Backport-PR-URL: #49591 Fixes: #48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> PR-URL: #48078
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: #48618 Backport-PR-URL: #49591 Fixes: #48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> PR-URL: #48078
Notable changes - fs: use WTF-8 on Windows: libuv/libuv#2970 - linux: add some more iouring backed fs ops: libuv/libuv#4012 Important bugs fixed - linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059 - src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048 PR-URL: #48618 Backport-PR-URL: #49591 Fixes: #48512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> PR-URL: #48078
Work around a poorly understood bug in older kernels where closing a file descriptor pointing to /foo/bar results in ETXTBSY errors when trying to execve("/foo/bar") later on.
The bug seems to have been fixed somewhere between 5.15.78 and 5.15.98. I couldn't pinpoint the responsible commit but good candidates are the several data race fixes.
Interestingly, it seems to manifest only when running under Docker so the possibility of Docker bug can't be completely ruled out either.
This commit moves uv__kernel_version() from fs.c to linux.c because the latter now uses it more than the former.
Fixes: nodejs/node#48444