-
Notifications
You must be signed in to change notification settings - Fork 414
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
accept vs accept4 syscalls on 32 bit x86 #260
Comments
On Thu, Jun 22, 2023 at 07:17:35AM -0700, Richard Purdie wrote:
Within Yocto Project we recently set 5.15 as our minimum kernel version. This changes the way glibc is built such that the accept() call changes to use the accept4 syscall behind the scenes. This causes various test failures in accept, net-yy-inet6, net-yy-inet and
net-y-unix. I'm not sure how this should be handled in strace?
I suppose those tests that do not test accept() specifically should be
migrated to accept4(), and the test of accept() needs some special
treatment to make sure it doesn't use the glibc wrapper and invokes
either __NR_accept or __NR_socketcall(SYS_ACCEPT).
|
ldv-alt
added a commit
that referenced
this issue
Jun 26, 2023
The libc function is allowed to implement accept() using accept4() syscall, so migrate to accept4() those tests that trace accept() syscall but do not test accept() specifically, and change the test of accept() syscall to invoke either __NR_accept or __NR_socketcall(SYS_ACCEPT) directly. * tests/accept_compat.h: Remove. * tests/Makefile.am (EXTRA_DIST): Remove accept_compat.h. * tests/accept.c [TEST_SYSCALL_NAME]: Do not invoke accept(), call __NR_accept or __NR_socketcall if available, or skip the test. * tests/net-y-unix.c: Do not include "accept_compat.h". (main): Invoke accept4() instead of accept(). * tests/net-yy-inet.c: Likewise. * tests/net-yy-unix.c: Likewise. Resolves: #260
Thanks! |
turistu
pushed a commit
to turistu/strace
that referenced
this issue
Jul 6, 2023
The libc function is allowed to implement accept() using accept4() syscall, so migrate to accept4() those tests that trace accept() syscall but do not test accept() specifically, and change the test of accept() syscall to invoke either __NR_accept or __NR_socketcall(SYS_ACCEPT) directly. * tests/accept_compat.h: Remove. * tests/Makefile.am (EXTRA_DIST): Remove accept_compat.h. * tests/accept.c [TEST_SYSCALL_NAME]: Do not invoke accept(), call __NR_accept or __NR_socketcall if available, or skip the test. * tests/net-y-unix.c: Do not include "accept_compat.h". (main): Invoke accept4() instead of accept(). * tests/net-yy-inet.c: Likewise. * tests/net-yy-unix.c: Likewise. Resolves: strace#260
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Within Yocto Project we recently set 5.15 as our minimum kernel version. This changes the way glibc is built such that the accept() call changes to use the accept4 syscall behind the scenes. This causes various test failures in accept, net-yy-inet6, net-yy-inet and
net-y-unix. I'm not sure how this should be handled in strace?
As an example:
cat net-yy-inet6.gen.log
--- exp
+++ out
@@ -5,7 +5,7 @@
getsockopt(3TCPv6:[[::1]:46887], SOL_TCP, TCP_MAXSEG, [536], [4]) = 0
socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 4TCPv6:[17255]
connect(4TCPv6:[17255], {sa_family=AF_INET6, sin6_port=htons(46887), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = 0
-accept(3TCPv6:[[::1]:46887], {sa_family=AF_INET6, sin6_port=htons(60152), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [28]) = 5TCPv6:[[::1]:46887-[::1]:60152]>
+accept4(3TCPv6:[[::1]:46887], {sa_family=AF_INET6, sin6_port=htons(60152), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [28], 0) = 5TCPv6:[[::1]:46887-[::1]:60152]>
getpeername(5TCPv6:[[::1]:46887-[::1]:60152]>, {sa_family=AF_INET6, sin6_port=htons(60152), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [28]) = 0
getpeername(4TCPv6:[[::1]:60152-[::1]:46887]>, {sa_family=AF_INET6, sin6_port=htons(46887), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [28]) = 0
setsockopt(4TCPv6:[[::1]:60152-[::1]:46887]>, SOL_TCP, TCP_MAXSEG, [536], 4) = 0
net-yy-inet6.gen.test: failed test: ../../src/strace -a22 -yy -eclose,network ../net-yy-inet6 output mismatch
FAIL net-yy-inet6.gen.test (exit status: 1)
The text was updated successfully, but these errors were encountered: