Skip to content
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

msgctl02 / msgctl04 broken for mainline 4.18rc5 / Ubuntu 4.4 & 4.15 #369

Closed
Cypresslin opened this issue Jul 17, 2018 · 2 comments
Closed

Comments

@Cypresslin
Copy link
Contributor

These two tests report that

msgctl02:

tst_safe_sysv_ipc.c:51: BROK: msgctl02.c:68: msgget(1627521041, 7b0) failed: EEXIST

msgctl04:

tst_safe_sysv_ipc.c:51: BROK: msgctl04.c:93: msgget(1627521048, 600) failed: EEXIST

This can be reproduced in both Ubuntu Xenial (4.4.0-130), Bionic (4.15.0-28), and mainline v4.18-rc5

One interesting thing is that if you run only the msgctl02 test after a reboot, it will pass for the first run:

msgctl02.c:47: PASS: msgctl(IPC_SET) msg_qbytes - 1
msgctl02.c:54: PASS: msg_qbytes = 16383

For msgctl04 only after a reboot, it will pass no matter how you beat it:

incrementing stop
tst_test.c:1015: INFO: Timeout per run is 0h 05m 00s
msgctl04.c:72: PASS: msgctl(458754, 2, 0x55d59a243980): EACCES
msgctl04.c:72: PASS: msgctl(491523, 2, 0xffffffffffffffff): EFAULT
msgctl04.c:72: PASS: msgctl(491523, 1, 0xffffffffffffffff): EFAULT
msgctl04.c:72: PASS: msgctl(491523, -1, 0x55d59a243980): EINVAL
msgctl04.c:72: PASS: msgctl(-1, 2, 0x55d59a243980): EINVAL
msgctl04.c:72: PASS: msgctl(-1, 1, 0x55d59a243980): EINVAL
msgctl04.c:72: PASS: msgctl(425985, 0, (nil)): EPERM

After msgctl04 has passed, msgctl02 can pass with multiple times without any problem.

@jstancek
Copy link
Contributor

Thanks for report. The problem seems to be that test cleanup() checks for positive value, while it should be checking for nonnegative value.

According to man pages:

If successful, the return value will be the message queue identifier (a nonnegative integer), otherwise -1 with errno indicating the error.

Looking at strace, we indeed get a zero, if I run msgctl02 right after boot:

msgget(0x6100a7cf, IPC_CREAT|IPC_EXCL|0660) = 0

I'll check all msgctl tests.

@jstancek
Copy link
Contributor

Should be fixed by 3e8498a
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants