Skip to contentSkip to conversation

Add test for send(MSG_MORE)

PATCH New Martin Doucha 3 participants 5 messages Aug 28, 2020 – Oct 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add test for send(MSG_MORE)

The setsockopt05 test will not work properly if kernel handles the MSG_MORE flag incorrectly. Add a new test to detect broken test environment.

---
 runtest/syscalls                          |   1 +
 testcases/kernel/syscalls/send/.gitignore |   1 +
 testcases/kernel/syscalls/send/send02.c   | 177 ++++++++++++++++++++++
 3 files changed, 179 insertions(+)
 create mode 100644 testcases/kernel/syscalls/send/send02.c
runtest/syscalls +1 -0
index a6ab75ba7..fd43977fa 100644
@@ -1174,6 +1174,7 @@ semop02 semop02
 semop03 semop03
 
 send01 send01
+send02 send02
 
 sendfile02 sendfile02
 sendfile02_64 sendfile02_64
testcases/kernel/syscalls/send/.gitignore +1 -0
index 9394e972f..ec3cc677c 100644
@@ -1 +1,2 @@
 /send01
+/send02
testcases/kernel/syscalls/send/send02.c new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/1 Add test for send(MSG_MORE)

Hi Martin,

Quoted 2 lines

The setsockopt05 test will not work properly if kernel handles the MSG_MORE flag incorrectly. Add a new test to detect broken test environment.

Thanks for your patch, merged.

Kind regards,
Petr

#2 lore raw

PATCH 1/1 Add test for send(MSG_MORE)

Hi Martin, Peter

Quoted 6 lines

Hi Martin,

Quoted 2 lines

The setsockopt05 test will not work properly if kernel handles the MSG_MORE flag incorrectly. Add a new test to detect broken test environment.

Thanks for your patch, merged.

I test this case on centos8.2, it failed, but it passed on centos7.8 and fedora31. On upstream kernel (5.9-rc7+,commit 6f2f486d57c4,using kvm,4G memory,2 cpus), it also failed. I don't know whether it has some kernel parameters or kconfig to affect this. It seems not a kernel bug and like a environment bug(I guess).

tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

Best Regards
Yang Xu

Quoted 4 lines

Kind regards,
Petr

#3 lore raw

PATCH 1/1 Add test for send(MSG_MORE)

Quoted 11 lines · Yang Xu

I test this case on centos8.2, it failed, but it passed on centos7.8 and fedora31. On upstream kernel (5.9-rc7+,commit 6f2f486d57c4,using kvm,4G memory,2 cpus), it also failed. I don't know whether it has some kernel parameters or kconfig to affect this. It seems not a kernel bug and like a environment bug(I guess).

tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

We have some similar failures on old s390 kernels (v4.4). I can't reproduce any failures at all on our 4.12 and 5.3 kernels.

Can you add some debug prints and check whether it fails on the first iteration or after a few successful loops? Also, do you have any test runs where the TCP test case succeeded?

Signature · 7 lines
Martin Doucha   [email protected]
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
#4 lore raw

PATCH 1/1 Add test for send(MSG_MORE)

Hi Martin

Quoted 7 lines · Yang Xu
Quoted 6 lines

I test this case on centos8.2, it failed, but it passed on centos7.8 and fedora31. On upstream kernel (5.9-rc7+,commit 6f2f486d57c4,using kvm,4G memory,2 cpus), it also failed. I don't know whether it has some kernel parameters or kconfig to affect this. It seems not a kernel bug and like a environment bug(I guess).

Quoted 7 lines
Quoted 5 lines

tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

We have some similar failures on old s390 kernels (v4.4). I can't reproduce any failures at all on our 4.12 and 5.3 kernels.

I try 5.7,5.8 and lastest upstream, it all failed. I didn't figure out the reason.

Quoted 2 lines

Can you add some debug prints and check whether it fails on the first iteration or after a few successful loops?

It fails after a few successful loops in internal(not using -i parameters), and when I lower
the loops into 100, tcp and udp (using send) may succeed

testcases/kernel/syscalls/send/send02.c +1 -1
@@ -129,7 +129,7 @@ static void run(unsigned int n)
         if (tc->needs_accept)
                 SAFE_LISTEN(listen_sock, 1);
 
-       for (i = 0; i < 1000; i++) {
+       for (i = 0; i < 100; i++) {
 

./send02
tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:166: TPASS: TCP send(MSG_MORE) works correctly send02.c:166: TPASS: UDP send(MSG_MORE) works correctly send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

Quoted 3 lines

Also, do you have any test
runs where the TCP test case succeeded?

Yes, tcp test sometimes succeeded.

ps: I think we can send a patch to print more output in this case, so we know which case fails(tcp,udp, send?or sendto, sendmsg ).

Best Regards
Yang Xu