-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
get_peer_creds failed in two tests for ppc64le #222
Comments
@michelmno thanks for the report! I don't have any env with that arch for testing. The interesting part of the traceback is: error('unpack requires a string argument of length 12',)
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/cheroot-6.5.5/cheroot/server.py", line 1273, in communicate
req.respond()
File "/home/abuild/rpmbuild/BUILD/cheroot-6.5.5/cheroot/server.py", line 1077, in respond
self.server.gateway(self).respond()
File "/home/abuild/rpmbuild/BUILD/cheroot-6.5.5/cheroot/test/test_server.py", line 137, in respond
peer_creds = conn.peer_pid, conn.peer_uid, conn.peer_gid
File "/home/abuild/rpmbuild/BUILD/cheroot-6.5.5/cheroot/server.py", line 1405, in peer_pid
pid, _, _ = self.get_peer_creds()
File "/usr/lib/python2.7/site-packages/backports/functools_lru_cache.py", line 137, in wrapper
result = user_function(*args, **kwds)
File "/home/abuild/rpmbuild/BUILD/cheroot-6.5.5/cheroot/server.py", line 1399, in get_peer_creds
pid, uid, gid = struct.unpack(PEERCRED_STRUCT_DEF, peer_creds)
error: unpack requires a string argument of length 12 |
I verified that failure only with python2.7, no failure with python3.7 I tried to modify source file for python2.7; I am not fluent with python, so my 2 added lines are probably wrong, as output seems to be garbage:
gives following output:
|
You may want to add
print('debugmno peer_creds: {!r}'.format(peer_creds))
print(
'PEERCRED_STRUCT_DEF size: {!s}'.
format(struct.calcsize(PEERCRED_STRUCT_DEF))
) |
Also, could you please log python2.7 -c 'import sys; print("byte order: {}".format(sys.byteorder))' in that env |
with your lines:
yes ppc64le is little endian:
|
Interesting, it's supposed to return 3 integers... Do you know what is an integer size under this architecture? |
int is 4 bytes:
|
Can you try the program at the end of http://welz.org.za/notes/on-peer-cred.html to see whether it works (to see whether it's kernel's fault or so and exclude Python from the equation)? Also Oh, and did you run Python 3.7 and 2.7 tests under exactly same env? |
Could you please grep the headers for |
And also grep for |
Please post the output of these: $ python2.7 -c 'import socket; print("SO_PEERCRED: {}".format(socket.SO_PEERCRED))'
$ python3.7 -c 'import socket; print("SO_PEERCRED: {}".format(socket.SO_PEERCRED))' |
If I'm right, 621f4ee should fix this. |
@michelmno once you confirm that it's fine, I'll cut a new release. |
I confirm that with the patch applied to my 3.5.5 version, the two tests passed on python2.7 (and still on python3.7) |
@michelmno released under v6.5.8 |
β I'm submitting a ...
π Describe the bug. What is the current behavior?
cheroot has two failing tests with same reported error when executing on ppc64le.
β What is the motivation / use case for changing the behavior?
π‘ To Reproduce
Steps to reproduce the behavior:
The error is reported in OBS tool while building python-cheroot package for openSUSE ppc64le at https://build.opensuse.org/package/live_build_log/devel:languages:python/python-cheroot/openSUSE_Factory_PowerPC/ppc64le
π‘ Expected behavior
π Details
π Environment
Cheroot version: 3.5.5
CherryPy version: X.X.X (if applicable)
Python version: 3.6.7
OS: openSUSE
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
π Additional context
python_cheroot_standard_ppc64le_201908231005.log
The text was updated successfully, but these errors were encountered: