tests/tcg/linux-test: Fix random hangs in test_socket
PATCH RESEND 1/1 tests/tcg/linux-test: Fix random hangs in test_socket
test_socket hangs randomly in connect(), especially when run without qemu. Apparently the reason is that linux started treating backlog value of 0 literally instead of rounding it up since v4.4 (commit ef547f2ac16b).
So set it to 1 instead.
---
This is a rebase of the previous submission:
https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg00095.html
tests/tcg/multiarch/linux/linux-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/multiarch/linux/linux-test.c +1 -1
@@ -263,7 +263,7 @@ static int server_socket(void) sockaddr.sin_port =htons (0 );/* choose random ephemeral port) */ sockaddr.sin_addr.s_addr =0 ;chk_error (bind (fd, (struct sockaddr *)&sockaddr,sizeof (sockaddr))); -chk_error (listen (fd,0 )); +chk_error (listen (fd,1 ));return fd; }
Signature · 1 line
2.35.3
Quoted 21 lines · Ilya Leoshkevich
test_sockethangs randomly inconnect(), especially when run without qemu. Apparently the reason is that linux started treating backlog value of 0 literally instead of rounding it up since v4.4 (commitef547f2ac16b).So set it to 1 instead.
Signed-off-by Ilya Leoshkevich <[email protected]>---
This is a rebase of the previous submission:
https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg00095.htmltests/tcg/multiarch/linux/linux-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/tcg/multiarch/linux/linux-test.c +0
-0
tests/tcg/multiarch/linux/linux-test.c static int server_socket(void) · line 269
Quoted 8 lines
tests/tcg/multiarch/linux/linux-test.c +1
-1@@ -263,7 +263,7 @@ static int server_socket(void) sockaddr.sin_port =htons (0 );/* choose random ephemeral port) */ sockaddr.sin_addr.s_addr =0 ;chk_error (bind (fd, (struct sockaddr *)&sockaddr,sizeof (sockaddr))); -chk_error (listen (fd,0 )); +chk_error (listen (fd,1 ));return fd; }
Not really my turf, but if there are no other takers and no complatins, I can take it through my testing branch:
https://gitlab.com/thuth/qemu/-/commits/testing-next
Thomas