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

Commit 9e83513e (tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>) is causing failure to socketcall01 test #634

Closed
Cypresslin opened this issue Jan 20, 2020 · 4 comments
Assignees

Comments

@Cypresslin
Copy link
Contributor

Environment: Ubuntu Bionic with 5.0.0-1028-gcp kernel

Bisect shows before commit 9e83513, the socketcall01 test will be skipped with:

tst_test.c:853: CONF: The socketcall() syscall is not supported

After that, it will fail with:

socketcall01.c:42: FAIL: socketcall() for TCP stream failed with -1: ENOSYS (38)
socketcall01.c:42: FAIL: socketcall() for unix domain dgram failed with -1: ENOSYS (38)
socketcall01.c:42: FAIL: socketcall() for Raw socket failed with -1: ENOSYS (38)
socketcall01.c:42: FAIL: socketcall() for UDP dgram failed with -1: ENOSYS (38)
@pevik pevik self-assigned this Jan 20, 2020
@pevik
Copy link
Member

pevik commented Jan 20, 2020

Thanks for a report, I've noticed it on other distros as well. Interesting, I'd expect it would work, as lapi/syscalls.h include <sys/syscall.h>, but obviously not. Looks like it's broken only on intel.

@pevik
Copy link
Member

pevik commented Jan 20, 2020

IMHO test is broken by adding __NR_socketcall.

@pevik
Copy link
Member

pevik commented Jan 20, 2020

OK, __NR_socketcall is -1, that's obviously wrong.

@pevik
Copy link
Member

pevik commented Jan 20, 2020

Proposed fix: https://patchwork.ozlabs.org/patch/1225869/

pevik added a commit to pevik/ltp that referenced this issue Jan 20, 2020
…ection

Besides it's always better to use API functions instead of
reimplementing a wheel it's also needed to fix regression in detecting
socketcall() syscall support for archs which does not support it (e.g.
x86_64, ARM):

socketcall01.c:42: FAIL: socketcall() for TCP stream failed with -1: ENOSYS (38)
socketcall01.c:42: FAIL: socketcall() for unix domain dgram failed with -1: ENOSYS (38)
socketcall01.c:42: FAIL: socketcall() for Raw socket failed with -1: ENOSYS (38)
socketcall01.c:42: FAIL: socketcall() for UDP dgram failed with -1: ENOSYS (38)

Fixes: 9e83513 "tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>"
Fixes: linux-test-project#634

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik added a commit to pevik/ltp that referenced this issue Jan 20, 2020
While socketcall01.c could (and should) be easily fixed by using
tst_syscall() instead of custom syscall support detection and
nothing else was broken by 9e83513, before release do more
conservative fix by moving tst_dev_sync() into library code.

This fixes regression in detecting socketcall() syscall support for
archs which does not support it (e.g.  x86_64, ARM):

    socketcall01.c:42: FAIL: socketcall() for TCP stream failed with -1: ENOSYS (38)
    socketcall01.c:42: FAIL: socketcall() for unix domain dgram failed with -1: ENOSYS (38)
    socketcall01.c:42: FAIL: socketcall() for Raw socket failed with -1: ENOSYS (38)
    socketcall01.c:42: FAIL: socketcall() for UDP dgram failed with -1: ENOSYS (38)

Fixes: 9e83513 "tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>"
Fixes: linux-test-project#634

Suggested-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
@pevik pevik closed this as completed in 4b980c2 Jan 20, 2020
Cypresslin pushed a commit to Cypresslin/ltp that referenced this issue Mar 3, 2020
While socketcall01.c could (and should) be easily fixed by using
tst_syscall() instead of custom syscall support detection and
nothing else was broken by 9e83513, before release do more
conservative fix by moving tst_dev_sync() into library code.

This fixes regression in detecting socketcall() syscall support for
archs which does not support it (e.g.  x86_64, ARM):

    socketcall01.c:42: FAIL: socketcall() for TCP stream failed with -1: ENOSYS (38)
    socketcall01.c:42: FAIL: socketcall() for unix domain dgram failed with -1: ENOSYS (38)
    socketcall01.c:42: FAIL: socketcall() for Raw socket failed with -1: ENOSYS (38)
    socketcall01.c:42: FAIL: socketcall() for UDP dgram failed with -1: ENOSYS (38)

Fixes: 9e83513 "tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>"
Fixes: linux-test-project#634

Suggested-by: Martin Doucha <mdoucha@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
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